π¬ Extract verified company data from website Impressum pages with OpenAI
β‘ 0 views Β· π¬ Document Extraction & Analysis
Description
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
websiteURL (and optionallyorganizationandreference_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
/impressumwhen 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
dataplusdropped_fieldsand the detectedimpressum_urlin 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.
π Nodes Used
HTTP Request, Webhook
π₯ Import
Download workflow.json and import into n8n:
Workflow menu β Import from File