跳到正文
DEV Community· Norbert Sobala·· 35 分鐘前AI 評分48

如何用 Python 監察波蘭公共招標(BZP)並查看中標者

How to monitor Polish public tenders (BZP) and see who won with Python

AI 導讀

這份教學示範如何用 Python 配合 Apify 的 Poland Public Tenders Scraper,透過 UZP API 按 CPV 代碼等條件監察波蘭公共招標,並從中標公告 PDF 擷取合約價格。

正文

Polish public procurement is a big, open data source that most sales teams outside Poland never touch. Every tender below the EU thresholds goes into the Biuletyn Zamówień Publicznych (BZP), run by the Public Procurement Office (UZP) on the eZamówienia platform. The search interface works fine for a person checking one category once a week. It gets painful when you want a daily feed for a few CPV codes, or when you want to know who won and at what price.

This tutorial uses the Poland Public Tenders Scraper on Apify. It reads the official UZP API, filters by CPV code, keyword, region and buyer, and for award notices it opens the full notice PDF to pull out the winning contract price.

I ran it on Monday 23 November 2026 for CPV 72000000 (IT services) with a 7-day window. All numbers below come from that run.

Dataset preview of IT tenders from the BZP run

What the run returned

30 records in total:

  • 17 new contract notices (open tenders)
  • 12 award notices (11 "contract signed", 1 "contract signed, partially")
  • 1 cancellation

Buyers came from all over the country. Śląskie had 6 records, Mazowieckie and Dolnośląskie 4 each, Świętokrzyskie 3. The buyers were what you would expect for IT services: hospitals, universities, municipal water companies, fire service units and city halls. Kraków city hall was looking for a DLP system. A Wrocław IT service centre wanted SAP support and development.

For the 9 awards where the scraper fetched a contract price, the values ranged from 159,900 PLN to 1,097,900 PLN net, with a median of 568,014 PLN. Together that is about 4.65 million PLN of signed IT work in one week, from the subset that got enriched.

Deadlines were short. All 17 open tenders had between 3 and 8 days left to submit an offer. If you check BZP by hand once a week, you will miss some of them.

Price still dominates evaluation. 12 notices had parsed criteria: 7 used price at 60% (the rest split between things like repair time and response time), and 5 used price as the only criterion at 100%.

Fields you get

One notice is one record. The most useful fields:

Field What it contains
eventType new, changed, awarded or cancelled
noticeNumber, bzpNumber Official BZP identifiers
publicationDate When the notice was published (UTC)
orderObject Subject of the contract, in Polish
cpvCodes, cpvNames CPV codes with Polish names
organizationName, organizationCity, organizationProvinceName The contracting authority
organizationNip, organizationRegon Tax ID and statistical ID of the buyer
submittingOffersDate, daysToDeadline Offer deadline and days left
procedureResultLabel Outcome for award notices
contractors Winners with city, IDs and contractPrice
contractValueNet, contractValueDisplay Winning contract value
evaluationCriteria Criteria with weights, from the PDF
estimatedValueNet, estimatedValueAvailable Estimated value, when the buyer published it
documentsAvailable in-notice, on-platform-only or none
sourceUrl, pdfUrl Links to the notice on eZamówienia

Two things to know before you build on this. First, estimatedValueAvailable was true for only 1 of the 30 records, because all of them were below EU thresholds and those notices rarely publish an estimate. The award price is the number you can rely on. Second, tender documents (SWZ and attachments) live on the eZamówienia platform, so 17 records said on-platform-only and 13 said none. Use sourceUrl to get them.

Option 1: no code

  1. Open the actor page and click Try for free.
  2. In CPV codes, enter the categories you sell into. Matching is hierarchical, so 72000000 also catches 72200000, 72222300 and the rest of the IT tree. Other common roots: 48000000 (software), 45000000 (construction), 33000000 (medical), 79000000 (business and legal services).
  3. Optionally add keywords. They match the title by default, ignoring case and Polish diacritics, so bezpieczenstwo finds "Bezpieczeństwo".
  4. Optionally filter by voivodeships (names like Mazowieckie or codes like PL14) and by contracting authority (part of a name, a 10-digit NIP or a REGON).
  5. Pick notice types. The default is new tenders plus awards. You can add plans, concessions, competitions and corrections.
  6. Set mode. For a first look use "all matching". For a scheduled monitor keep the default "new or changed only".
  7. Click Start and export the dataset as CSV, Excel or JSON.

The input form labels are in Polish, but each field has a description, and the JSON tab accepts the English keys shown below.

