{
  "openapi": "3.0.1",
  "info": {
    "title": "Consulta CNPJ em Lote: Brazil CNPJ Lookup (Receita Federal)",
    "description": "Consulta CNPJ em lote (Brazil company lookup): bulk CNPJ lookup from Receita Federal open data. Razão social, CNAE, QSA partners, address, phone, Simples/MEI, for leads & KYC. $1.20 per 1,000 found.",
    "version": "1.0",
    "x-build-id": "XRV8NnhkNmEr2IaWl"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/hanielazevedo~brazil-cnpj-company-lookup/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-hanielazevedo-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/hanielazevedo~brazil-cnpj-company-lookup/runs": {
      "post": {
        "operationId": "runs-sync-hanielazevedo-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/hanielazevedo~brazil-cnpj-company-lookup/run-sync": {
      "post": {
        "operationId": "run-sync-hanielazevedo-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",
        "required": [
          "cnpjs"
        ],
        "properties": {
          "cnpjs": {
            "title": "CNPJs",
            "type": "array",
            "description": "List of Brazilian CNPJ numbers, formatted (33.000.167/0001-01) or raw (33000167000101). Numeric and the new alphanumeric CNPJ are supported. Check digits are validated and duplicates removed before any lookup. Invalid CNPJs are reported in the dataset and never charged.",
            "default": [
              "33.000.167/0001-01"
            ],
            "items": {
              "type": "string"
            }
          },
          "includePartners": {
            "title": "Include partners (QSA)",
            "type": "boolean",
            "description": "Include the public partner/shareholder list (Quadro de Sócios e Administradores) published by Receita Federal. Partner CPFs are already masked at the source. Turn off if you don't need personal data (LGPD data minimization).",
            "default": true
          },
          "includeTaxRegimeHistory": {
            "title": "Include tax regime history",
            "type": "boolean",
            "description": "Include the yearly tax regime history (Lucro Real / Presumido / Arbitrado / Imune) when available.",
            "default": false
          },
          "includeRawData": {
            "title": "Include raw source data",
            "type": "boolean",
            "description": "Also attach the untouched JSON returned by the data source in a rawData field.",
            "default": false
          },
          "outputInvalid": {
            "title": "Output rows for invalid CNPJs",
            "type": "boolean",
            "description": "Add a free (uncharged) row with an error for each input that fails CNPJ format/check-digit validation.",
            "default": true
          },
          "padLeadingZeros": {
            "title": "Pad missing leading zeros",
            "type": "boolean",
            "description": "Spreadsheets often drop leading zeros (00000000000191 becomes 191). When on, purely numeric inputs with 3-13 digits are left-padded with zeros to 14 digits before validation.",
            "default": true
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 25,
            "type": "integer",
            "description": "Maximum number of CNPJs looked up in parallel. Keep it modest to respect the free public data sources.",
            "default": 5
          },
          "requestTimeoutSecs": {
            "title": "Request timeout (seconds)",
            "minimum": 3,
            "maximum": 120,
            "type": "integer",
            "description": "Timeout for a single HTTP request to a data source. Failed requests are retried with exponential backoff.",
            "default": 20
          },
          "primaryRequestsPerMinute": {
            "title": "Max requests per minute (primary source)",
            "minimum": 0,
            "maximum": 3000,
            "type": "integer",
            "description": "Politeness cap on requests per minute to the primary source (Minha Receita). 0 = no cap.",
            "default": 300
          },
          "enableBrasilApiFallback": {
            "title": "Use BrasilAPI as fallback",
            "type": "boolean",
            "description": "If the primary source errors or times out, retry the CNPJ on BrasilAPI (throttled to 30 requests/minute).",
            "default": true
          },
          "enableCnpjaFallback": {
            "title": "Use CNPJá public API as last-resort fallback",
            "type": "boolean",
            "description": "Optional last resort for CNPJs that failed on all other sources. The CNPJá public API allows only 5 requests/minute, so this is slow. Off by default.",
            "default": false
          },
          "minhaReceitaBaseUrl": {
            "title": "Minha Receita base URL",
            "type": "string",
            "description": "Base URL of a Minha Receita instance. Use the public one or point to your own self-hosted instance (open source) for very large jobs.",
            "default": "https://minhareceita.org"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}