{
  "openapi": "3.0.1",
  "info": {
    "title": "Poland Public Tenders Scraper",
    "description": "Extract and normalize Polish public procurement notices from BZP and TED into one structured dataset. Filter by source, date, keywords, CPV codes, and supported fields, then export to JSON or CSV or use through the Apify API.",
    "version": "1.0",
    "x-build-id": "QwjlT1ARLeCGjSRwF"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/toughtcrime~poland-public-tenders-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-toughtcrime-poland-public-tenders-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/toughtcrime~poland-public-tenders-scraper/runs": {
      "post": {
        "operationId": "runs-sync-toughtcrime-poland-public-tenders-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/toughtcrime~poland-public-tenders-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-toughtcrime-poland-public-tenders-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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Run mode",
            "enum": [
              "snapshot",
              "incremental"
            ],
            "type": "string",
            "description": "Snapshot reads a bounded YYYY-MM-DD publication range without a durable cursor. Incremental delivers new and changed procedures using persistent state."
          },
          "sources": {
            "title": "Official sources",
            "type": "array",
            "description": "Choose BZP, TED, or both official sources. BZP alone preserves Tender Schema v1; selecting TED enables the unified pl-procurement-v1 JSON contract.",
            "items": {
              "type": "string",
              "enum": [
                "BZP",
                "TED"
              ]
            },
            "default": [
              "BZP"
            ]
          },
          "sourceFailureMode": {
            "title": "Multiple-source failure behavior",
            "enum": [
              "fail_fast",
              "allow_partial_sources"
            ],
            "type": "string",
            "description": "Fail fast by default, or explicitly allow successful sources to be delivered with a partial failed summary.",
            "default": "fail_fast"
          },
          "ted": {
            "title": "TED settings",
            "type": "object",
            "description": "Anonymous official TED Search API v3 settings. The default either scope includes Polish buyers and Polish places of performance.",
            "properties": {
              "polandScope": {
                "title": "Poland scope",
                "description": "Match Polish buyers, Polish places of performance, or either condition.",
                "type": "string",
                "enum": [
                  "buyer_country",
                  "place_of_performance",
                  "either"
                ]
              },
              "languages": {
                "title": "Preferred TED languages",
                "description": "Three-letter TED language codes in preferred output order.",
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^[A-Za-z]{3}$"
                },
                "minItems": 1
              },
              "pageSize": {
                "title": "TED page size",
                "description": "Number of notices requested per official TED iteration page.",
                "type": "integer",
                "minimum": 1,
                "maximum": 180
              },
              "validateQuery": {
                "title": "Validate TED query",
                "description": "Ask TED to validate the generated expert query before acquisition.",
                "type": "boolean"
              }
            },
            "default": {
              "polandScope": "either",
              "languages": [
                "POL",
                "ENG"
              ],
              "pageSize": 100,
              "validateQuery": true
            },
            "additionalProperties": false
          },
          "publishedFrom": {
            "title": "Published from",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Required in snapshot mode. Format: YYYY-MM-DD.",
            "default": null
          },
          "publishedTo": {
            "title": "Published to",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Required in snapshot mode and includes the full selected day. Format: YYYY-MM-DD.",
            "default": null
          },
          "incrementalFrom": {
            "title": "Bounded incremental source instant from",
            "type": "string",
            "description": "Optional inclusive acquisition instant for a controlled incremental replay. Must be paired with incrementalTo and include a timezone.",
            "default": null
          },
          "incrementalTo": {
            "title": "Bounded incremental source instant to",
            "type": "string",
            "description": "Optional exclusive acquisition instant for a controlled incremental replay. Must be paired with incrementalFrom and include a timezone.",
            "default": null
          },
          "updatedFrom": {
            "title": "Updated from",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Keep procedures updated on or after this date. Format: YYYY-MM-DD.",
            "default": null
          },
          "updatedTo": {
            "title": "Updated to",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Keep procedures updated on or before this inclusive date. Format: YYYY-MM-DD.",
            "default": null
          },
          "deadlineFrom": {
            "title": "Deadline from",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Keep procedures whose current deadline is on or after this date. Format: YYYY-MM-DD.",
            "default": null
          },
          "deadlineTo": {
            "title": "Deadline to",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Keep procedures whose current deadline is on or before this inclusive date. Format: YYYY-MM-DD.",
            "default": null
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Phrases searched in the title and description.",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "default": []
          },
          "keywordMatch": {
            "title": "Keyword matching",
            "enum": [
              "any",
              "all"
            ],
            "type": "string",
            "description": "Choose whether any phrase or every phrase must match.",
            "default": "any"
          },
          "cpvCodes": {
            "title": "CPV codes",
            "type": "array",
            "description": "Match primary and additional normalized CPV codes.",
            "items": {
              "type": "string",
              "pattern": "^\\d{8}(-\\d)?$"
            },
            "default": []
          },
          "cpvMatch": {
            "title": "CPV matching",
            "enum": [
              "exact",
              "prefix"
            ],
            "type": "string",
            "description": "Match an exact normalized CPV code or a CPV hierarchy prefix.",
            "default": "prefix"
          },
          "buyerNames": {
            "title": "Buyer names",
            "type": "array",
            "description": "Match official buyer names.",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "default": []
          },
          "buyerNameMatch": {
            "title": "Buyer name matching",
            "enum": [
              "contains",
              "exact"
            ],
            "type": "string",
            "description": "Choose substring or exact matching for buyer names.",
            "default": "contains"
          },
          "buyerNationalIds": {
            "title": "Buyer national IDs",
            "type": "array",
            "description": "Exact official identifiers such as NIP or REGON when published.",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "default": []
          },
          "regions": {
            "title": "Buyer regions",
            "type": "array",
            "description": "BZP-only buyer-address filter. It is rejected when TED is selected because the verified TED mapping does not expose an equivalent field.",
            "items": {
              "type": "string",
              "enum": [
                "dolnośląskie",
                "kujawsko-pomorskie",
                "lubelskie",
                "lubuskie",
                "łódzkie",
                "małopolskie",
                "mazowieckie",
                "opolskie",
                "podkarpackie",
                "podlaskie",
                "pomorskie",
                "śląskie",
                "świętokrzyskie",
                "warmińsko-mazurskie",
                "wielkopolskie",
                "zachodniopomorskie"
              ]
            },
            "default": []
          },
          "cities": {
            "title": "Buyer cities",
            "type": "array",
            "description": "BZP-only buyer-address filter. It is rejected when TED is selected because the verified TED mapping does not expose an equivalent field.",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "default": []
          },
          "statuses": {
            "title": "Tender statuses",
            "type": "array",
            "description": "Keep procedures with any selected stable status.",
            "items": {
              "type": "string",
              "enum": [
                "open",
                "closed",
                "awarded",
                "cancelled",
                "unknown"
              ]
            },
            "default": []
          },
          "procurementTypes": {
            "title": "Procurement types",
            "type": "array",
            "description": "Keep procedures with any selected stable procurement type.",
            "items": {
              "type": "string",
              "enum": [
                "services",
                "supplies",
                "works",
                "mixed",
                "unknown"
              ]
            },
            "default": []
          },
          "procedureTypes": {
            "title": "Procedure types",
            "type": "array",
            "description": "Stable normalized procedure codes implemented by the Actor.",
            "items": {
              "type": "string",
              "enum": [
                "basic_no_negotiation",
                "basic_optional_negotiation",
                "basic_mandatory_negotiation",
                "innovation_partnership",
                "negotiated_without_publication",
                "single_source",
                "open_procedure",
                "restricted_procedure",
                "negotiated_with_publication",
                "competitive_dialogue",
                "competition_open",
                "competition_restricted",
                "unknown"
              ]
            },
            "default": []
          },
          "minValue": {
            "title": "Minimum value (PLN)",
            "minimum": 0,
            "type": "number",
            "description": "Minimum requested value. The documented interval-overlap rule is applied.",
            "default": null
          },
          "maxValue": {
            "title": "Maximum value (PLN)",
            "minimum": 0,
            "type": "number",
            "description": "Maximum requested value. Must not be lower than the minimum value.",
            "default": null
          },
          "maxItems": {
            "title": "Maximum delivered procedures",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Counts unique procedures delivered to the default Dataset. The safe default is 100; values above 1000 can materially increase run time and cost.",
            "default": 100
          },
          "includeUpdates": {
            "title": "Include updates",
            "type": "boolean",
            "description": "In incremental mode, also deliver previously seen procedures whose business content changed.",
            "default": true
          },
          "includeRawData": {
            "title": "Include raw source data",
            "type": "boolean",
            "description": "Adds the unstable rawData field to JSON records. CSV always excludes it.",
            "default": false
          },
          "initialLookbackDays": {
            "title": "Initial lookback days",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Used only for a new incremental state partition.",
            "default": 7
          },
          "overlapHours": {
            "title": "Incremental overlap hours",
            "minimum": 1,
            "maximum": 168,
            "type": "integer",
            "description": "Re-read this many hours before the saved cursor to catch late source changes.",
            "default": 24
          },
          "stateKey": {
            "title": "State partition key",
            "pattern": "^[A-Za-z0-9_-]{1,64}$",
            "type": "string",
            "description": "Separates independent incremental cursors and fingerprints.",
            "default": "default"
          },
          "resetState": {
            "title": "Reset incremental state",
            "type": "boolean",
            "description": "Allowed only in incremental mode.",
            "default": false
          },
          "advanceBoundedTedState": {
            "title": "Advance TED state after bounded replay",
            "type": "boolean",
            "description": "DANGER: enabling this lets a bounded TED replay advance durable incremental state. Leave it off for tests and historical samples; use only with an intentional stateKey and verified bounds.",
            "default": 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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}