> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cnpj-api.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Migrate from ReceitaWS

> How to migrate your integration from ReceitaWS to the CNPJ Lookup API

# Migrating from ReceitaWS

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

## Step 1: Change the base URL

```diff theme={null}
- https://receitaws.com.br/v1/cnpj/12345678000195
+ https://api.cnpj-api.com/v1/cnpj/12345678000195?token=YOUR_TOKEN&formato=receitaws
```

## 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 ReceitaWS. No changes to parsing are required.

## Differences

| Aspect         | ReceitaWS         | This API                         |
| -------------- | ----------------- | -------------------------------- |
| Authentication | Varies by plan    | Token via URL or header          |
| Rate limit     | Varies by plan    | 5 req/min (free)                 |
| Extra data     | Registration only | Registration + logos + Simples   |
| Native format  | Proprietary       | Proprietary (with compatibility) |

## When to remove the `formato` parameter

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