{
  "openapi": "3.0.1",
  "info": {
    "title": "PNCP Licitações Brasil — Radar com Itens e Alertas",
    "description": "Licitações abertas do PNCP (governo do Brasil) com itens e preços unitários, filtro por UF, palavra-chave, valor e prazo. Modo alerta só com novidades.",
    "version": "1.0",
    "x-build-id": "NDhVOPRJGryZqwHqC"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/kodama-data~pncp-licitacoes-brasil/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-kodama-data-pncp-licitacoes-brasil",
        "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~pncp-licitacoes-brasil/runs": {
      "post": {
        "operationId": "runs-sync-kodama-data-pncp-licitacoes-brasil",
        "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~pncp-licitacoes-brasil/run-sync": {
      "post": {
        "operationId": "run-sync-kodama-data-pncp-licitacoes-brasil",
        "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": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Modo / Mode",
            "enum": [
              "abertas",
              "publicadas"
            ],
            "type": "string",
            "description": "'abertas' = licitações com recebimento de propostas aberto até a data final (para quem quer vender ao governo). 'publicadas' = tudo que foi publicado no PNCP entre duas datas (para monitoramento/análise).",
            "default": "abertas"
          },
          "dateFrom": {
            "title": "Data inicial (modo publicadas)",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2})?$",
            "type": "string",
            "description": "AAAA-MM-DD. Só usado no modo 'publicadas'. Padrão: ontem."
          },
          "dateTo": {
            "title": "Data final",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2})?$",
            "type": "string",
            "description": "AAAA-MM-DD. Modo 'abertas': propostas abertas até esta data (padrão hoje+30). Modo 'publicadas': fim do período (padrão hoje)."
          },
          "modalidades": {
            "title": "Modalidades",
            "type": "array",
            "description": "Códigos PNCP: 1 Leilão eletrônico, 2 Diálogo competitivo, 3 Concurso, 4 Concorrência eletrônica, 5 Concorrência presencial, 6 Pregão eletrônico, 7 Pregão presencial, 8 Dispensa, 9 Inexigibilidade, 10 Manifestação de interesse, 11 Pré-qualificação, 12 Credenciamento, 13 Leilão presencial.",
            "default": [
              6,
              8
            ]
          },
          "ufs": {
            "title": "UFs (estados)",
            "type": "array",
            "description": "Siglas, ex.: [\"SP\", \"MG\"]. Vazio = Brasil inteiro.",
            "items": {
              "type": "string"
            }
          },
          "codigoMunicipioIbge": {
            "title": "Código IBGE do município",
            "type": "string",
            "description": "Opcional. Ex.: 3550308 (São Paulo)."
          },
          "cnpjOrgao": {
            "title": "CNPJ do órgão",
            "type": "string",
            "description": "Opcional. Só licitações deste órgão público."
          },
          "keywords": {
            "title": "Palavras-chave (qualquer uma)",
            "type": "array",
            "description": "Filtra pelo objeto da compra, sem acento e sem diferenciar maiúsculas. Ex.: [\"software\", \"limpeza\", \"merenda\"].",
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Excluir palavras",
            "type": "array",
            "description": "Descarta licitações cujo objeto contenha alguma destas palavras.",
            "items": {
              "type": "string"
            }
          },
          "minValue": {
            "title": "Valor estimado mínimo (R$)",
            "minimum": 0,
            "type": "integer",
            "description": "Opcional."
          },
          "maxValue": {
            "title": "Valor estimado máximo (R$)",
            "minimum": 0,
            "type": "integer",
            "description": "Opcional."
          },
          "esferas": {
            "title": "Esferas",
            "type": "array",
            "description": "Opcional: Federal, Estadual, Municipal, Distrital.",
            "items": {
              "type": "string",
              "enum": [
                "Federal",
                "Estadual",
                "Municipal",
                "Distrital"
              ]
            }
          },
          "minDaysToDeadline": {
            "title": "Prazo mínimo para preparar proposta (dias)",
            "minimum": 0,
            "type": "integer",
            "description": "Só licitações cujo encerramento de propostas está a pelo menos N dias de hoje. Ex.: 5."
          },
          "onlyNew": {
            "title": "Só novidades (monitoramento)",
            "type": "boolean",
            "description": "Lembra o que já foi entregue em execuções anteriores e retorna só licitações novas. Ideal com agendamento diário + webhook/e-mail.",
            "default": false
          },
          "stateKey": {
            "title": "Nome da memória de monitoramento",
            "type": "string",
            "description": "Use nomes diferentes para monitoramentos independentes (ex.: 'ti-sp', 'merenda-mg').",
            "default": "pncp-licitacoes-vistos"
          },
          "includeItems": {
            "title": "Incluir itens da licitação",
            "type": "boolean",
            "description": "Busca a lista de itens (descrição, quantidade, valor unitário) de cada licitação. 1 requisição extra por licitação — mais lento.",
            "default": false
          },
          "maxItems": {
            "title": "Máximo de resultados",
            "minimum": 1,
            "type": "integer",
            "description": "Limite de licitações salvas no dataset.",
            "default": 500
          },
          "pageSize": {
            "title": "Tamanho da página da API",
            "minimum": 10,
            "maximum": 50,
            "type": "integer",
            "description": "10–50.",
            "default": 50
          },
          "maxPagesPerQuery": {
            "title": "Máx. páginas por consulta",
            "minimum": 1,
            "type": "integer",
            "description": "Limite de páginas da API PNCP por combinação de modalidade/UF. Protege contra execuções longas demais.",
            "default": 200
          },
          "requestDelaySecs": {
            "title": "Pausa entre requisições (s)",
            "type": "string",
            "description": "Rate limit educado com a API pública. Mínimo 0.3.",
            "default": "1.0"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}