{
  "openapi": "3.0.1",
  "info": {
    "title": "Brazil Company Registry Data & CNPJ Lookup — Receita Federal",
    "description": "Business registry data for Brazilian companies (CNPJ) from Receita Federal's open registry. Company registry lookup by state, CNAE industry code, municipality, legal form, or partner CPF. Returns full registry data with partners (QSA), addresses, and tax flags.",
    "version": "0.1",
    "x-build-id": "jgXzLFPNpISEHPy4G"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/jungle_synthesizer~brazil-cnpj-receita-federal-crawler/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-jungle_synthesizer-brazil-cnpj-receita-federal-crawler",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/jungle_synthesizer~brazil-cnpj-receita-federal-crawler/runs": {
      "post": {
        "operationId": "runs-sync-jungle_synthesizer-brazil-cnpj-receita-federal-crawler",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/jungle_synthesizer~brazil-cnpj-receita-federal-crawler/run-sync": {
      "post": {
        "operationId": "run-sync-jungle_synthesizer-brazil-cnpj-receita-federal-crawler",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "sp_intended_usage": {
            "title": "What is the intended usage of this data?",
            "minLength": 1,
            "type": "string",
            "description": "What will this data feed? E.g. lead lists, KYB checks, price tracking."
          },
          "sp_improvement_suggestions": {
            "title": "How can we improve this crawler for you?",
            "minLength": 1,
            "type": "string",
            "description": "Provide any feedback or suggestions for improvements."
          },
          "sp_contact": {
            "title": "Contact email (optional)",
            "minLength": 1,
            "type": "string",
            "description": "We'll personally help with your use case. No spam."
          },
          "cnpj": {
            "title": "Single CNPJ",
            "type": "string",
            "description": "Look up a single CNPJ (14 digits, dashes/dots ignored). Overrides all search filters."
          },
          "cnpjs": {
            "title": "Multiple CNPJs (bulk lookup)",
            "type": "array",
            "description": "Look up several CNPJs in one run (one lookup per entry, dashes/dots ignored). Ignored if cnpj is set.",
            "items": {
              "type": "string"
            }
          },
          "states": {
            "title": "States (UF) — multi-select",
            "type": "array",
            "description": "One or more Brazilian state codes. Adds to the single State field below.",
            "items": {
              "type": "string",
              "enum": [
                "AC",
                "AL",
                "AP",
                "AM",
                "BA",
                "CE",
                "DF",
                "ES",
                "GO",
                "MA",
                "MT",
                "MS",
                "MG",
                "PA",
                "PB",
                "PR",
                "PE",
                "PI",
                "RJ",
                "RN",
                "RS",
                "RO",
                "RR",
                "SC",
                "SP",
                "SE",
                "TO"
              ],
              "enumTitles": [
                "Acre (AC)",
                "Alagoas (AL)",
                "Amapá (AP)",
                "Amazonas (AM)",
                "Bahia (BA)",
                "Ceará (CE)",
                "Distrito Federal (DF)",
                "Espírito Santo (ES)",
                "Goiás (GO)",
                "Maranhão (MA)",
                "Mato Grosso (MT)",
                "Mato Grosso do Sul (MS)",
                "Minas Gerais (MG)",
                "Pará (PA)",
                "Paraíba (PB)",
                "Paraná (PR)",
                "Pernambuco (PE)",
                "Piauí (PI)",
                "Rio de Janeiro (RJ)",
                "Rio Grande do Norte (RN)",
                "Rio Grande do Sul (RS)",
                "Rondônia (RO)",
                "Roraima (RR)",
                "Santa Catarina (SC)",
                "São Paulo (SP)",
                "Sergipe (SE)",
                "Tocantins (TO)"
              ]
            }
          },
          "uf": {
            "title": "State (UF)",
            "enum": [
              "",
              "AC",
              "AL",
              "AP",
              "AM",
              "BA",
              "CE",
              "DF",
              "ES",
              "GO",
              "MA",
              "MT",
              "MS",
              "MG",
              "PA",
              "PB",
              "PR",
              "PE",
              "PI",
              "RJ",
              "RN",
              "RS",
              "RO",
              "RR",
              "SC",
              "SP",
              "SE",
              "TO"
            ],
            "type": "string",
            "description": "Brazilian state code. Required for bulk search unless cnae or municipio is set."
          },
          "cnae": {
            "title": "CNAE Code",
            "type": "string",
            "description": "CNAE industry code (matches primary or secondary activities). Example: 6209100 (IT support services)."
          },
          "cnaes": {
            "title": "CNAE Codes (multiple)",
            "type": "array",
            "description": "Two or more CNAE industry codes (matches primary or secondary activities on any). Adds to the single CNAE Code field above.",
            "items": {
              "type": "string"
            }
          },
          "municipio": {
            "title": "Municipality Code (digits only — not a city name)",
            "type": "string",
            "description": "IBGE or SIAFI municipal code, 7 digits, no letters. NOT a city name — typing 'TATUÍ' will be rejected. Find codes at https://www.ibge.gov.br/explica/codigos-dos-municipios.html — e.g. 5300108 (Brasília), 3554102 (Tatuí), 3550308 (São Paulo)."
          },
          "municipalities": {
            "title": "Municipality Codes (multiple)",
            "type": "array",
            "description": "Two or more IBGE/SIAFI municipal codes. Adds to the single Municipality Code field above.",
            "items": {
              "type": "string"
            }
          },
          "situacaoCadastral": {
            "title": "Registration Status",
            "enum": [
              "",
              "ATIVA",
              "SUSPENSA",
              "INAPTA",
              "BAIXADA",
              "NULA"
            ],
            "type": "string",
            "description": "Only return companies with this registration status. Requires at least one other filter (uf/cnae/municipio/etc) — this is applied after fetching."
          },
          "naturezaJuridica": {
            "title": "Legal Form Code",
            "type": "string",
            "description": "Code of legal form (natureza jurídica). Example: 2135 (Empresário Individual / sole proprietor)."
          },
          "partnerCpf": {
            "title": "Partner CPF/CNPJ",
            "type": "string",
            "description": "CPF or CNPJ of a person/entity in the company's QSA partner list. Use the masked Receita format ***123456** for CPF (no dots, no dashes)."
          },
          "pageSize": {
            "title": "Page Size",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Records per API page (1-1000). Larger values are faster but use more memory per request.",
            "default": 100
          },
          "maxItems": {
            "title": "Max Items",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum number of CNPJ records to scrape across all queries. Keep low for first runs to validate output.",
            "default": 50
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}