{
  "openapi": "3.0.1",
  "info": {
    "title": "Brazil CNPJ Scraper: Company Data, Partners, Phone and Email",
    "description": "Look up Brazilian companies by CNPJ or find them by CNAE activity, state and city: legal and trade name, status, opening date, capital, size, Simples and MEI, address, phone, email and partners (QSA) from the Receita Federal open data. No login.",
    "version": "0.1",
    "x-build-id": "2v2pIpaQh2ilgQVc9"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/themineworks~brazil-cnpj-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-themineworks-brazil-cnpj-scraper",
        "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/themineworks~brazil-cnpj-scraper/runs": {
      "post": {
        "operationId": "runs-sync-themineworks-brazil-cnpj-scraper",
        "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/themineworks~brazil-cnpj-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-themineworks-brazil-cnpj-scraper",
        "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": "CNPJ numbers, one per line, with or without dots, slash and dash. Example: 00.000.000/0001-91. One row per CNPJ, whatever its status. Up to 10,000 per run.",
            "items": {
              "type": "string"
            }
          },
          "cnaes": {
            "title": "Activity codes (CNAE)",
            "type": "array",
            "description": "7 digit CNAE subclasses, one per line, with or without the mask. Example: 6201501 (custom software) or 5611-2/01 (restaurants).",
            "items": {
              "type": "string"
            }
          },
          "activityKeywords": {
            "title": "Activity words (Portuguese)",
            "type": "array",
            "description": "Words matched against the official CNAE descriptions, which are in Portuguese. Every word on a line must appear. Example: \"software\", \"restaurante\", \"contabilidade\", \"clinica odontologica\". The codes found are listed in the summary row.",
            "items": {
              "type": "string"
            }
          },
          "cnaeMatch": {
            "title": "Match the activity on",
            "enum": [
              "primary",
              "any"
            ],
            "type": "string",
            "description": "primary: the company's main activity only (tighter lead lists). any: the main or any secondary activity.",
            "default": "primary"
          },
          "states": {
            "title": "States (UF)",
            "type": "array",
            "description": "Two letter state codes or names, one per line. Example: SP, RJ, Minas Gerais. Empty with no city means the whole country.",
            "items": {
              "type": "string"
            }
          },
          "cities": {
            "title": "Cities",
            "type": "array",
            "description": "City names with the state, or 7 digit IBGE codes, one per line. Example: Campinas, SP or 3509502. Accents are optional.",
            "items": {
              "type": "string"
            }
          },
          "legalNatureCodes": {
            "title": "Legal nature codes (optional)",
            "type": "array",
            "description": "4 digit natureza juridica codes, one per line. Example: 2062 (Sociedade Empresaria Limitada), 2135 (Empresario Individual), 2305 (EIRELI).",
            "items": {
              "type": "string"
            }
          },
          "statuses": {
            "title": "Registration status",
            "type": "array",
            "description": "Keep only companies with these statuses in search results. Default: active. Leave empty for every status. Not applied to CNPJ lookups.",
            "items": {
              "type": "string",
              "enum": [
                "active",
                "closed",
                "inapt",
                "suspended",
                "null"
              ],
              "enumTitles": [
                "Active (ATIVA)",
                "Closed (BAIXADA)",
                "Inapt (INAPTA)",
                "Suspended (SUSPENSA)",
                "Null (NULA)"
              ]
            },
            "default": [
              "active"
            ]
          },
          "companySizes": {
            "title": "Company size (optional)",
            "type": "array",
            "description": "Keep only these sizes in search results. Empty means any size.",
            "items": {
              "type": "string",
              "enum": [
                "micro",
                "small",
                "other",
                "not_informed"
              ],
              "enumTitles": [
                "Micro company (ME)",
                "Small company (EPP)",
                "Other (medium or large)",
                "Not informed"
              ]
            }
          },
          "excludeMei": {
            "title": "Leave out MEI (individual micro entrepreneurs)",
            "type": "boolean",
            "description": "On: companies registered as MEI are skipped in search results. Useful for B2B lists, since most MEIs are one person businesses.",
            "default": false
          },
          "headOfficeOnly": {
            "title": "Head offices only",
            "type": "boolean",
            "description": "On: branches (filiais) are skipped in search results, one row per company.",
            "default": false
          },
          "openedFrom": {
            "title": "Opened on or after (optional)",
            "type": "string",
            "description": "Keep companies whose activity start date is on or after this date, YYYY-MM-DD. Example: 2026-01-01 for companies opened this year."
          },
          "openedTo": {
            "title": "Opened on or before (optional)",
            "type": "string",
            "description": "Keep companies whose activity start date is on or before this date, YYYY-MM-DD."
          },
          "minShareCapital": {
            "title": "Minimum share capital in BRL (optional)",
            "minimum": 0,
            "type": "integer",
            "description": "Keep companies with at least this declared share capital. Example: 100000."
          },
          "requirePhone": {
            "title": "Only companies with a phone",
            "type": "boolean",
            "description": "On: search results without a registered phone are skipped and not charged.",
            "default": false
          },
          "requireEmail": {
            "title": "Only companies with an email",
            "type": "boolean",
            "description": "On: search results without a registered email are skipped and not charged. Needs Include email on.",
            "default": false
          },
          "includeEmail": {
            "title": "Include email",
            "type": "boolean",
            "description": "On: the email registered with the Receita Federal is added to each row from a second public source. Off is faster. Same price either way.",
            "default": true
          },
          "maxItems": {
            "title": "Max companies from the search",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "The most companies the search returns, 1 to 20,000. CNPJ lookups are not counted here. Example: 500.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}