{
  "openapi": "3.0.1",
  "info": {
    "title": "CNPJ & CEP Bulk Lookup Brazil — Consulta CNPJ e CEP em Lote",
    "description": "Bulk CNPJ and CEP lookup for Brazil. Validates check digits (incl. new alphanumeric CNPJ) and returns Receita Federal open data: razão social, situação cadastral, CNAE, Simples/MEI, address. CEP to full address. Pay only for results found.",
    "version": "0.2",
    "x-build-id": "RzxP9WG4rXDAQeBPi"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/brasil_utils~brazil-cnpj-cep-bulk-lookup/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-brasil_utils-brazil-cnpj-cep-bulk-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/brasil_utils~brazil-cnpj-cep-bulk-lookup/runs": {
      "post": {
        "operationId": "runs-sync-brasil_utils-brazil-cnpj-cep-bulk-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/brasil_utils~brazil-cnpj-cep-bulk-lookup/run-sync": {
      "post": {
        "operationId": "run-sync-brasil_utils-brazil-cnpj-cep-bulk-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",
            "type": "array",
            "description": "List of CNPJs (Brazilian company tax IDs). Any format is accepted: 33.000.167/0001-01, 33000167000101, or with leading zeros lost by Excel (191). New alphanumeric CNPJs (e.g. 12.ABC.345/01DE-35) are validated too.",
            "items": {
              "type": "string"
            }
          },
          "ceps": {
            "title": "CEPs",
            "type": "array",
            "description": "List of CEPs (Brazilian postal codes). Accepts 01001-000, 01001000 or 1001000.",
            "items": {
              "type": "string"
            }
          },
          "bulkText": {
            "title": "Paste mixed list (optional)",
            "type": "string",
            "description": "Paste CNPJs and/or CEPs separated by new lines, commas, semicolons, tabs or spaces (e.g. a column copied from a spreadsheet). Auto-detection: letters or '/' = CNPJ; 9-14 digits = CNPJ; 7-8 digits = CEP; up to 6 digits = CNPJ that lost its leading zeros in Excel (191 = 00.000.000/0001-91). Use \"How to read the pasted list\" to force one type."
          },
          "bulkTextType": {
            "title": "How to read the pasted list",
            "enum": [
              "auto",
              "cnpj",
              "cep"
            ],
            "type": "string",
            "description": "\"auto\" detects each value (rule above). Choose \"cnpj\" or \"cep\" when the pasted list has only one type, e.g. a column of CNPJs with 7-8 digits left after Excel removed the zeros. The separate CNPJs and CEPs fields are never auto-detected.",
            "default": "auto"
          },
          "includeContactInfo": {
            "title": "Include company contact fields",
            "type": "boolean",
            "description": "Adds the registry phone/fax/e-mail of the establishment (as published by Receita Federal). Off by default. Partner (QSA / sócios) personal data is never returned — only the number of partners.",
            "default": false
          },
          "padLeadingZeros": {
            "title": "Restore leading zeros",
            "type": "boolean",
            "description": "Pad numeric CNPJs (<14 digits) and 7-digit CEPs with leading zeros, fixing values mangled by spreadsheets.",
            "default": true
          },
          "deduplicate": {
            "title": "Skip duplicates",
            "type": "boolean",
            "description": "Look up each unique CNPJ/CEP only once (you are charged only once).",
            "default": true
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Parallel requests to the public APIs. Keep low to be polite to free public services and avoid rate limiting.",
            "default": 3
          },
          "maxRetries": {
            "title": "Max retries per source",
            "minimum": 0,
            "maximum": 8,
            "type": "integer",
            "description": "Retries with exponential backoff on HTTP 429/5xx/network errors before falling back to the next source.",
            "default": 4
          },
          "requestTimeoutSecs": {
            "title": "Request timeout (seconds)",
            "minimum": 3,
            "maximum": 60,
            "type": "integer",
            "description": "Timeout for each HTTP request to a data source.",
            "default": 15
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}