{
  "openapi": "3.0.1",
  "info": {
    "title": "CNPJ Lookup & Company Search – Receita Federal",
    "description": "Consulta CNPJ em lote + busca de empresas. Bulk CNPJ lookup and Brazilian company search (CNAE, UF, city, status, size) on official Receita Federal open data, refreshed monthly. QSA partners, address, phone, e-mail, Simples/MEI. 100 CNPJs in ~1.4–4 s. $1.50/1k lookups.",
    "version": "0.3",
    "x-build-id": "Nf0gghH0j3KQcVk7B"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/wlubrigati~cnpj-brasil-empresas/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-wlubrigati-cnpj-brasil-empresas",
        "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/wlubrigati~cnpj-brasil-empresas/runs": {
      "post": {
        "operationId": "runs-sync-wlubrigati-cnpj-brasil-empresas",
        "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/wlubrigati~cnpj-brasil-empresas/run-sync": {
      "post": {
        "operationId": "run-sync-wlubrigati-cnpj-brasil-empresas",
        "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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "lookup",
              "search",
              "newCompanies"
            ],
            "type": "string",
            "description": "lookup = enrich a list of CNPJs; search = find companies by filters; newCompanies = companies opened recently (by opening date) matching the filters.",
            "default": "lookup"
          },
          "cnpjs": {
            "title": "CNPJs (lookup mode)",
            "type": "array",
            "description": "14-digit CNPJs, formatted or not (e.g. 00.000.000/0001-91). An 8-digit root (CNPJ básico) returns the head office (matriz), or all branches if 'Include branches' is on.",
            "items": {
              "type": "string"
            }
          },
          "includeBranches": {
            "title": "Include branches for 8-digit roots",
            "type": "boolean",
            "description": "Lookup mode: for 8-digit roots, return all establishments (filiais) instead of only the head office.",
            "default": false
          },
          "includePartners": {
            "title": "Include partners (QSA)",
            "type": "boolean",
            "description": "Add the partners/administrators list (quadro societário). Off by default because it roughly doubles run time on large batches. CPFs come masked by Receita Federal.",
            "default": false
          },
          "cnaes": {
            "title": "CNAE codes",
            "type": "array",
            "description": "CNAE codes or prefixes (digits only), e.g. 6201501 (exact subclass) or 6201 (all subclasses of class 6201) or 62 (division).",
            "items": {
              "type": "string"
            }
          },
          "includeSecondaryCnae": {
            "title": "Match secondary CNAEs too",
            "type": "boolean",
            "description": "Also match companies that have the CNAE as a secondary activity.",
            "default": false
          },
          "ufs": {
            "title": "States (UF)",
            "type": "array",
            "description": "Two-letter codes, e.g. SP, SC. Empty = all states.",
            "items": {
              "type": "string"
            }
          },
          "municipios": {
            "title": "Municipalities",
            "type": "array",
            "description": "Names (e.g. Joinville, São Paulo) or 7-digit IBGE codes (e.g. 4209102). Combine with UF to disambiguate names.",
            "items": {
              "type": "string"
            }
          },
          "situacoes": {
            "title": "Registration status (situação cadastral)",
            "type": "array",
            "description": "Default: ATIVA only.",
            "items": {
              "type": "string",
              "enum": [
                "ATIVA",
                "BAIXADA",
                "INAPTA",
                "SUSPENSA",
                "NULA"
              ]
            },
            "default": [
              "ATIVA"
            ]
          },
          "portes": {
            "title": "Company size (porte)",
            "type": "array",
            "description": "ME = microempresa, EPP = empresa de pequeno porte, DEMAIS = others, NAO_INFORMADO.",
            "items": {
              "type": "string",
              "enum": [
                "ME",
                "EPP",
                "DEMAIS",
                "NAO_INFORMADO"
              ]
            }
          },
          "openedFrom": {
            "title": "Opened from (YYYY-MM-DD)",
            "type": "string",
            "description": "Opening date (data de início de atividade) on or after."
          },
          "openedTo": {
            "title": "Opened to (YYYY-MM-DD)",
            "type": "string",
            "description": "Opening date on or before."
          },
          "newCompaniesDays": {
            "title": "New companies: opened in the last N days",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Counted back from the dataset snapshot date (Receita publishes monthly).",
            "default": 30
          },
          "capitalMin": {
            "title": "Min share capital (R$)",
            "minimum": 0,
            "type": "integer",
            "description": "Capital social at or above."
          },
          "capitalMax": {
            "title": "Max share capital (R$)",
            "minimum": 0,
            "type": "integer",
            "description": "Capital social at or below."
          },
          "simples": {
            "title": "Simples Nacional",
            "enum": [
              "any",
              "yes",
              "no"
            ],
            "type": "string",
            "description": "Filter by current Simples Nacional option.",
            "default": "any"
          },
          "mei": {
            "title": "MEI",
            "enum": [
              "any",
              "yes",
              "no"
            ],
            "type": "string",
            "description": "Filter by current MEI option.",
            "default": "any"
          },
          "excludeIndividuals": {
            "title": "Exclude MEI / individual entrepreneurs (LGPD)",
            "type": "boolean",
            "description": "Drop MEIs and 'Empresário Individual' records, whose data usually identifies a natural person.",
            "default": false
          },
          "onlyHeadOffice": {
            "title": "Only head offices (matriz)",
            "type": "boolean",
            "description": "Skip branches (filiais).",
            "default": false
          },
          "requireEmail": {
            "title": "Only with e-mail",
            "type": "boolean",
            "description": "Keep only records with a registered e-mail.",
            "default": false
          },
          "requirePhone": {
            "title": "Only with phone",
            "type": "boolean",
            "description": "Keep only records with a registered phone.",
            "default": false
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Upper bound of companies returned (and charged) in search/newCompanies modes.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}