{
  "openapi": "3.0.1",
  "info": {
    "title": "Brazil Government Tenders Search (PNCP)",
    "description": "Search Brazil's official public-procurement platform (PNCP) for open tenders and published contracting notices: filter by date, UF/municipality, modality, contracting body, keyword, and minimum value. Pay only for matched records.",
    "version": "0.1",
    "x-build-id": "eEUXejfaT04CdRV9z"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/jgoia~pncp-lookup/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-jgoia-pncp-lookup",
        "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/jgoia~pncp-lookup/runs": {
      "post": {
        "operationId": "runs-sync-jgoia-pncp-lookup",
        "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/jgoia~pncp-lookup/run-sync": {
      "post": {
        "operationId": "run-sync-jgoia-pncp-lookup",
        "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": "Search mode",
            "enum": [
              "open_for_proposals",
              "published"
            ],
            "type": "string",
            "description": "\"open_for_proposals\": tenders currently accepting proposals, closing on or before \"closingBefore\" (best for \"what can I bid on right now\"). \"published\": tenders published within a date range regardless of current status (best for market research / tracking all activity). PNCP's API requires a different endpoint - and different required fields - for each mode.",
            "default": "open_for_proposals"
          },
          "closingBefore": {
            "title": "Proposals closing on or before (used when mode = open_for_proposals)",
            "type": "string",
            "description": "Date in YYYY-MM-DD format. Required when \"mode\" is \"open_for_proposals\". Returns tenders currently open for proposals whose submission deadline is on or before this date."
          },
          "publishedFrom": {
            "title": "Published from (used when mode = published)",
            "type": "string",
            "description": "Date in YYYY-MM-DD format. Required when \"mode\" is \"published\". Limited to a 31-day window per run (see README)."
          },
          "publishedTo": {
            "title": "Published to (used when mode = published)",
            "type": "string",
            "description": "Date in YYYY-MM-DD format. Required when \"mode\" is \"published\"."
          },
          "modalities": {
            "title": "Bidding modality/modalities",
            "type": "array",
            "description": "Optional filter on contracting modality. In \"open_for_proposals\" mode, leave empty for all modalities (one API call). In \"published\" mode, leaving this empty means this Actor queries all 13 modalities in turn (PNCP's API requires a modality per call for that endpoint) - real extra time/cost, see README.",
            "items": {
              "type": "string",
              "enum": [
                "Leilão - Eletrônico",
                "Diálogo Competitivo",
                "Concurso",
                "Concorrência - Eletrônica",
                "Concorrência - Presencial",
                "Pregão - Eletrônico",
                "Pregão - Presencial",
                "Dispensa",
                "Inexigibilidade",
                "Manifestação de Interesse",
                "Pré-qualificação",
                "Credenciamento",
                "Leilão - Presencial"
              ]
            },
            "default": []
          },
          "uf": {
            "title": "State (UF)",
            "type": "string",
            "description": "Optional. Two-letter Brazilian state code (e.g. \"SP\", \"RJ\", \"DF\") to restrict results to a single state."
          },
          "municipalityIbgeCode": {
            "title": "Municipality (IBGE code)",
            "type": "string",
            "description": "Optional. IBGE municipality code (e.g. \"3550308\" for Sao Paulo city) to restrict results to a single municipality."
          },
          "contractingBodyCnpj": {
            "title": "Contracting body CNPJ",
            "type": "string",
            "description": "Optional. Restrict results to tenders from a specific contracting body's CNPJ (punctuation optional)."
          },
          "keyword": {
            "title": "Keyword (matched against the tender's object/description)",
            "type": "string",
            "description": "Optional. Every space-separated word must appear (case-insensitive) in the tender's \"objeto\" (object/description) text. Applied by this Actor after fetching results - PNCP's own API has no full-text-search parameter (see README \"Search semantics\")."
          },
          "minEstimatedValueBrl": {
            "title": "Minimum estimated value (BRL)",
            "type": "integer",
            "description": "Optional. Only include tenders with an estimated value (valorTotalEstimado) at or above this amount. Applied by this Actor after fetching results - PNCP's API has no min-value parameter. Tenders with no published estimated value are excluded when this filter is set."
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum number of matched tenders to return (and be charged for) in this run. Kept modest by default to keep run time and cost predictable given PNCP's own slow response times (commonly 12-20 seconds per page, out of this Actor's control). Max 500.",
            "default": 100
          },
          "maxConcurrency": {
            "title": "Max concurrent sub-queries",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "How many modality sub-queries to run concurrently (relevant mainly in \"published\" mode with multiple modalities). All requests still share one conservative rate limiter underneath, so this mostly affects pipelining, not raw request rate. Max 5.",
            "default": 3
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}