Skip to main content

Migrating from CNPJa

Migration from CNPJa is straightforward. The /cnpj/{cnpj} endpoint supports the formato=cnpja parameter, which returns the response in the same format as the CNPJa API.

Step 1: Change the base URL

- https://api.cnpja.com/office/12345678000195
+ https://api.cnpj-api.com.br/v1/cnpj/12345678000195?token=YOUR_TOKEN&formato=cnpja

Step 2: Add authentication

Add the token parameter to the URL or the Authorization: Bearer {token} header.

Step 3: Test

The response will have the same format as CNPJa. No changes to parsing are required.

Differences

AspectCNPJaThis API
AuthenticationAPI Key via headerToken via URL or header
Rate limitPer plan5 req/min (free)
Extra dataRegistration + partnersRegistration + logos + Simples
Native formatProprietaryProprietary (with compatibility)

When to remove the formato parameter

We recommend that, after validating the migration, you remove the formato=cnpja parameter and adapt your code to this API’s native format. The native format offers more fields and better structured data.