{
  "openapi": "3.0.1",
  "info": {
    "title": "PNCP Vencedores & Inteligência de Fornecedores",
    "description": "Enriqueça licitações do PNCP com vencedores por item, CNPJ/razão social, valores homologados, descontos e porte do fornecedor. Compare estimado x homologado e receba agregações grátis de concentração, recorrência, economia e taxa de deserto. Cobrança apenas quando houver resultado.",
    "version": "0.1",
    "x-build-id": "QSLfxjL1FSzJHrGBM"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/johnatan029~pncp-award-vendor-intelligence/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-johnatan029-pncp-award-vendor-intelligence",
        "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/johnatan029~pncp-award-vendor-intelligence/runs": {
      "post": {
        "operationId": "runs-sync-johnatan029-pncp-award-vendor-intelligence",
        "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/johnatan029~pncp-award-vendor-intelligence/run-sync": {
      "post": {
        "operationId": "run-sync-johnatan029-pncp-award-vendor-intelligence",
        "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": [
          "idadeJanelaDias"
        ],
        "properties": {
          "idadeJanelaDias": {
            "title": "Idade da janela (dias atrás)",
            "minimum": 0,
            "maximum": 365,
            "type": "integer",
            "description": "Quantos dias atrás começa a janela de publicação consultada. Resultados de licitação levam semanas para aparecer no PNCP (mediana medida: ~36 dias): janelas de 60–180 dias têm 40–65% de cobertura; janelas frescas têm quase nenhuma. Ignorado se dataInicial/dataFinal forem informadas.",
            "default": 120
          },
          "janelaDias": {
            "title": "Duração da janela (dias)",
            "minimum": 1,
            "maximum": 3,
            "type": "integer",
            "description": "Quantos dias de publicação a janela cobre (1 a 3 — janelas maiores derrubam a API do PNCP, limite herdado do coletor publicado).",
            "default": 1
          },
          "dataInicial": {
            "title": "Data inicial (opcional)",
            "type": "string",
            "description": "Data explícita no formato AAAA-MM-DD. Se informada junto com dataFinal, substitui a janela relativa. Intervalo máximo: 3 dias.",
            "default": ""
          },
          "dataFinal": {
            "title": "Data final (opcional)",
            "type": "string",
            "description": "Data explícita no formato AAAA-MM-DD, usada com dataInicial. Intervalo máximo: 3 dias.",
            "default": ""
          },
          "modalidades": {
            "title": "Modalidades",
            "type": "array",
            "description": "Códigos de modalidade do PNCP (6 = Pregão Eletrônico, 8 = Dispensa de Licitação, etc.). A cobertura de resultado do recon foi medida na modalidade 6.",
            "default": [
              6,
              8
            ]
          },
          "uf": {
            "title": "UF (opcional)",
            "type": "string",
            "description": "Sigla da UF para filtrar na própria API (ex.: MG). Vazio = Brasil inteiro.",
            "default": ""
          },
          "codigoMunicipioIbge": {
            "title": "Município IBGE (opcional)",
            "type": "string",
            "description": "Código IBGE do município (7 dígitos) para filtrar na própria API.",
            "default": ""
          },
          "orgaoCnpj": {
            "title": "CNPJ do órgão (opcional)",
            "type": "string",
            "description": "CNPJ do órgão comprador (14 dígitos) para filtrar na própria API.",
            "default": ""
          },
          "palavrasChave": {
            "title": "Palavras-chave (opcional)",
            "type": "array",
            "description": "Filtra pelo objeto da contratação (sem diferenciar maiúsculas/acentos). Contratações descartadas pelo filtro não geram requisições de itens nem cobrança.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Máx. de registros cobrados",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Teto de contratações enriquecidas (cobradas) por run. A run para graciosamente e mantém o que já entregou.",
            "default": 100
          },
          "maxResultadosPorContratacao": {
            "title": "Máx. de itens com resultado detalhados por contratação",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Teto de requisições de resultado por contratação. Itens além do teto ficam sem detalhe de vencedor e o registro declara resultadosTruncados.",
            "default": 20
          },
          "agregacoes": {
            "title": "Agregações no resumo",
            "type": "boolean",
            "description": "Top fornecedores, concentração do valor, recorrência órgão↔fornecedor, economia estimado×homologado, distribuição de porte e taxa de deserto — grátis, no RUN_SUMMARY.",
            "default": true
          },
          "maxRuntimeMs": {
            "title": "Tempo máximo (ms)",
            "minimum": 10000,
            "maximum": 3600000,
            "type": "integer",
            "description": "Teto de duração. A run para graciosamente ao atingir.",
            "default": 300000
          },
          "debug": {
            "title": "Logs detalhados",
            "type": "boolean",
            "description": "Loga decisões por contratação e esperas de pacing.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}