Checking Polish companies from code: VAT, KRS, REGON, EU VAT (REST + Python + MCP)
If you invoice or onboard Polish companies, sooner or later you have to check two dull things that turn out to matter a lot: is this company actually a registered VAT payer, and is the bank account they gave you the one that's on the government's official white list ("Biała Lista")? Both of those affect whether you can deduct the cost and reclaim VAT, so it's not really optional. The annoying…
Polish companies need to be checked for two important factors when invoicing or onboarding them: their VAT registration status and whether their provided bank account is on the government's official white list. These checks affect whether you can deduct costs and reclaim VAT. The Ministry of Finance, KRS court register, GUS statistics office, and EU's VIES service store this data separately, each with its own API and quirks.
To simplify this process, a service called skanfirmy.pl was created. It offers four REST endpoints for querying data: one for NIP (tax ID), one for multiple NIPs, one for REGON (GUS), and one to validate EU VAT numbers. The service returns JSON data, making it easy to integrate with various systems like cron jobs, AWS Lambda, or CI steps.
The status values from the Ministry of Finance are in Polish, so they must be compared against the raw values without translation to avoid breaking functionality when UI language changes. For larger lists, GET /nips/{list} or the /bulk page can return a CSV file. There's also an MCP server for agents to use the same NIP checks. To stay up-to-date on VAT status and white-list account changes, a monitoring endpoint can be used, which sends an HMAC-signed webhook when something changes. This allows for more frequent checks without constantly polling the registers.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.