Scrape a URL, rewrite with AI, and publish to WordPress as a draft.
The Admin Secret (set as ADMIN_SECRET in your .env) is required to manage API keys. It is kept only in session memory and never sent to the server except when making key management requests.
Error
New API Key — Copy Now
This key will never be shown again. Copy it and store it securely.
| Label | Created | Status | ID |
|---|
Use this 3-node flow in n8n. Replace the placeholders with your actual values.
Option A — Single node (recommended)
Node 1 — HTTP Request (POST /api/scrape-and-publish)
URL: http://YOUR_SERVER:3000/api/scrape-and-publish
Method: POST
Header: X-API-Key → {{ $env.SCRAPER_API_KEY }}
Body (JSON):
{
"targetUrl": "https://competitor.com/article",
"wpUrl": "https://yoursite.com",
"wpUsername": "admin",
"wpAppPassword": "xxxx xxxx xxxx xxxx",
"publishMode": "draft"
}
→ Returns: { jobId, postId, editUrl }
---
Option B — Two nodes with webhook (for long jobs / progress tracking)
Node 1 — HTTP Request (POST /api/process)
URL: http://YOUR_SERVER:3000/api/process
Body: { "targetUrl": "...", "webhookUrl": "{{ $node['Webhook'].webhookUrl }}" }
→ Returns: { jobId }
Node 2 — Webhook (fires when scraping is done)
→ Receives: { jobId, status, html, error, elapsed }
Node 3 — HTTP Request (POST /api/publish)
Body: { "wpUrl": "...", "wpUsername": "...", "wpAppPassword": "...", "publishMode": "draft", "jobId": "{{ $json.jobId }}" }
→ Returns: { postId, editUrl }
Header: X-API-Key: <your-key>
Returns: { jobId } immediately — job runs in background
Optional: include webhookUrl to receive a POST when the job finishes
Response
Header: X-API-Key: <your-key>
Returns: { status, elapsed, html?, error? }
Poll every 4-10 seconds until status === "done" or status === "error"
Response
Header: X-API-Key: <your-key>
Returns: { jobId, postId, editUrl } — waits for the full pipeline to finish
Optional: publishMode (draft | publish), webhookUrl, postTitle, excerpt, slug, featuredMediaId, categories, tags
Response
Header: X-API-Key: <your-key>
Returns: { postId, editUrl }
Note: include jobId from the /api/process response to publish that specific job's HTML
Webhook: add webhookUrl to receive a POST with { status, jobId, postId, editUrl } once publishing completes
Response