{
  "openapi": "3.0.1",
  "info": {
    "title": "Monitor Przetargów Publicznych PL (BZP + eZamówienia)",
    "description": "🇵🇱 Monitor przetargów i zamówień publicznych z oficjalnego BZP. Nowe postępowania, rozstrzygnięcia, ceny umów, kryteria oceny. Filtry CPV, województwo, NIP. Pay-per-event od 12 zł/mc.",
    "version": "0.1",
    "x-build-id": "fpjlpXslSvWci0q3e"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/klevio~bzp-monitor-pl/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-klevio-bzp-monitor-pl",
        "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/klevio~bzp-monitor-pl/runs": {
      "post": {
        "operationId": "runs-sync-klevio-bzp-monitor-pl",
        "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/klevio~bzp-monitor-pl/run-sync": {
      "post": {
        "operationId": "run-sync-klevio-bzp-monitor-pl",
        "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": [
          "cpvCodes"
        ],
        "properties": {
          "cpvCodes": {
            "title": "Kody CPV (kategorie)",
            "type": "array",
            "description": "Kody CPV do monitorowania. Dopasowanie hierarchiczne: „48000000\" łapie wszystkie podkategorie (48200000, 48222300, ...). Popularne: 72000000 (usługi IT), 48000000 (oprogramowanie), 45000000 (roboty budowlane), 33000000 (medyczne), 79000000 (usługi biznesowe/prawne). Pełna lista: https://kody.uzp.gov.pl",
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Słowa kluczowe",
            "type": "array",
            "description": "Słowa szukane w tytule postępowania. Ignoruje wielkość liter i polskie znaki (np. „bezpieczenstwo\" złapie „Bezpieczeństwo\"). Puste = bez filtra słów.",
            "items": {
              "type": "string"
            }
          },
          "voivodeships": {
            "title": "Województwa",
            "type": "array",
            "description": "Filtr województwa zamawiającego. Nazwy (Mazowieckie, Śląskie) lub kody (PL14, PL24). Puste = cała Polska.",
            "items": {
              "type": "string"
            }
          },
          "contractingAuthorities": {
            "title": "Zamawiający (nazwa, NIP lub REGON)",
            "type": "array",
            "description": "Filtruj konkretne urzędy lub instytucje. Fragment nazwy (np. „Ministerstwo Zdrowia\"), NIP (10 cyfr) albo REGON (9 lub 14 cyfr). Uwaga: mniejsze instytucje publiczne często mają tylko REGON.",
            "items": {
              "type": "string"
            }
          },
          "noticeTypes": {
            "title": "Typy ogłoszeń",
            "type": "array",
            "description": "Jakie ogłoszenia monitorować. Domyślnie: nowe postępowania oraz rozstrzygnięcia.",
            "items": {
              "type": "string",
              "enum": [
                "contract",
                "award",
                "plan",
                "concession",
                "competition",
                "update"
              ],
              "enumTitles": [
                "Ogłoszenia o zamówieniu (nowe postępowania)",
                "Ogłoszenia o wyniku (rozstrzygnięcia, kto wygrał)",
                "Plany postępowań",
                "Koncesje",
                "Konkursy",
                "Aktualizacje i sprostowania"
              ]
            }
          },
          "mode": {
            "title": "Tryb pracy",
            "enum": [
              "new_only",
              "all"
            ],
            "type": "string",
            "description": "„Tylko nowe/zmienione\" (domyślne): aktor pamięta, co już widział pod danym kluczem stanu, i przy kolejnych uruchomieniach zwraca wyłącznie nowe oraz zmienione ogłoszenia. Idealne do monitoringu z harmonogramem. „Wszystkie\": zwraca wszystkie pasujące ogłoszenia z okna dat przy każdym uruchomieniu.",
            "default": "new_only"
          },
          "dateLookbackDays": {
            "title": "Ile dni wstecz",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "Okno publikacji: ile dni wstecz przeszukać (od dziś).",
            "default": 7
          },
          "stateKey": {
            "title": "Klucz kontekstu (dla deduplikacji)",
            "type": "string",
            "description": "Unikalny identyfikator tego wyszukiwania. W trybie „Tylko nowe/zmienione” aktor pamięta pod tym kluczem, co już zwrócił. WAŻNE: jeśli zmienisz filtry (CPV, słowa, województwo), użyj NOWEGO klucza albo trybu „Wszystkie” — inaczej dostaniesz tylko ogłoszenia nowsze niż poprzedni run (często 0 wyników).",
            "default": "default"
          },
          "enrichWithDetails": {
            "title": "Pobierz szczegóły z ogłoszenia (PDF)",
            "type": "boolean",
            "description": "Pobiera pełne ogłoszenie i wyciąga kryteria oceny, warunki udziału, dokumenty oraz wartość szacunkową (gdy jest podana). Dodatkowo płatne za pobrane ogłoszenie.",
            "default": true
          },
          "enrichAwardsWithPrice": {
            "title": "Cena z rozstrzygnięć (kto wygrał i za ile)",
            "type": "boolean",
            "description": "Dla ogłoszeń o wyniku pobiera cenę zwycięskiej oferty i wartość umowy z PDF. To główny wyróżnik: konkurencyjne narzędzia tego nie zwracają.",
            "default": true
          },
          "matchInFullText": {
            "title": "Szukaj słów kluczowych w całej treści (nie tylko w tytule)",
            "type": "boolean",
            "description": "Domyślnie słowa kluczowe są sprawdzane tylko w tytule. Włącz, aby przeszukać pełną treść ogłoszenia (wymaga pobrania PDF, dodatkowo płatne).",
            "default": false
          },
          "fullTextIncludeFull": {
            "title": "Dołącz pełny tekst ogłoszenia do wyniku",
            "type": "boolean",
            "description": "Domyślnie zwracamy tylko fragment wokół dopasowania. Włącz, aby dołączyć pełny tekst PDF (pole fullText). Uwaga: znacznie większy payload.",
            "default": false
          },
          "enrichMaxPerRun": {
            "title": "Maks. ogłoszeń do pobrania szczegółów na uruchomienie",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Bezpiecznik kosztów: ile ogłoszeń pobrać w całości (PDF) na jedno uruchomienie. Najświeższe mają priorytet. Ogłoszenia ponad ten limit nie dostają ceny umowy ani szczegółów (pole enrichedAt = null) — zwiększ limit, aby pobrać więcej. Przy monitoringu z harmonogramem domyślne 50 zwykle pokrywa wszystkie nowe ogłoszenia. 0 = bez wzbogacania.",
            "default": 50
          },
          "minAwardPriceNet": {
            "title": "Min. wartość umowy (rozstrzygnięcia, PLN)",
            "type": "integer",
            "description": "Filtr dla ogłoszeń o wyniku po wartości umowy z PDF. 0 = bez dolnego progu.",
            "default": 0
          },
          "maxAwardPriceNet": {
            "title": "Maks. wartość umowy (rozstrzygnięcia, PLN)",
            "type": "integer",
            "description": "Filtr dla ogłoszeń o wyniku po wartości umowy z PDF. 0 = bez górnego progu.",
            "default": 0
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}