Input form of the Poland Public Tenders Scraper

Input options that matter

  • dateLookbackDays: publication window, 1 to 30 days. Default 7.
  • mode: new_only remembers what it already returned under a stateKey and only sends new or changed notices next time. all returns everything in the window.
  • stateKey: the memory slot for new_only. If you change filters, use a new key. Otherwise the actor skips anything older than your last run and you can get 0 results.
  • enrichWithDetails: downloads the notice PDF for criteria, conditions and estimated value. On by default.
  • enrichAwardsWithPrice: pulls the winning price for awards. On by default.
  • enrichMaxPerRun: cost cap on PDF downloads per run, default 50. I set it to 20, which is why only 9 of the 12 awards got a price. Newest notices go first.
  • matchInFullText: also search keywords in the full notice text instead of the title only. Costs extra per notice.
  • minAwardPriceNet / maxAwardPriceNet: filter awards by contract value in PLN.

Option 2: Python with apify-client and pandas

Install the two libraries:

pip install apify-client pandas

This is the same input I used, plus a few lines to split open tenders from awards:

from apify_client import ApifyClient
import pandas as pd

client = ApifyClient("YOUR_APIFY_TOKEN")

run_input = {
    "cpvCodes": ["72000000"],
    "noticeTypes": ["contract", "award"],
    "mode": "all",
    "dateLookbackDays": 7,
    "stateKey": "it-tenders-test",
    "enrichWithDetails": True,
    "enrichAwardsWithPrice": True,
    "enrichMaxPerRun": 20,
}

run = client.actor("liveclaude/bzp-monitor-pl").call(run_input=run_input)
items = list(client.dataset(run["defaultDatasetId"]).iterate_items())
df = pd.DataFrame(items)

print(df["eventType"].value_counts())

# Open tenders, closest deadline first
open_tenders = (
    df[df["eventType"] == "new"]
    [["daysToDeadline", "organizationName", "organizationProvinceName",
      "orderObject", "sourceUrl"]]
    .sort_values("daysToDeadline")
)
print(open_tenders.head(10).to_string(index=False))

# Awards with a known contract value
awards = df[(df["eventType"] == "awarded") & df["contractValueNet"].notna()]
print(awards["contractValueNet"].describe())

# Which buyers spend the most
by_buyer = (
    awards.groupby("organizationName")["contractValueNet"]
    .sum()
    .sort_values(ascending=False)
)
print(by_buyer.head(10))

open_tenders.to_csv("open_it_tenders.csv", index=False)

The contractors column is a list of dicts. If you want one row per winner, use pd.json_normalize(items, record_path="contractors", meta=["bzpNumber", "organizationName"]). Keep in mind the note on personal data further down before you store or share that table.

Scheduling and integrations

For a monitor, switch mode to new_only, give the search a fixed stateKey, and add a schedule in Apify (Schedules tab). Daily at 7:00 works for most teams. With a 3 to 8 day window to respond, I would not go less often than daily.

Then route the output somewhere people already look:

  • A webhook to Slack or Teams when a run finishes with new items
  • Make or Zapier to create a CRM deal per new tender
  • A Google Sheets export for a shared tender list
  • The Apify API from your own backend, as in the Python example

Pricing

The actor uses pay-per-event pricing, so you pay for notices found and PDFs parsed, not for scanning. Current prices on the Free plan, per 1,000 events:

Event Free plan Gold plan
New matching notice $10 $5
Changed notice $10 $5
Award notice $12 $7
Details from PDF $4 $2
Contract price from award $8 $4
Full-text search $3 $1

There is also a $0.05 charge per actor start. Bronze and Silver plans sit between the two columns. The README also lists a free starter allowance of 20 new notices, 10 detail downloads and 5 contract prices.

My run produced 17 new notices, 1 change, 12 awards, 20 PDF detail downloads and 9 contract prices. At Free plan prices that comes to roughly $0.53 for the whole week of IT tenders.

Responsible use

Public procurement data is public by law, and this actor reads the official UZP API rather than scraping HTML. That covers the tenders and the buying institutions.

Winners are a different matter. In Poland many small suppliers are sole traders, and their business name is often the owner's full name. In my run one of the winners was exactly that. Treat contractor names as personal data under GDPR: use them for the purpose you have a basis for (for example, competitive analysis inside your company), do not publish them in bulk, and do not build contact lists of individuals from them. The screenshot in this post masks the contractor name column for that reason.

This tutorial was written with AI assistance and checked by the author. All numbers come from a real run of the scraper.

來源:DEV Community · dev.to