{
  "openapi": "3.0.1",
  "info": {
    "title": "Brazil CNPJ Lookup — Receita Federal Company Data, Bulk",
    "description": "Look up Brazilian companies by CNPJ in bulk, or search the Receita Federal register by state, CNAE, municipality or legal nature: status, activities, address, capital, Simples/MEI, tax regime, company partners. No key. Part of NexGen Signal — data tools and official-source data products",
    "version": "0.1",
    "x-build-id": "la55Em8SOt69Puy65"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nexgensignal~brazil-cnpj-company-lookup/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nexgensignal-brazil-cnpj-company-lookup",
        "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/nexgensignal~brazil-cnpj-company-lookup/runs": {
      "post": {
        "operationId": "runs-sync-nexgensignal-brazil-cnpj-company-lookup",
        "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/nexgensignal~brazil-cnpj-company-lookup/run-sync": {
      "post": {
        "operationId": "run-sync-nexgensignal-brazil-cnpj-company-lookup",
        "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",
            "type": "array",
            "description": "CNPJs with or without punctuation. Check digits are verified; invalid ones are listed in the receipt and never charged. Up to 100,000 per run.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "states": {
            "title": "Search: states (UF)",
            "type": "array",
            "description": "Search companies in these states. A state-only search is limited to 3 states; add a CNAE, municipality or legal nature for wider searches.",
            "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"
              ]
            },
            "default": []
          },
          "cnaes": {
            "title": "Search: CNAE activity codes",
            "type": "array",
            "description": "7-digit CNAE codes, e.g. 6201501 or 6201-5/01. Matches primary or secondary activity unless 'Primary CNAE only' is on.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "primaryCnaeOnly": {
            "title": "Primary CNAE only",
            "type": "boolean",
            "description": "Match the CNAE codes against the primary activity only.",
            "default": false
          },
          "municipalities": {
            "title": "Search: municipality codes",
            "type": "array",
            "description": "IBGE (7-digit, e.g. 3550308 São Paulo) or SIAFI (4-digit) codes — not names.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "legalNatureCodes": {
            "title": "Search: legal nature codes",
            "type": "array",
            "description": "4-digit natureza jurídica codes, e.g. 2062 (LTDA), 2054 (S.A. fechada), 2046 (S.A. aberta).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "statuses": {
            "title": "Status",
            "type": "array",
            "description": "Keep only these registration statuses. Empty = all.",
            "items": {
              "type": "string",
              "enum": [
                "ATIVA",
                "SUSPENSA",
                "INAPTA",
                "BAIXADA",
                "NULA"
              ]
            },
            "default": []
          },
          "branchType": {
            "title": "Headquarters or branches",
            "enum": [
              "all",
              "headquarters",
              "branch"
            ],
            "type": "string",
            "description": "Keep headquarters (matriz), branches (filial) or both.",
            "default": "all"
          },
          "openedAfter": {
            "title": "Opened on or after",
            "type": "string",
            "description": "Date like 2024-01-01: keep companies that started activity on or after it (find new companies)."
          },
          "openedBefore": {
            "title": "Opened on or before",
            "type": "string",
            "description": "Date like 2010-12-31."
          },
          "includeTaxRegime": {
            "title": "Include tax regime",
            "type": "boolean",
            "description": "Add the tax regime by year (Lucro Real, Lucro Presumido…) when on file.",
            "default": true
          },
          "maxScan": {
            "title": "Search results to read",
            "minimum": 100,
            "maximum": 2000000,
            "type": "integer",
            "description": "Search reads up to this many companies before stopping. Status, branch and opening-date filters are applied to what is read, so raise this for rare matches (search reads about 1,000 companies every 2 seconds).",
            "default": 20000
          },
          "maxRecords": {
            "title": "Maximum records",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Stop after this many companies. Each delivered company is billed; CNPJs not found are not.",
            "default": 1000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}