# Brazilian Public Data API — Favorecidos PJ (Legal Entities)

> Brazilian Public Data API — Favorecidos PJ (Legal Entities) is a paid API for AI agents from x402.spectro.sh, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-20).

Looks up Brazilian federal government payment beneficiary data for a given CNPJ (legal entity), returning company name, CNAE activity code, municipality, legal nature, and other public registry fields from the Portal da Transparência.

## Facts

- Endpoint: POST https://x402.spectro.sh/v1/favorecidos?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-20
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/brazilian-public-data-api-favorecidos-pj-legal-entities-03fa90b7
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_3cuAppm_wHV-lRVLshXbs

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability brazilian-public-data-api-favorecidos-pj-legal-entities-03fa90b7 -d '<json body>'
```

Example prompt: Can you look up the official name, CNAE activity code, and municipality for the Brazilian company with CNPJ 12.345.678/0001-95 using the Portal da Transparência favorecidos data?

## When to prefer this

Use this endpoint when you need to look up Brazilian legal entities (companies, NGOs, public bodies) by CNPJ and want official government-sourced data including CNAE sector classification, legal nature, and municipality, especially for compliance, vendor onboarding, or audit workflows. Prefer this over scraping the Portal da Transparência directly since it is a structured, pay-per-call API with provenance metadata included. Not suitable for individual CPF lookups or real-time CNPJ status checks (use the Receita Federal for those).

## Known failure modes

- Invalid or malformed CNPJ input (too short, wrong format) — likely returns a validation error
- CNPJ not found in the favorecidos dataset — returns an empty list with total 0
- CPF (individual taxpayer number) submitted instead of CNPJ — service explicitly rejects CPFs
- Dataset may lag real-time registry changes; data reflects the most recent monthly snapshot (e.g. period 202512)
- Payment failure or insufficient USDC balance via x402 — request not processed

## How this service works

Consultas a dados públicos brasileiros, pagas por chamada em USDC via x402.

## Output

Returns a JSON object with the matched company's full legal name (razão social), trade name (nome fantasia), CNAE code and description, CNAE section code and description, state (UF), municipality, legal nature code and description, entity type (pessoa jurídica), plus metadata including the source dataset period, provenance SHA256, and a unique requestId for auditability.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "document": {
   "type": "string",
   "maxLength": 18,
   "minLength": 14,
   "description": "CNPJ, com ou sem pontuação (o alfanumérico também). CPF não é aceito: este serviço consulta apenas pessoas jurídicas."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "data": {
   "favorecidos": {
    "list": [
     {
      "uf": "DF",
      "cnpj": "12345678000195",
      "municipio": "BRASILIA",
      "secaoCnae": "F",
      "codigoCnae": "4321500",
      "tipoPessoa": "PESSOA JURIDICA",
      "razaoSocial": "EMPRESA EXEMPLO DE SERVICOS LTDA",
      "nomeFantasia": "EXEMPLO SERVICOS",
      "descricaoCnae": "Instalação e manutenção elétrica",
      "descricaoSecaoCnae": "CONSTRUÇÃO",
      "tipoNaturezaJuridica": "Entidades Empresariais",
      "codigoNaturezaJuridica": "2062",
      "descricaoNaturezaJuridica": "Sociedade Empresária Limitada"
     }
    ],
    "total": 1
   }
  },
  "error": false,
  "product": "favorecidos",
  "requestId": "3f2b7c1e-8a4d-4c9f-b0e6-1d5a9c7e2b40",
  "provenance": {
   "url": "https://portaldatransparencia.gov.br/download-de-dados/favorecidos-pj",
   "sha256": "5d89a70f0467ec649ab9a7bf6d83ce1ed1f851ad4a6a0485092ed03968094e19",
   "source": "Portal da Transparência (CGU): Favorecidos PJ",
   "datasets": [
    {
     "id": "favorecidos_pj",
     "fields": [
      "favorecidos"
     ],
     "period": "202512",
     "checkedAt": "2026-01-06T07:04:00Z",
     "updatedAt": "2026-01-05T07:04:00Z"
    }
   ],
   "retrievedAt": "2026-01-01T00:00:00Z"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/brazilian-public-data-api-favorecidos-pj-legal-entities-03fa90b7/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.spectro.sh](https://www.zero.xyz/host/x402.spectro.sh/llms.txt)
