{
  "openapi": "3.0.1",
  "info": {
    "title": "PNCP Scraper: Brazil Public Tenders (Licitações)",
    "description": "Search Brazil's official PNCP portal for public tenders (licitações) by keyword in seconds, nationwide. Filter by state, city, modality, sphere, value and deadline. Get estimated values, deadlines, items, documents, a TENDER_REPORT and a monitor for new tenders.",
    "version": "0.1",
    "x-build-id": "JSnrjeKrUqLUwVbXA"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/kareninatech~pncp-licitacoes-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-kareninatech-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/kareninatech~pncp-licitacoes-scraper/runs": {
      "post": {
        "operationId": "runs-sync-kareninatech-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/kareninatech~pncp-licitacoes-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-kareninatech-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": {
          "keywords": {
            "title": "Keywords (what you sell)",
            "type": "array",
            "description": "One search per line, e.g. software, material hospitalar, merenda escolar, energia solar, limpeza. Searched in the tender object across all Brazil. Leave empty for the newest tenders.",
            "items": {
              "type": "string"
            }
          },
          "status": {
            "title": "Status",
            "enum": [
              "open",
              "closed",
              "all"
            ],
            "type": "string",
            "description": "open = receiving proposals now (default). closed = proposals closed. all = both.",
            "default": "open"
          },
          "max_items": {
            "title": "Max tenders",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Maximum tenders to save in total (shared between keywords).",
            "default": 100
          },
          "states": {
            "title": "States (UF)",
            "type": "array",
            "description": "Optional. UF codes or names, e.g. SP, RJ, MG, Paraná. Empty = all Brazil.",
            "items": {
              "type": "string"
            }
          },
          "cities": {
            "title": "Cities",
            "type": "array",
            "description": "Optional. Keep tenders from these municipalities, e.g. Curitiba, Campinas. Accents are optional.",
            "items": {
              "type": "string"
            }
          },
          "modalities": {
            "title": "Modality",
            "type": "array",
            "description": "Optional tender modalities, for example Pregão, Dispensa or Concorrência. Leave empty for all.",
            "items": {
              "type": "string",
              "enum": [
                "pregao_eletronico",
                "pregao_presencial",
                "concorrencia_eletronica",
                "concorrencia_presencial",
                "dispensa",
                "inexigibilidade",
                "credenciamento",
                "leilao_eletronico",
                "leilao_presencial",
                "concurso",
                "dialogo_competitivo",
                "manifestacao_interesse",
                "pre_qualificacao"
              ],
              "enumTitles": [
                "Pregão eletrônico",
                "Pregão presencial",
                "Concorrência eletrônica",
                "Concorrência presencial",
                "Dispensa",
                "Inexigibilidade",
                "Credenciamento",
                "Leilão eletrônico",
                "Leilão presencial",
                "Concurso",
                "Diálogo competitivo",
                "Manifestação de interesse",
                "Pré-qualificação"
              ]
            }
          },
          "spheres": {
            "title": "Government level",
            "type": "array",
            "description": "Optional government spheres, for example federal, state or municipal. Leave empty for all.",
            "items": {
              "type": "string",
              "enum": [
                "federal",
                "estadual",
                "municipal",
                "distrital"
              ],
              "enumTitles": [
                "Federal",
                "State (Estadual)",
                "Municipal",
                "Federal District (Distrital)"
              ]
            }
          },
          "powers": {
            "title": "Power",
            "type": "array",
            "description": "Optional government powers, for example executive or legislative. Leave empty for all.",
            "items": {
              "type": "string",
              "enum": [
                "executivo",
                "legislativo",
                "judiciario"
              ],
              "enumTitles": [
                "Executive",
                "Legislative",
                "Judiciary"
              ]
            }
          },
          "agency_cnpjs": {
            "title": "Agency CNPJs",
            "type": "array",
            "description": "Optional. Keep tenders from these buyers (órgão CNPJ, with or without punctuation).",
            "items": {
              "type": "string"
            }
          },
          "min_value_brl": {
            "title": "Min estimated value (BRL)",
            "minimum": 0,
            "type": "integer",
            "description": "Optional, e.g. 100000. Hides tenders without a public estimated value."
          },
          "max_value_brl": {
            "title": "Max estimated value (BRL)",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum estimated value in Brazilian reais, for example 1000000. Leave empty for no maximum."
          },
          "closing_within_days": {
            "title": "Proposals close within (days)",
            "minimum": 0,
            "type": "integer",
            "description": "Optional, e.g. 7. Only tenders whose proposal deadline is in the next N days."
          },
          "published_within_days": {
            "title": "Published within (days)",
            "minimum": 0,
            "type": "integer",
            "description": "Optional, e.g. 1 or 7. Only tenders published on PNCP in the last N days."
          },
          "only_price_registration": {
            "title": "Only price registration (SRP / ata)",
            "type": "boolean",
            "description": "If true, keep only Sistema de Registro de Preços tenders.",
            "default": false
          },
          "match_mode": {
            "title": "Keyword match",
            "enum": [
              "phrase",
              "all_words",
              "any_word"
            ],
            "type": "string",
            "description": "phrase = the exact words together (default, e.g. \"material hospitalar\"). all_words = all words anywhere in the object. any_word = the site's broad search.",
            "default": "phrase"
          },
          "strict_object_match": {
            "title": "Keyword must be in the object",
            "type": "boolean",
            "description": "On (default): keep only tenders whose object or extra info has the keyword (exact phrase in phrase mode). PNCP also finds words inside item lists and attached files, which brings loosely related tenders. Turn this off for a wide search that also keeps those matches.",
            "default": true
          },
          "exclude_words": {
            "title": "Exclude words",
            "type": "array",
            "description": "Optional. Skip tenders whose object has any of these words, e.g. locação, manutenção.",
            "items": {
              "type": "string"
            }
          },
          "fetch_items": {
            "title": "Get items (itens)",
            "type": "boolean",
            "description": "Adds every item with description, quantity, unit, estimated unit and total value. One extra request per tender.",
            "default": false
          },
          "fetch_documents": {
            "title": "Get documents (edital files)",
            "type": "boolean",
            "description": "Adds links to the edital, termo de referência and other files. One extra request per tender.",
            "default": false
          },
          "monitor_mode": {
            "title": "Monitor mode (only new tenders)",
            "type": "boolean",
            "description": "Remembers tenders between runs and saves only tenders that are new since the last run. Schedule it daily for tender alerts.",
            "default": false
          },
          "monitor_key": {
            "title": "Monitor name",
            "type": "string",
            "description": "Name for this monitor, e.g. software-sp. Use a different name for each search you monitor."
          },
          "monitor_stop_after_known_pages": {
            "title": "Stop after N pages with no new tenders",
            "minimum": 0,
            "type": "integer",
            "description": "Monitor only. Results are newest first, so after this many pages (100 tenders each) with no new tenders the search stops. 0 = always read the whole search.",
            "default": 2
          },
          "max_concurrency": {
            "title": "Parallel requests (items/documents)",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "How many tenders to enrich at the same time (1-8).",
            "default": 3
          },
          "request_delay_ms": {
            "title": "Delay between requests (ms)",
            "minimum": 150,
            "maximum": 10000,
            "type": "integer",
            "description": "Pause between requests, in milliseconds, for example 500. Use this to be polite to the site.",
            "default": 300
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Not needed today. If PNCP blocks the run, the Actor moves by itself to Apify datacenter proxy and then to residential proxy in Brazil.",
            "default": {
              "useApifyProxy": 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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}