Implementing CURP online verification in a React app — what APIs work best?

pablo_frontend opened this thread · · 0 replies

curp-onlineverificationreactrest-api

Question

P
pablo_frontend Asker

I'm building a customer registration form in React for a Mexican insurance company and need to add CURP online verification as an inline validation step. The UX requirement is that when the user finishes typing their 18-character CURP and tabs to the next field, we validate it in real time and show either a green checkmark with their full name or an error message.

The technical challenge is implementing CURP online verification that feels instant to the user while actually querying an external data source. We need the round-trip (frontend → our backend → CURP API → RENAPO → response chain) to complete in under 1.5 seconds to avoid the user perceiving lag. If it takes longer than that, our UX research shows users assume the form is broken and abandon.

Architecture-wise, I'm planning:

  1. Frontend debounces the CURP input field (wait 300ms after last keystroke)
  2. When 18 characters are detected and the format passes a client-side regex check, fire an async request to our Express.js backend
  3. Backend calls the CURP online verification API provider
  4. On success, return the verified name and DOB to the frontend for display
  5. On failure (invalid CURP or API timeout), show appropriate error messaging

My questions are around selecting the right CURP online verification API provider. Specifically I need:

  • Sub-500ms average response time from the API itself (our backend adds ~50ms and network to client adds another 100-200ms)
  • High availability — at least 99.5% uptime since this is a blocking step in our registration flow
  • Sandbox or test mode for development without consuming real credits
  • Clear documentation with code examples, ideally Node.js/JavaScript
  • CORS support is NOT needed since calls go through our backend, but webhook support would be nice for batch operations

I've looked at scraping the RENAPO consultation page directly but that's fragile and probably violates their terms of service. A proper CURP online verification API from a marketplace like apipull.com API Hub seems like the right approach — has anyone integrated one of these into a similar real-time form validation workflow?

Also interested in error handling patterns. What happens if the API is down? Do you fail open (let the user proceed without verification) or fail closed (block registration)? For insurance onboarding we probably need to fail closed, but with a graceful retry mechanism.

Current stack: React 18, Express.js backend, deployed on AWS us-east-1. The CURP API provider being in a Mexico or US-West data center would help with latency.

Answers

● Thread open · 0 replies · Be the first to answer

Find API Providers on apipull.com