More

Book a free call
Fixed price in writing before we start

NIP, VAT white list and KRS in one row: enriching Polish company data in n8n

Your sheet holds nothing but Polish tax numbers, and you need the name, REGON, legal form, board members, PKD code and bank accounts. This n8n workflow queries two public registers, the VAT white list and the KRS court register, and writes the result back into the same row.

Author

Published:
Last verified:
n8n version:
2.8.4

In short

What it does

  • Reads NIPs from Google Sheets and validates their checksum
  • Fetches VAT status, REGON, address and bank accounts from the white list
  • Takes the KRS number from the white list response and fetches the KRS extract
  • Extracts legal form, board members, main PKD code and registered address
  • Writes everything back into the same sheet row

What it does not do

  • Covers sole traders only with white list data (CEIDG needs an API key)
  • Does not query the register of associations and foundations
  • Does not score the company, it only collects data
  • Cannot get around the Ministry API limit of 100 requests a day

What it needs

  • n8n (tested on 2.8.4)
  • A Google account with access to the sheet
  • A NIP column in the sheet

NIP, VAT white list and KRS in one row: enriching Polish company data in n8n

A list of leads, suppliers or contractors in Poland often starts with nothing but a NIP, the Polish tax number. The rest, meaning the name, REGON, legal form, board members, line of business and the accounts the company accepts payments on, sits in two public registers. Both have free APIs.

This n8n workflow combines them into one sheet row. Neither register needs an API key.

Workflow canvas for enriching companies from a NIP: reading the sheet, NIP validation, calls to the VAT white list and KRS, merging the responses and writing back to the sheet
Two public registers, one row per company. The KRS number for the second call comes from the white list response.

The KRS number comes from the white list

The KRS API takes a KRS number, not a NIP. Instead of asking the user for a second identifier, the workflow first queries the VAT white list, which returns a krs field, and only then fetches the current extract from KRS:

request order
wl-api.mf.gov.pl/api/search/nip/{NIP}?date={today}
api-krs.ms.gov.pl/api/krs/OdpisAktualny/{KRS from the response}?rejestr=P&format=json

A company without a KRS entry (a sole trader, for example) gets the white list data, and the KRS fields stay empty.

A KRS extract has no single shape

The extract's structure depends on the legal form. The board of a limited company and the partners of a general partnership sit under different keys, and first names come either as an array of objects or as plain text. Rather than map every path, the code searches the tree for keys:

merge-api-responses.js
const dane   = odpis ? findDeep(odpis, 'danePodmiotu') : null;
const header = odpis ? findDeep(odpis, 'naglowekA') : null;
const pkd    = odpis ? findDeep(odpis, 'przedmiotDzialalnosci') : null;

People are collected from section 2 of the extract as "name surname (role)", de-duplicated, up to 12.

Two details that make Google Sheets reject the update

The second detail: an auto-mapped update dislikes mixed types. A boolean in one column and text in the next can be enough for an error. Everything goes out as text, and empty values become empty cells rather than the word "null".

What lands in the sheet

ColumnSource
vat_status, name_vat, regon, address_vatwhite list
bank_accountswhite list, up to 5 accounts, the rest as "+N more"
legal_form, name_krs, krs_registered_sinceKRS
peopleKRS, section 2
pkd_mainKRS, main line of business
checked_atdate of the check

Limitations

Sole traders have no KRS entry. Their registration data is in CEIDG, whose API needs a token, so this workflow does not use it.

The request goes only to the business register (rejestr=P). Associations and foundations are in register S and get no KRS data.

Each company takes two requests. The Ministry API allows 100 requests a day, so longer lists have to be split across days. A NIP with a bad checksum still reaches the request (it fails and is skipped), so filter those out earlier.

The deep key search is a heuristic. For an unusual legal form a field may stay empty even though the information is in the extract.

When it does not make sense

For a few companies the register search pages are faster. The workflow is useful for lists in the hundreds, for example when preparing a sales database or reviewing suppliers. Right before payment, a separate workflow that checks contractors against the white list fits better. When register data should flow straight into a CRM or purchasing system, that is a process automation project.

Take it with you

How to cite this

Adrian Hunia (2026). NIP, VAT white list and KRS in one row: enriching Polish company data in n8n. SEVENEDGE. https://sevenedge.pl/en/workflows/nip-krs-biala-lista-wzbogacanie-firm (accessed: November 5, 2026)

Sources

  1. Ministerstwo Finansów — Jak korzystać z wykazu podatników VATAPI docs
  2. Portal Rejestrów Sądowych — API KRSAPI docs
  3. n8n docs — Google Sheetsn8n docs

Who is behind this

Adrian Hunia

Co-founder of SEVENEDGE

Co-founder of SEVENEDGE. Designs and deploys business systems for small companies, from production management to time tracking. Works with Next.js, FastAPI and PostgreSQL. SEVENEDGE has no subcontractors — both owners write the code.

Related documents

Other workflows we documented the same way.

7SVENAI assistant, not a human

You are chatting with an AI assistant. Replies are generated by artificial intelligence (Cerebras) and may contain mistakes. Please do not share sensitive data in the chat.

Your personal data is controlled by SEVENEDGE ADRIAN HUNIA. We use your chat messages to answer your questions and, if you ask, to book a meeting. Details and your rights: Privacy policy.

Hi! I'm SVEN, the SEVENEDGE AI assistant. We build apps, SaaS and AI automations. How can I help?
SVEN, the SEVENEDGE mascot, looking through a requestSVEN, the SEVENEDGE mascot, thinking over a coffeeSVEN, the SEVENEDGE mascot, working at a laptop
Got an app idea?