{
  "openapi": "3.0.1",
  "info": {
    "title": "Lista de Empresas por CNAE e Consulta CNPJ: Brazil Leads",
    "description": "Lista de empresas ativas por CNAE, cidade, raio e data de abertura, ou consulta CNPJ em lote, com telefone, e-mail, sócios (QSA) e 20 bases do governo. Receita Federal, atualizada todo mês. Brazil company leads and bulk CNPJ lookup.",
    "version": "0.1",
    "x-build-id": "wqxIrd3rbVIQLrwIu"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/leafcliff~brazil-companies-cnpj/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-leafcliff-brazil-companies-cnpj",
        "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/leafcliff~brazil-companies-cnpj/runs": {
      "post": {
        "operationId": "runs-sync-leafcliff-brazil-companies-cnpj",
        "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/leafcliff~brazil-companies-cnpj/run-sync": {
      "post": {
        "operationId": "run-sync-leafcliff-brazil-companies-cnpj",
        "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": [
              "search",
              "lookup"
            ],
            "type": "string",
            "description": "Search companies with filters, or look up a list of CNPJs.",
            "default": "search"
          },
          "states": {
            "title": "States (UF)",
            "type": "array",
            "description": "Leave empty for the whole country.",
            "items": {
              "type": "string",
              "enum": [
                "AC",
                "AL",
                "AM",
                "AP",
                "BA",
                "CE",
                "DF",
                "ES",
                "GO",
                "MA",
                "MG",
                "MS",
                "MT",
                "PA",
                "PB",
                "PE",
                "PI",
                "PR",
                "RJ",
                "RN",
                "RO",
                "RR",
                "RS",
                "SC",
                "SE",
                "SP",
                "TO"
              ]
            }
          },
          "cities": {
            "title": "Cities",
            "type": "array",
            "description": "City names, with or without accents (e.g. São Paulo, Campinas). Combine with the state to avoid homonyms.",
            "items": {
              "type": "string"
            }
          },
          "nearLatitude": {
            "title": "Near: latitude",
            "type": "string",
            "description": "Optional radius search. Center latitude, e.g. -23.5614 (Av. Paulista). Use with longitude and radius."
          },
          "nearLongitude": {
            "title": "Near: longitude",
            "type": "string",
            "description": "Center longitude, e.g. -46.6559."
          },
          "radiusKm": {
            "title": "Radius (km)",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Companies within this distance of the point. Results include distanceKm."
          },
          "cnaes": {
            "title": "CNAE activity codes",
            "type": "array",
            "description": "Full codes (6201-5/01) or prefixes: '62' matches every IT services activity, '4711' every supermarket subclass.",
            "items": {
              "type": "string"
            }
          },
          "cnaeScope": {
            "title": "Match CNAE in",
            "enum": [
              "main",
              "any"
            ],
            "type": "string",
            "description": "Match the CNAE codes in the main activity only, or in the main and secondary activities.",
            "default": "main"
          },
          "openedWithinDays": {
            "title": "Opened in the last N days",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Counted back from the newest opening date in the current dataset. Overrides the date range below."
          },
          "openedFrom": {
            "title": "Opened from",
            "type": "string",
            "description": "YYYY-MM-DD"
          },
          "openedTo": {
            "title": "Opened until",
            "type": "string",
            "description": "YYYY-MM-DD"
          },
          "companySizes": {
            "title": "Company size",
            "type": "array",
            "description": "As declared to Receita Federal. Leave empty for all.",
            "items": {
              "type": "string",
              "enum": [
                "micro",
                "small",
                "other",
                "unknown"
              ],
              "enumTitles": [
                "Micro (ME)",
                "Small (EPP)",
                "Other (medium/large)",
                "Not informed"
              ]
            }
          },
          "simplesNacional": {
            "title": "Simples Nacional",
            "enum": [
              "any",
              "yes",
              "no"
            ],
            "type": "string",
            "description": "Filter by Simples Nacional tax option.",
            "default": "any"
          },
          "mei": {
            "title": "MEI (micro-entrepreneurs)",
            "enum": [
              "any",
              "exclude",
              "only"
            ],
            "type": "string",
            "description": "MEI records come without the owner's CPF and without street number or complement, since the address is usually the owner's home.",
            "default": "any"
          },
          "legalNatures": {
            "title": "Legal nature codes",
            "type": "array",
            "description": "Optional. E.g. 2062 (LTDA), 2135 (Empresário Individual), 2054 (S/A fechada). Leave empty for all.",
            "items": {
              "type": "string"
            }
          },
          "regions": {
            "title": "Regions",
            "type": "array",
            "description": "Brazilian macro-regions. Leave empty for all.",
            "items": {
              "type": "string",
              "enum": [
                "N",
                "NE",
                "CO",
                "SE",
                "S"
              ],
              "enumTitles": [
                "North",
                "Northeast",
                "Center-West",
                "Southeast",
                "South"
              ]
            }
          },
          "minCityPopulation": {
            "title": "Minimum city population",
            "minimum": 0,
            "type": "integer",
            "description": "IBGE population estimate of the company's city."
          },
          "emailTypes": {
            "title": "Email type",
            "type": "array",
            "description": "Corporate = company's own domain. Personal = Gmail, Hotmail etc. Shared = a domain used by many companies, usually the accountant.",
            "items": {
              "type": "string",
              "enum": [
                "corporate",
                "personal",
                "shared"
              ],
              "enumTitles": [
                "Corporate",
                "Personal",
                "Shared (accountant)"
              ]
            }
          },
          "requireWebsite": {
            "title": "Only with a probable website",
            "type": "boolean",
            "description": "The company uses an email on its own domain (e.g. contato@padaria.com.br), which usually is its website.",
            "default": false
          },
          "requireMobile": {
            "title": "Only with a mobile phone (likely WhatsApp)",
            "type": "boolean",
            "description": "Only companies with at least one mobile phone number.",
            "default": false
          },
          "includeGovernmentData": {
            "title": "Include government data (+$1.00 per 1,000)",
            "type": "boolean",
            "description": "Adds federal debt, installment plans, tax regime and benefits, sanctions, public contracts, construction works, trademarks and health, financial and sector registrations. Using any government filter below turns this on automatically.",
            "default": false
          },
          "federalDebt": {
            "title": "Federal tax debt (PGFN)",
            "enum": [
              "any",
              "with",
              "without"
            ],
            "type": "string",
            "description": "Dívida ativa da União, updated quarterly.",
            "default": "any"
          },
          "sanctioned": {
            "title": "Sanctions (CEIS/CNEP)",
            "enum": [
              "any",
              "with",
              "without"
            ],
            "type": "string",
            "description": "Companies currently barred or fined by public administration.",
            "default": "any"
          },
          "taxRegimes": {
            "title": "Tax regime (ECF)",
            "type": "array",
            "description": "Latest regime declared in the ECF. Companies in Simples Nacional do not file an ECF.",
            "items": {
              "type": "string",
              "enum": [
                "real",
                "presumido",
                "arbitrado",
                "imune",
                "isento"
              ],
              "enumTitles": [
                "Lucro Real",
                "Lucro Presumido",
                "Lucro Arbitrado",
                "Immune",
                "Exempt"
              ]
            }
          },
          "govSupplier": {
            "title": "Government supplier (PNCP)",
            "enum": [
              "any",
              "yes",
              "no"
            ],
            "type": "string",
            "description": "Has signed at least one public contract published on PNCP since 2023.",
            "default": "any"
          },
          "requireFlags": {
            "title": "Require markers",
            "type": "array",
            "description": "Only companies where all these markers are true, e.g. anvisaAfeActive, ispProvider, cvmListed, sifRegistered, school. See the README for the full list.",
            "items": {
              "type": "string"
            }
          },
          "headquartersOnly": {
            "title": "Headquarters only",
            "type": "boolean",
            "description": "Skip branch establishments (filiais).",
            "default": false
          },
          "requireEmail": {
            "title": "Only with email",
            "type": "boolean",
            "description": "Only companies with a valid email whose domain accepts mail.",
            "default": false
          },
          "requirePhone": {
            "title": "Only with phone",
            "type": "boolean",
            "description": "Only companies with at least one phone number.",
            "default": false
          },
          "nameContains": {
            "title": "Name contains",
            "type": "string",
            "description": "Text to find in the legal or trade name."
          },
          "onlyNew": {
            "title": "Only new since my last run",
            "type": "boolean",
            "description": "Remembers the newest company delivered for these exact filters and returns only companies opened after it. Great for a weekly or monthly scheduled feed.",
            "default": false
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "You are charged per company returned. Newest companies come first.",
            "default": 1000
          },
          "cnpjs": {
            "title": "CNPJs to look up",
            "type": "array",
            "description": "Used in 'Look up CNPJs' mode. With or without punctuation. CNPJs not found (inactive, MEI, sole proprietor or nonexistent) are not charged.",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}