{
  "openapi": "3.0.1",
  "info": {
    "title": "LicitacoesBR — Radar de Licitações PNCP",
    "description": "Radar de contratações públicas do Brasil via API oficial de dados abertos do PNCP (Lei 14.133/2021). 3 modos: novos editais, prazos encerrando e vencedores com CNPJ/valores. Filtros por UF, modalidade, valor e palavras-chave. Dedup para monitoramento diário. Output flat pronto para Sheets/CRM.",
    "version": "0.1",
    "x-build-id": "wzMAfQM5d1G1OmZKy"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/joaosbp~licitacoes-pncp-br/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-joaosbp-licitacoes-pncp-br",
        "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/joaosbp~licitacoes-pncp-br/runs": {
      "post": {
        "operationId": "runs-sync-joaosbp-licitacoes-pncp-br",
        "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/joaosbp~licitacoes-pncp-br/run-sync": {
      "post": {
        "operationId": "run-sync-joaosbp-licitacoes-pncp-br",
        "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": {
          "modo": {
            "title": "Modo de busca",
            "enum": [
              "oportunidades",
              "encerrando",
              "vencedores"
            ],
            "type": "string",
            "description": "oportunidades: editais publicados no período. encerrando: editais recebendo propostas com encerramento até dataFinal (radar de prazos). vencedores: contratos publicados no período, com CNPJ/nome do fornecedor e valores (inteligência competitiva).",
            "default": "oportunidades"
          },
          "dataInicial": {
            "title": "Data inicial (YYYY-MM-DD)",
            "type": "string",
            "description": "Início do período de publicação. Vazio = padrão rápido (ontem, para oportunidades/vencedores; hoje, para encerrando)."
          },
          "dataFinal": {
            "title": "Data final (YYYY-MM-DD)",
            "type": "string",
            "description": "Fim do período. No modo encerrando, é o limite do prazo de propostas (padrão: hoje + 7 dias). Períodos longos são quebrados automaticamente em blocos mensais."
          },
          "modalidades": {
            "title": "Modalidades",
            "uniqueItems": true,
            "type": "array",
            "description": "6 = Pregão Eletrônico, 8 = Dispensa de Licitação, 4 = Concorrência Eletrônica, 9 = Inexigibilidade etc. (códigos da Lei 14.133). Padrão: Pregão Eletrônico + Dispensa.",
            "items": {
              "type": "string",
              "enum": [
                "1",
                "2",
                "3",
                "4",
                "5",
                "6",
                "7",
                "8",
                "9",
                "10",
                "11",
                "12",
                "13"
              ],
              "enumTitles": [
                "Leilão Eletrônico",
                "Diálogo Competitivo",
                "Concurso",
                "Concorrência Eletrônica",
                "Concorrência Presencial",
                "Pregão Eletrônico",
                "Pregão Presencial",
                "Dispensa de Licitação",
                "Inexigibilidade",
                "Manifestação de Interesse",
                "Pré-qualificação",
                "Credenciamento",
                "Leilão Presencial"
              ]
            },
            "default": [
              "6",
              "8"
            ]
          },
          "ufs": {
            "title": "UFs (estados)",
            "uniqueItems": true,
            "type": "array",
            "description": "Filtra por estado da unidade compradora. Vazio = Brasil inteiro. No modo oportunidades o filtro é feito na API (mais rápido).",
            "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"
              ]
            }
          },
          "palavrasChave": {
            "title": "Palavras-chave no objeto (OU)",
            "type": "array",
            "description": "Só entram registros cujo objeto contenha pelo menos uma destas palavras (ignora acentos e maiúsculas). Ex.: informática, medicamento, obra.",
            "items": {
              "type": "string"
            }
          },
          "palavrasChaveExcluir": {
            "title": "Palavras-chave para excluir",
            "type": "array",
            "description": "Registros cujo objeto contenha qualquer uma destas palavras são descartados (útil para limpar ruído, ex.: excluir 'locação' quando você vende compra).",
            "items": {
              "type": "string"
            }
          },
          "valorMin": {
            "title": "Valor mínimo (R$)",
            "type": "number",
            "description": "Valor estimado (editais) ou valor global (contratos) mínimo. Vazio = sem limite."
          },
          "valorMax": {
            "title": "Valor máximo (R$)",
            "type": "number",
            "description": "Valor estimado/global máximo. Vazio = sem limite."
          },
          "cnpjOrgao": {
            "title": "CNPJ do órgão comprador (opcional)",
            "type": "string",
            "description": "Restringe a busca a um único órgão (14 dígitos, com ou sem pontuação). Útil para monitorar um cliente ou prefeitura específica."
          },
          "apenasNovos": {
            "title": "Apenas itens novos (dedup)",
            "type": "boolean",
            "description": "Ligado: retorna só itens nunca vistos em runs anteriores deste Actor (memória no Key-Value Store). Ideal para monitoramento agendado diário — sem duplicados no seu pipeline.",
            "default": false
          },
          "maxResultados": {
            "title": "Máximo de resultados",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Limite de registros no dataset (padrão 100).",
            "default": 100
          },
          "maxPaginas": {
            "title": "Máximo de páginas por consulta",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Trava de segurança por combinação modalidade/UF/mês (padrão 2 = até 100 itens por consulta). Aumente para varreduras profundas — a API do PNCP é lenta (30-60s/página).",
            "default": 2
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}