{
  "openapi": "3.0.1",
  "info": {
    "title": "Brazil CNPJ Scraper: Company Search & Lookup",
    "description": "Look up Brazilian companies by CNPJ or search the Receita Federal register by state, city, CNAE code and legal form. Returns legal name, status, activities, address, phones and share capital. Company-level data: partners as a count, sole traders skipped. Filtered-out rows are never charged.",
    "version": "0.0",
    "x-build-id": "uw6CjgPEkJxUxBG86"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/enisbodlli~brazil-cnpj-company-search/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-enisbodlli-brazil-cnpj-company-search",
        "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/enisbodlli~brazil-cnpj-company-search/runs": {
      "post": {
        "operationId": "runs-sync-enisbodlli-brazil-cnpj-company-search",
        "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/enisbodlli~brazil-cnpj-company-search/run-sync": {
      "post": {
        "operationId": "run-sync-enisbodlli-brazil-cnpj-company-search",
        "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": {
          "cnpjs": {
            "title": "CNPJs to look up",
            "maxItems": 5000,
            "type": "array",
            "description": "CNPJ numbers, one per line, with or without punctuation (33.000.167/0001-01 or 33000167000101). The new alphanumeric CNPJ (12.ABC.345/01DE-35) is accepted too. Check digits are verified before any request: an entry that fails is skipped, named in the run summary and costs nothing. Repeated numbers are looked up once. Every valid CNPJ gives one row; only rows with a company are charged. Up to 5,000 per run.",
            "items": {
              "type": "string"
            }
          },
          "states": {
            "title": "States (UF)",
            "maxItems": 27,
            "type": "array",
            "description": "Search companies registered in these Brazilian states. Applied by the register source. A search needs at least one of: states, city, CNAE codes, legal forms.",
            "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": [
                "AC - Acre",
                "AL - Alagoas",
                "AP - Amapá",
                "AM - Amazonas",
                "BA - Bahia",
                "CE - Ceará",
                "DF - Distrito Federal",
                "ES - Espírito Santo",
                "GO - Goiás",
                "MA - Maranhão",
                "MT - Mato Grosso",
                "MS - Mato Grosso do Sul",
                "MG - Minas Gerais",
                "PA - Pará",
                "PB - Paraíba",
                "PR - Paraná",
                "PE - Pernambuco",
                "PI - Piauí",
                "RJ - Rio de Janeiro",
                "RN - Rio Grande do Norte",
                "RS - Rio Grande do Sul",
                "RO - Rondônia",
                "RR - Roraima",
                "SC - Santa Catarina",
                "SP - São Paulo",
                "SE - Sergipe",
                "TO - Tocantins"
              ]
            }
          },
          "city": {
            "title": "City",
            "maxLength": 100,
            "type": "string",
            "description": "One municipality, by name (São Paulo, Campinas) or by its 7-digit IBGE code (3550308). Accents and capitals do not matter. A name that exists in several states, such as Bom Jesus, needs the state: write \"Bom Jesus, PI\" or select the state above. An unknown or ambiguous name stops the run before any work, with the possible matches in the message."
          },
          "cnaeCodes": {
            "title": "CNAE activity codes",
            "maxItems": 50,
            "type": "array",
            "description": "CNAE subclass codes, all 7 digits, with or without punctuation: 6201501 or 6201-5/01 (custom software development). A company matches when its main activity is one of the codes. Applied by the register source. Check the code: the source does not answer a search for a code that does not exist.",
            "items": {
              "type": "string"
            }
          },
          "includeSecondaryCnae": {
            "title": "Also match secondary activities",
            "type": "boolean",
            "description": "When on, a company matches the CNAE codes above if its main activity or any of its secondary activities is one of them. When off, only the main activity counts.",
            "default": false
          },
          "legalNatures": {
            "title": "Legal forms (natureza jurídica)",
            "maxItems": 50,
            "type": "array",
            "description": "4-digit legal-nature codes, with or without the hyphen: 2062 (Sociedade Empresária Limitada), 2054 (Sociedade Anônima Fechada), 2046 (Sociedade Anônima Aberta), 2240 (Sociedade Simples Limitada), 3069 (Fundação Privada). Applied by the register source. Codes of natural persons are refused, because this Actor returns companies only: 2135 (sole trader), 4000 to 4999, 2283 (consortium of rural employers) and 3034 (notary office). Check the code: the source does not answer a search for a code that does not exist.",
            "items": {
              "type": "string"
            }
          },
          "activeOnly": {
            "title": "Active companies only",
            "type": "boolean",
            "description": "Keep only companies whose registration status is active (ATIVA). About half the register is closed, suspended or unfit companies. The register source cannot filter by status, so the Actor filters the rows it fetched: a row that is dropped is not stored and not charged. Applies to search only; a looked-up CNPJ is returned whatever its status.",
            "default": true
          },
          "companySizes": {
            "title": "Company sizes",
            "maxItems": 3,
            "type": "array",
            "description": "Keep only companies of these sizes (the register's \"porte\"). Empty keeps every size. Filtered by the Actor after fetching; dropped rows are not charged. Applies to search only.",
            "items": {
              "type": "string",
              "enum": [
                "micro",
                "small",
                "other"
              ],
              "enumTitles": [
                "Micro (Microempresa, ME)",
                "Small (Empresa de Pequeno Porte, EPP)",
                "Other (Demais: medium and large)"
              ]
            }
          },
          "openedAfter": {
            "title": "Opened on or after",
            "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$",
            "type": "string",
            "description": "Keep only companies that started activity on or after this date (YYYY-MM-DD). Filtered by the Actor after fetching; dropped rows are not charged. The source does not sort by date and its data is a monthly extract, so use this with a narrow search (one city or one CNAE code): on a broad search most rows are read and dropped, and the scan cap ends the run early."
          },
          "maxResults": {
            "title": "Maximum search results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "The search stops when this many companies are stored. It limits what a search can cost: each stored company is one charged event. Lookups are not counted: every CNPJ in the list above is looked up.",
            "default": 100
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}