{
  "openapi": "3.0.1",
  "info": {
    "title": "CNPJ em Lote — Saúde do Fornecedor e Alertas de Mudança",
    "description": "Consulta CNPJ em lote (Receita Federal) com veredito APTO/ATENÇÃO/BLOQUEAR, monitor de mudanças e CNPJ alfanumérico. LGPD-safe, sem sócios PF.",
    "version": "1.0",
    "x-build-id": "VakgOIvYxiwwe4o5q"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/kodama-data~cnpj-lote-saude-fornecedor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-kodama-data-cnpj-lote-saude-fornecedor",
        "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/kodama-data~cnpj-lote-saude-fornecedor/runs": {
      "post": {
        "operationId": "runs-sync-kodama-data-cnpj-lote-saude-fornecedor",
        "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/kodama-data~cnpj-lote-saude-fornecedor/run-sync": {
      "post": {
        "operationId": "run-sync-kodama-data-cnpj-lote-saude-fornecedor",
        "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": "Um CNPJ por linha, com ou sem pontuação. Aceita CNPJ alfanumérico (2026).",
            "items": {
              "type": "string"
            }
          },
          "cnpjText": {
            "title": "Ou cole um texto/planilha",
            "type": "string",
            "description": "Cole qualquer texto (coluna do Excel, e-mail, CSV). O actor extrai os CNPJs sozinho, remove duplicados e recupera zeros à esquerda perdidos pelo Excel."
          },
          "cnpjFileUrls": {
            "title": "Ou URLs de arquivos CSV/TXT",
            "type": "array",
            "description": "Links públicos (Google Sheets publicado como CSV, Dropbox, etc.).",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "expectedCnaePrefixes": {
            "title": "CNAEs esperados (opcional)",
            "type": "array",
            "description": "Prefixos de CNAE que o fornecedor deveria ter (ex.: 4721 = padaria/laticínios, 5620 = alimentação). Se nenhum CNAE bater, gera alerta.",
            "items": {
              "type": "string"
            }
          },
          "minCompanyAgeYears": {
            "title": "Idade mínima da empresa (anos)",
            "minimum": 0,
            "type": "integer",
            "description": "Empresas mais novas que isso recebem alerta.",
            "default": 1
          },
          "onlyChanges": {
            "title": "Só mudanças (modo monitor)",
            "type": "boolean",
            "description": "Retorna apenas CNPJs novos no monitor ou que mudaram (situação, endereço, CNAE, Simples, sócios...) desde a última execução com o mesmo stateKey. Agende diário/semanal + webhook = alerta automático.",
            "default": false
          },
          "stateKey": {
            "title": "Nome do monitor",
            "type": "string",
            "description": "Separe carteiras diferentes (ex.: 'fornecedores', 'clientes-sp').",
            "default": "padrao"
          },
          "onlyActive": {
            "title": "Somente ATIVAS",
            "type": "boolean",
            "description": "Se marcado, entrega só empresas com situação cadastral ATIVA na Receita.",
            "default": false
          },
          "ufs": {
            "title": "Filtrar por UF",
            "type": "array",
            "description": "Ex.: SP, MG. Vazio = todas.",
            "items": {
              "type": "string"
            }
          },
          "includeContacts": {
            "title": "Incluir e-mail/telefone da empresa",
            "type": "boolean",
            "description": "Somente para pessoas jurídicas. Para MEI/empresário individual nunca é exportado (LGPD).",
            "default": true
          },
          "includeInvalid": {
            "title": "Listar CNPJs inválidos/não encontrados",
            "type": "boolean",
            "description": "Inclui no resultado os CNPJs com dígito inválido ou não encontrados, marcados como tal.",
            "default": true
          },
          "maxItems": {
            "title": "Máximo de CNPJs",
            "minimum": 1,
            "type": "integer",
            "description": "Limite de CNPJs processados nesta execução.",
            "default": 1000
          },
          "concurrency": {
            "title": "Consultas simultâneas",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Número de consultas paralelas à base pública (1–5). Mais alto = mais rápido, mas sujeito a limite de taxa.",
            "default": 2
          },
          "delaySeconds": {
            "title": "Pausa entre requisições (s)",
            "type": "string",
            "description": "Pausa em segundos entre requisições à base pública (rate limit educado). Ex.: 0.4.",
            "default": "0.4"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}