Skip to main content

Authentication

All API requests require an authentication token. We offer both free and paid tokens.

Free tokens

Free tokens are available to all users with a limit of 5 queries per minute and access to all endpoints. For higher needs, paid tokens offer higher limits and dedicated support. See Rate Limits for more details.

Creating an account

See Create Account for instructions on how to get your token.

Authentication methods

The preferred authentication method is to send the token as a token URL parameter:
curl "https://api.cnpj-api.com.br/v1/cnpj/12345678000195?token=YOUR_TOKEN"

Via HTTP header

Alternatively, send the token in the Authorization header:
curl -H "Authorization: Bearer YOUR_TOKEN" \
  "https://api.cnpj-api.com.br/v1/cnpj/12345678000195"

Error responses

CodeDescription
401Invalid or missing token
429Request limit exceeded
When receiving 429, wait 1 minute before retrying. Paid tokens have higher limits.