{
  "openapi": "3.0.1",
  "info": {
    "title": "PNCP Licitações Scraper – Brazil Public Tenders (Editais) API",
    "description": "Search open public tenders (licitações, editais, pregões) on Brazil's official PNCP portal by keyword, state, modality, government level and date. Get buyer, object, estimated value, deadlines, line items, edital PDFs and official links as JSON/CSV. From $10 per 1,000 tenders.",
    "version": "0.1",
    "x-build-id": "eNGatI1yzyvDYnNv1"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/opentenders~pncp-licitacoes-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-opentenders-pncp-licitacoes-scraper",
        "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/opentenders~pncp-licitacoes-scraper/runs": {
      "post": {
        "operationId": "runs-sync-opentenders-pncp-licitacoes-scraper",
        "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/opentenders~pncp-licitacoes-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-opentenders-pncp-licitacoes-scraper",
        "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": {
          "documentType": {
            "title": "Document type",
            "enum": [
              "edital",
              "ata",
              "contrato"
            ],
            "type": "string",
            "description": "<b>Edital</b> = tender notices (default). <b>Ata</b> = price-registration minutes (atas de registro de preços: who won, unit prices, validity, adhesion allowed). <b>Contrato</b> = signed contracts (supplier, global value, validity).",
            "default": "edital"
          },
          "keyword": {
            "title": "Keyword (palavra-chave)",
            "type": "string",
            "description": "Full-text search over the tender object/description, e.g. <code>software</code>, <code>material hospitalar</code>, <code>energia solar</code>. Leave empty to list every tender matching the filters."
          },
          "status": {
            "title": "Status",
            "type": "array",
            "description": "Leave empty for the default: editais receiving proposals, or atas/contratos in force (vigente). Editais also accept proposals closed / under evaluation and finished; atas and contratos also accept expired (não vigente). Pick several to combine them; values that do not apply to the chosen document type are ignored.",
            "items": {
              "type": "string",
              "enum": [
                "recebendo_proposta",
                "propostas_encerradas",
                "encerradas",
                "vigente",
                "nao_vigente"
              ],
              "enumTitles": [
                "Edital: receiving proposals (recebendo proposta)",
                "Edital: proposals closed / under evaluation",
                "Edital: finished (encerradas)",
                "Ata/Contrato: in force (vigente)",
                "Ata/Contrato: expired (não vigente)"
              ]
            }
          },
          "ufs": {
            "title": "States (UF)",
            "type": "array",
            "description": "Brazilian states to search. Empty = whole country. Each state costs one extra request per page.",
            "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"
              ]
            },
            "default": []
          },
          "modalidades": {
            "title": "Modality (modalidade)",
            "type": "array",
            "description": "Procurement modality. Empty = all modalities.",
            "items": {
              "type": "string",
              "enum": [
                "6",
                "4",
                "8",
                "9",
                "12",
                "15",
                "7",
                "5",
                "1",
                "13",
                "2",
                "3",
                "10",
                "11",
                "14",
                "16",
                "17",
                "18",
                "19"
              ],
              "enumTitles": [
                "Pregão - Eletrônico",
                "Concorrência - Eletrônica",
                "Dispensa",
                "Inexigibilidade",
                "Credenciamento",
                "Chamada pública",
                "Pregão - Presencial",
                "Concorrência - Presencial",
                "Leilão - Eletrônico",
                "Leilão - Presencial",
                "Diálogo Competitivo",
                "Concurso",
                "Manifestação de Interesse",
                "Pré-qualificação",
                "Inaplicabilidade da Licitação",
                "Concorrência - Eletrônica Internacional",
                "Concorrência - Presencial Internacional",
                "Pregão - Eletrônico Internacional",
                "Pregão - Presencial Internacional"
              ]
            },
            "default": []
          },
          "esferas": {
            "title": "Government level (esfera)",
            "type": "array",
            "description": "Federal, state, municipal or district (Brasília) buyers. Empty = all.",
            "items": {
              "type": "string",
              "enum": [
                "F",
                "E",
                "M",
                "D"
              ],
              "enumTitles": [
                "Federal",
                "Estadual (state)",
                "Municipal",
                "Distrital (Federal District)"
              ]
            },
            "default": []
          },
          "municipioIbge": {
            "title": "Municipality IBGE code",
            "pattern": "^[0-9]{7}$",
            "type": "string",
            "description": "Optional 7-digit IBGE code of one municipality, e.g. <code>3550308</code> for São Paulo. Find codes at cidades.ibge.gov.br."
          },
          "publishedAfter": {
            "title": "Published after (YYYY-MM-DD)",
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
            "type": "string",
            "description": "Only tenders published on PNCP on or after this date. Ideal for scheduled daily runs: set it to yesterday to get only new tenders. Applied while paging newest-first, so the run stops early and stays cheap."
          },
          "sort": {
            "title": "Sort",
            "enum": [
              "-data",
              "relevancia"
            ],
            "type": "string",
            "description": "Newest first (default) or best keyword match first.",
            "default": "-data"
          },
          "maxItems": {
            "title": "Max tenders",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after this many tenders. This caps your cost.",
            "default": 100
          },
          "includeDetails": {
            "title": "Include line items and documents",
            "type": "boolean",
            "description": "Editais only: also fetch each tender's line items (what is being bought: description, quantity, unit, estimated unit price) and the list of official documents (edital PDF etc.). Two extra requests per tender; charged as a separate, higher-priced event. Ignored for atas and contratos.",
            "default": false
          },
          "minResults": {
            "title": "Minimum results (monitoring)",
            "minimum": 0,
            "type": "integer",
            "description": "Optional. Fail the run if fewer tenders than this are found. Use it in a scheduled test task so you get an alert when PNCP changes or goes down. Leave empty for normal use."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}