n8n Webhook: Apify + OpenAI Extract Structured Data JSON
n8n Webhook: Apify + OpenAI Extract Structured Data JSON
Regular price
£6.99
Regular price
£6.99
Sale price
Unit price
/
per
⬇
Instant Digital Download
∞
Unlimited Downloads
★
Lifetime Access in Your Account
Couldn't load pickup availability
🔥
128+ Sold
Popular with n8n builders
⚡
23 people viewing
High interest right now
✅
9 added today
Fast-moving digital product
n8n Webhook: Apify + OpenAI Extract Structured Data JSON
Regular price
£6.99
Regular price
£6.99
Sale price
Unit price
/
per
Extract structured JSON from any webpage—on demand via an n8n Webhook
This n8n workflow exposes a webhook that takes a target webpage (a direct target_url or a subject + website_domain), scrapes it with Apify, and uses OpenAI to return structured JSON for exactly the fields you request.
What this workflow does
-
Accepts webhook POST requests with either
target_urlorsubject+website_domain, plus a requiredtarget_dataarray describing the fields to extract. -
Validates input: if
target_datais missing or empty, the workflow returns HTTP 400. -
Resolves the page URL:
- If
target_urlis provided, it uses it directly. - Otherwise, it runs an Apify Google Search Scraper using a
site:query and takes the first organic result.
- If
- Handles missing matches: if no URL is found, it returns HTTP 404.
- Scrapes and normalizes content using Apify Website Content Crawler (optionally with provided cookies), including Markdown normalization and content length.
-
Pre-checks content length: if the scraped content is too short, it returns
success:falsewith HTTP 200. - Extracts with OpenAI: sends the page content and the requested field definitions to OpenAI using a dynamic schema, returning structured JSON and using "NA" for missing values.
Use cases
- Turn landing pages, docs, or product pages into structured data for a CRM or database.
- Build an API-like endpoint for content extraction that calls OpenAI with field definitions.
- Automate lead enrichment by extracting attributes from websites found via Apify search.
Technical details
-
Nodes / tools used:
webhook,if,set,http request,n8n-nodes-langchainagent(plus supporting workflow logic and notes). - Apify integrations: Header-authenticated Apify HTTP Request steps for Google Search Scraper and Website Content Crawler (Markdown normalization).
- OpenAI: OpenAI chat model configured via n8n credential to produce JSON with a dynamic schema.
-
Authentication: set up an n8n Header Auth credential to send
Authorization: Bearer <APIFY_TOKEN>, then select it on both Apify HTTP Request steps.
Configure your webhook path when calling the workflow to trigger extraction and receive the returned structured JSON.
