{
  "openapi": "3.0.1",
  "info": {
    "title": "PNCP Brazil Public Tenders & Contracts (Licitações) API",
    "description": "Brazil's public tenders (licitações) and contracts from the official PNCP API: open tenders, new tenders and signed contracts with buyer, CNPJ, state, city, method, deadline, value in BRL and supplier companies. English labels. Unofficial; not affiliated with PNCP.",
    "version": "0.1",
    "x-build-id": "YNVu6UpPdH5EhycIv"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/jpopendata~brazil-pncp-tenders/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-jpopendata-brazil-pncp-tenders",
        "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/jpopendata~brazil-pncp-tenders/runs": {
      "post": {
        "operationId": "runs-sync-jpopendata-brazil-pncp-tenders",
        "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/jpopendata~brazil-pncp-tenders/run-sync": {
      "post": {
        "operationId": "run-sync-jpopendata-brazil-pncp-tenders",
        "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": "What to get",
            "enum": [
              "published",
              "open",
              "contracts"
            ],
            "type": "string",
            "description": "published = tenders published on PNCP in the date window (default); open = tenders whose proposal period is open now and closes by Days ahead / Date to (live opportunities; suspended, revoked and annulled ones are left out); contracts = contracts and contract-like commitments published in the date window, with the supplier when it is a company.",
            "default": "published"
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Optional. Words or phrases searched in the object (title), the buyer and its unit and the supplier name, any case, accents ignored, at the start of words: \"computador\" also finds \"computadores\". Titles are in Portuguese, e.g. \"medicamento\", \"merenda escolar\", \"obra\", \"software\", \"veículo\". A record matches if it contains ANY of them. Leave empty for all records.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "states": {
            "title": "States (UF)",
            "type": "array",
            "description": "Optional. States of the buying unit: 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 (full names such as \"Minas Gerais\" work too). Empty = all of Brazil.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "cities": {
            "title": "Cities",
            "type": "array",
            "description": "Optional. Municipalities of the buying unit as \"City - UF\" (\"Campinas - SP\"), the IBGE code (\"3509502\") or a name that is unique in Brazil. A record matches if it is in any listed state OR any listed city.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "buyerCnpjs": {
            "title": "Buyer CNPJs",
            "type": "array",
            "description": "Optional. CNPJ of the buying body (órgão / entidade), 14 characters, punctuation optional, e.g. \"63.025.530/0001-04\" (Universidade de São Paulo) or \"00394544000185\" (Ministério da Saúde).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "procurementMethods": {
            "title": "Procurement methods (modalidades)",
            "type": "array",
            "description": "Optional, tenders only. PNCP codes or names: 6 Pregão eletrônico, 8 Dispensa, 9 Inexigibilidade, 4 Concorrência eletrônica, 12 Credenciamento, 7 Pregão presencial, 1 Leilão eletrônico, 5 Concorrência presencial, 3 Concurso, 2 Diálogo competitivo, 10 Manifestação de interesse, 11 Pré-qualificação, 13 Leilão presencial. \"pregao\" means 6 and 7. Empty = all methods.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "daysBack": {
            "title": "Days back",
            "type": "integer",
            "description": "For published / contracts: search from N days ago up to today (1..366, Brasília calendar days). Ignored when Date from is set. PNCP receives thousands of tenders and contracts per working day; with Max rows the run stops early once it has enough.",
            "default": 3
          },
          "daysAhead": {
            "title": "Days ahead (open tenders)",
            "type": "integer",
            "description": "For open: tenders whose proposal period is open now and closes within the next N days (1..366). Ignored when Date to is set.",
            "default": 30
          },
          "dateFrom": {
            "title": "Date from",
            "type": "string",
            "description": "Optional (published / contracts). First publication day, YYYY-MM-DD, e.g. \"2026-09-01\". DD/MM/YYYY (day first), \"today\", \"yesterday\" and relative days such as \"-30d\" also work. The window can be at most 366 days.",
            "default": ""
          },
          "dateTo": {
            "title": "Date to",
            "type": "string",
            "description": "Optional. published / contracts: last publication day (empty = today). open: the last proposal-closing day to include, e.g. \"+15d\" or \"2026-11-30\" (empty = today + Days ahead).",
            "default": ""
          },
          "valueMin": {
            "title": "Minimum value (BRL)",
            "minimum": 0,
            "type": "integer",
            "description": "Optional. Minimum value in Brazilian reais: the estimated value for tenders, the global (else initial) value for contracts, e.g. 100000. Records without a value (including confidential budgets) are dropped when a value range is set."
          },
          "valueMax": {
            "title": "Maximum value (BRL)",
            "minimum": 0,
            "type": "integer",
            "description": "Optional. Maximum value in Brazilian reais, e.g. 5000000."
          },
          "maxItems": {
            "title": "Max rows",
            "type": "integer",
            "description": "Maximum rows (1..10000). Rows come newest first within each query (published / open: per procurement method). You are charged per row.",
            "default": 20
          },
          "maxApiRequests": {
            "title": "Max API requests",
            "type": "integer",
            "description": "Hard budget of requests to the PNCP API for the whole run (1..1000). Requests are sent one at a time at least 5 seconds apart; one request returns up to 50 tenders or 500 contracts. If the budget runs out the run still succeeds with what it found (complete=false in RUN_SUMMARY).",
            "default": 40
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional and normally not needed: the PNCP API answers Apify datacenter IPs. If set, one sticky session is used for the whole run (never rotation).",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}