{
  "openapi": "3.0.1",
  "info": {
    "title": "Brazil Public Tenders Radar (PNCP)",
    "description": "Search and monitor Brazilian public tenders (licitações) from the official PNCP API: keyword search without accents, state/city/modality/value filters, open-for-proposals only, and a monitor mode that returns only new tenders since the last run.",
    "version": "0.1",
    "x-build-id": "LtoV3dkZxFwdTqvMD"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/brasil-data~brazil-public-tenders-radar/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-brasil-data-brazil-public-tenders-radar",
        "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/brasil-data~brazil-public-tenders-radar/runs": {
      "post": {
        "operationId": "runs-sync-brasil-data-brazil-public-tenders-radar",
        "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/brasil-data~brazil-public-tenders-radar/run-sync": {
      "post": {
        "operationId": "run-sync-brasil-data-brazil-public-tenders-radar",
        "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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "monitor"
            ],
            "type": "string",
            "description": "'search' returns every matching tender. 'monitor' remembers the tenders already delivered (per monitor_id) and returns ONLY new ones since the previous run - schedule it daily for alerts.",
            "default": "search"
          },
          "monitor_id": {
            "title": "Monitor ID",
            "pattern": "^[A-Za-z0-9_-]{1,64}$",
            "type": "string",
            "description": "Required in monitor mode. A name you choose for this alert (letters, digits, '-' and '_'), e.g. 'software-sp'. Each ID keeps its own memory of delivered tenders."
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Words searched in the tender object (objeto da compra). Case- and accent-insensitive ('manutencao' finds 'MANUTENÇÃO'), whole words, singular/plural accepted. End a word with * for prefix search (e.g. 'constru*'). A tender matches if ANY keyword matches. Leave empty to list all tenders for the other filters.",
            "items": {
              "type": "string"
            }
          },
          "only_open_for_proposals": {
            "title": "Only tenders open for proposals",
            "type": "boolean",
            "description": "Keep only tenders whose proposal deadline is still in the future (uses the PNCP 'open for proposals' endpoint, the fastest way to scan all modalities). Turn off to search the publication history (slower: the PNCP API requires one query per modality).",
            "default": true
          },
          "states": {
            "title": "States (UF)",
            "type": "array",
            "description": "Limit to these Brazilian states. Empty = whole country. Ignored when municipality codes are given.",
            "items": {
              "type": "string",
              "enum": [
                "AC",
                "AL",
                "AP",
                "AM",
                "BA",
                "CE",
                "DF",
                "ES",
                "GO",
                "MA",
                "MT",
                "MS",
                "MG",
                "PA",
                "PB",
                "PR",
                "PE",
                "PI",
                "RJ",
                "RN",
                "RS",
                "RO",
                "RR",
                "SC",
                "SP",
                "SE",
                "TO"
              ],
              "enumTitles": [
                "AC - Acre",
                "AL - Alagoas",
                "AP - Amapá",
                "AM - Amazonas",
                "BA - Bahia",
                "CE - Ceará",
                "DF - Distrito Federal",
                "ES - Espírito Santo",
                "GO - Goiás",
                "MA - Maranhão",
                "MT - Mato Grosso",
                "MS - Mato Grosso do Sul",
                "MG - Minas Gerais",
                "PA - Pará",
                "PB - Paraíba",
                "PR - Paraná",
                "PE - Pernambuco",
                "PI - Piauí",
                "RJ - Rio de Janeiro",
                "RN - Rio Grande do Norte",
                "RS - Rio Grande do Sul",
                "RO - Rondônia",
                "RR - Roraima",
                "SC - Santa Catarina",
                "SP - São Paulo",
                "SE - Sergipe",
                "TO - Tocantins"
              ]
            }
          },
          "municipality_ibge_codes": {
            "title": "Municipality IBGE codes (optional)",
            "type": "array",
            "description": "7-digit IBGE codes of the cities where the buying unit is located, e.g. 3550308 (São Paulo), 3304557 (Rio de Janeiro). When set, 'States' is ignored.",
            "items": {
              "type": "string"
            }
          },
          "modalities": {
            "title": "Modalities",
            "type": "array",
            "description": "Official PNCP procurement modality codes (Lei 14.133/2021). Empty = all modalities.",
            "items": {
              "type": "string",
              "enum": [
                "1",
                "2",
                "3",
                "4",
                "5",
                "6",
                "7",
                "8",
                "9",
                "10",
                "11",
                "12",
                "13",
                "14",
                "15",
                "16",
                "17",
                "18",
                "19"
              ],
              "enumTitles": [
                "1 - Leilão Eletrônico (electronic auction)",
                "2 - Diálogo Competitivo (competitive dialogue)",
                "3 - Concurso (contest)",
                "4 - Concorrência Eletrônica (electronic open tender)",
                "5 - Concorrência Presencial (in-person open tender)",
                "6 - Pregão Eletrônico (electronic reverse auction)",
                "7 - Pregão Presencial (in-person reverse auction)",
                "8 - Dispensa (direct purchase, tender waived)",
                "9 - Inexigibilidade (direct purchase, tender not required)",
                "10 - Manifestação de Interesse (expression of interest)",
                "11 - Pré-qualificação (pre-qualification)",
                "12 - Credenciamento (accreditation)",
                "13 - Leilão Presencial (in-person auction)",
                "14 - Inaplicabilidade da Licitação (tender not applicable)",
                "15 - Chamada Pública (public call)",
                "16 - Concorrência Eletrônica Internacional",
                "17 - Concorrência Presencial Internacional",
                "18 - Pregão Eletrônico Internacional",
                "19 - Pregão Presencial Internacional"
              ]
            }
          },
          "last_n_days": {
            "title": "Published in the last N days",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Publication window when 'Published from' is empty: tenders published in the last N days (Brasília time).",
            "default": 3
          },
          "published_from": {
            "title": "Published from (YYYY-MM-DD)",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Start of the publication window (inclusive). Overrides 'last N days'."
          },
          "published_to": {
            "title": "Published to (YYYY-MM-DD)",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "End of the publication window (inclusive). Default: now."
          },
          "min_estimated_value_brl": {
            "title": "Minimum estimated value (BRL)",
            "minimum": 0,
            "type": "integer",
            "description": "Keep tenders whose total estimated value is at least this amount. Tenders without a public estimate (e.g. confidential budget) are excluded when a value filter is set."
          },
          "max_estimated_value_brl": {
            "title": "Maximum estimated value (BRL)",
            "minimum": 0,
            "type": "integer",
            "description": "Keep tenders whose total estimated value is at most this amount."
          },
          "max_results": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of tenders delivered (and charged) in this run.",
            "default": 100
          },
          "include_file_links": {
            "title": "Include document links",
            "type": "boolean",
            "description": "Also list the tender documents (edital, termo de referência...) with direct download URLs. Costs one extra API request per tender, so runs are slower.",
            "default": false
          },
          "max_pages": {
            "title": "Max API pages to scan",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Safety limit: maximum PNCP API pages (50 records each) read in this run. The PNCP API has no full-text search, so keyword filtering happens on this side; the official API allows ~1 request every 1.6-2 s.",
            "default": 300
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}