DEV Community

Bachir Djoukbala
Bachir Djoukbala

Posted on

Turning German company websites into structured B2B data (HRB, VAT ID, directors)

Every commercial website in Germany has to publish an Impressum, a legal notice required by §5 DDG (formerly §5 TMG). That makes it one of the most reliable public sources of company data in Europe. One page usually gives you:

  • the exact legal name and legal form (GmbH, AG, GmbH & Co. KG...)
  • the registered address
  • the commercial register number and court (for example HRB 14000, Amtsgericht Stuttgart)
  • the VAT ID (USt-IdNr.)
  • the managing directors (Geschäftsführer / Vorstand)
  • a contact email and phone number

The catch is that no two Impressum pages look alike. Some are in English ("Munich Local Court HRA 15420"), some list directors one per line with titles in brackets, and plenty mix in menu text and cookie banners.

How I parse it

I wrote a rule-based extractor in Python (httpx + lxml, no headless browser):

  1. Find the imprint link on the homepage (scoring "Impressum", "Imprint" and "Legal notice" links), then fall back to common paths such as /impressum and /de-de/impressum.
  2. Try several candidate pages and keep the most complete one, since multilingual sites often send you to an English page that has less data.
  3. Use regexes for the register number (HRA/HRB/GnR/PR/VR), German and English court phrasing, VAT IDs and German postcodes.
  4. Split director lists on commas, "und" and line breaks, then filter out anything that isn't shaped like a person's name ("Alle Produkte", "Exkl. MwSt"...).

Example output for bosch.de:

{
  "companyName": "Robert Bosch GmbH",
  "legalForm": "GmbH",
  "registerNumber": "14000",
  "registerCourt": "Stuttgart",
  "vatId": "DE811128135",
  "managingDirectors": ["Dr. Christian Fischer", "Dr. Markus Forschner", "Stefan Grosch"]
}
Enter fullscreen mode Exit fullscreen mode

In my latest 12-site test, 9 came back complete. The misses were sites that render the Impressum with JavaScript or sit behind bot protection, and the tool skips those on purpose rather than trying to get around them.

Use it

I published it as a pay-per-result Apify actor: $3 per 1,000 companies, and sites it can't read aren't charged. Paste a list of domains and export JSON, CSV or Excel.

https://apify.com/rejoicing_shanty/german-impressum-company-data

Useful for lead lists, KYB/vendor checks, or enriching a CRM with register numbers. I'd love feedback on fields you'd want added or sites where it misses.

Top comments (0)