Quick Overview
This webhook-based workflow takes a website URL, finds and fetches the site’s Impressum/imprint page, extracts structured company details with OpenAI, verifies each value against the page text, and returns a JSON response with the verified company data.
How it works
- Receives a POST webhook request containing a
website URL (and optionally organization and reference_id).
- Validates and normalizes the URL, blocks private/local addresses, and returns a 400 response if the input is invalid.
- Fetches the website homepage and locates an Impressum/imprint URL from links or embedded content, falling back to
/impressum when needed.
- Fetches the Impressum page, converts the HTML into cleaned plain text, and stops extraction when the page has no usable content.
- Sends the cleaned Impressum text to OpenAI Chat Completions to extract company fields as strict JSON.
- Verifies the extracted fields by checking they literally appear in the Impressum text, drops unverified values, and returns the verified
data plus dropped_fields and the detected impressum_url in the webhook response.
Setup
- Add an OpenAI API credential in n8n and attach it to the HTTP request that calls
https://api.openai.com/v1/chat/completions.
- Copy the production webhook URL and configure your source system to POST JSON like
{"website":"https://example.com","organization":"Example GmbH","reference_id":"123"} to it.
- If you plan to expose the webhook publicly, add authentication (for example, header-based auth) to protect the endpoint.
- Update the OpenAI model/endpoint settings if you want to use a different model or an OpenAI-compatible provider.