Zapier Integration
Complete guide to integrating HeadlessX with Zapier automation
Automate web scraping with Zapier and HeadlessX. Connect to 5,000+ apps without code.
Quick Setup
Step 1: Add Webhooks by Zapier
- Create a new Zap
- Choose trigger app
- Add Webhooks by Zapier action
- Select POST method
Step 2: Configure Webhook
URL: http://your-headlessx-server:3001/api/website/html
Headers:
Content-Type: application/json
X-API-Key: your-api-key-here
Data (JSON):
{
"url": "{{url}}",
"stealth": true
}
Step 3: Test & Enable
- Click Test & Continue
- Review the response
- Enable your Zap
Complete Zap Examples
Example 1: New RSS Item → Scrape → Save to Google Sheets
Trigger: RSS by Zapier
- Feed URL:
https://example.com/feed
Action 1: Webhooks by Zapier (POST)
- URL:
http://localhost:3001/api/website/content - Headers:
Content-Type: application/json X-API-Key: your-api-key - Data:
{ "url": "{{link}}", "stealth": true }
Action 2: Google Sheets - Create Spreadsheet Row
- Spreadsheet: My Scraped Articles
- Worksheet: Sheet1
- Title:
{{title}} - Content:
{{data__markdown}} - URL:
{{link}} - Date:
{{pubDate}}
Example 2: Scheduled Price Monitoring
Trigger: Schedule by Zapier
- Frequency: Every 6 hours
Action 1: Code by Zapier (JavaScript)
- Input Data:
productUrls = ["url1", "url2", "url3"] - Code:
const urls = inputData.productUrls; return urls.map(url => ({ url }));
Action 2: Looping by Zapier
- Loop through URLs
Action 3: Webhooks by Zapier (POST)
- URL:
http://localhost:3001/api/website/html - Data:
{ "url": "{{url}}", "stealth": true }
Action 4: Code by Zapier
- Extract price from HTML
- Compare with previous
Action 5: Gmail - Send Email (if price dropped)
Example 3: Lead Generation from LinkedIn
Trigger: LinkedIn Lead Gen Forms
Action 1: Webhooks by Zapier
- Scrape company website from form
Action 2: Code by Zapier
- Extract contact info using regex
Action 3: HubSpot - Create Contact
- Add to CRM
Custom Zapier App
For easier integration, use our custom Zapier app (coming soon):
Installation
- Visit Zapier App Directory
- Search "HeadlessX"
- Click Add to Zapier
- Authenticate with API key
Authentication
- API URL:
http://your-server:3001 - API Key: Your HeadlessX API key
Triggers
- New Scrape Completed - When scraping finishes
- New Screenshot Taken - When screenshot captured
- CAPTCHA Detected - When CAPTCHA found
Actions
-
Scrape HTML
- Input: URL, Stealth (yes/no)
- Output: HTML, Title, Status Code
-
Scrape with JavaScript
- Input: URL, Wait For, Timeout
- Output: Rendered HTML
-
Get Markdown Content
- Input: URL
- Output: Markdown, Plain Text
-
Take Screenshot
- Input: URL, Full Page (yes/no)
- Output: Image URL (Base64)
-
Google Search
- Input: Query, Location, Results Count
- Output: Organic Results, Featured Snippet
Searches
- Find Scrape by URL - Look up cached scrape
- Find Screenshot - Get existing screenshot
Advanced Workflows
Workflow 1: Content Republishing
RSS Feed → Scrape Article → Extract Images →
Upload to S3 → Reformat with AI → Publish to WordPress
Tools Used:
- RSS by Zapier
- HeadlessX (Webhooks)
- Amazon S3
- OpenAI
- WordPress
Workflow 2: Competitor Analysis
Schedule → Scrape Competitors → Extract Pricing →
Compare with Yours → Update Spreadsheet → Alert if Cheaper
Tools Used:
- Schedule by Zapier
- HeadlessX (Webhooks)
- Code by Zapier
- Google Sheets
- Slack
Workflow 3: Job Board Aggregator
Trigger URLs → Scrape Job Listings → Parse with AI →
Filter by Criteria → Post to Your Site → Tweet
Tools Used:
- Webhook (trigger)
- HeadlessX
- OpenAI (extract structured data)
- Filter
- WordPress
Multi-Step Zaps
Step 1: Trigger
- New email in Gmail
- Contains "scrape"
Step 2: Extract URL
Code by Zapier:
const body = inputData.body;
const urlMatch = body.match(/https?:\/\/[^\s]+/);
return { url: urlMatch ? urlMatch[0] : null };
Step 3: Scrape
Webhooks by Zapier:
{
"url": "{{url}}",
"stealth": true
}
Step 4: Process with AI
OpenAI:
- Extract key information from HTML
Step 5: Save
Airtable - Create Record
Step 6: Reply
Gmail - Send Email
- Attach results
Error Handling
Filter Bad Responses
Add Filter by Zapier after webhook:
Condition:
successequalstrue
Retry on Failure
Use Error Handler path:
- If webhook fails
- Delay 30 seconds
- Retry once
- If still fails → notify admin
Validate URLs
Code by Zapier before scraping:
function isValidUrl(string) {
try {
new URL(string);
return true;
} catch (_) {
return false;
}
}
const url = inputData.url;
if (!isValidUrl(url)) {
throw new Error('Invalid URL');
}
return { url };
Formatter Integration
Extract Data with Formatter
Use Formatter by Zapier to parse HTML:
Action: Text - Extract Pattern
- Input:
{{data__html}} - Pattern:
<title>(.*?)</title> - Output: Page title
Clean Markdown
Action: Text - Replace
- Input:
{{data__markdown}} - Find:
\n\n+ - Replace:
\n\n
Path Rules
Create different paths based on scrape results:
Path A: Success
successequalstrue- Save to Notion
Path B: CAPTCHA
error__codecontainsCAPTCHA- Send alert to Slack
Path C: Timeout
error__codeequalsTIMEOUT- Retry with longer timeout
Storage Integration
Save Screenshots
- HeadlessX - Take Screenshot
- Code by Zapier - Convert Base64
- Google Drive - Upload File
Code:
const base64 = inputData.screenshot;
const buffer = Buffer.from(base64, 'base64');
return { fileData: buffer };
Cache Results
- HeadlessX - Scrape
- Storage by Zapier - Set Value
- Key: URL hash
- Value: HTML (expires in 1 hour)
Best Practices
- Use Filters: Don't run actions on failed scrapes
- Add Delays: If scraping multiple URLs
- Error Paths: Always handle failures
- Format Data: Use Formatter to clean output
- Test First: Always test before enabling
Limits & Tips
Zapier Limits
| Plan | Tasks/Month | Zaps | Update Time |
|---|---|---|---|
| Free | 100 | 5 | 15 min |
| Starter | 750 | 20 | 15 min |
| Professional | 2,000+ | Unlimited | 2 min |
Tips
- Combine Steps: Use Code instead of multiple actions
- Batch Processing: Loop through arrays
- Caching: Store frequently scraped pages
- Webhooks: For real-time triggers
Troubleshooting
Zap Not Triggering
- Check trigger setup
- Verify test data exists
- Review Zap history logs
Webhook Returns Error
- Verify API key in headers
- Check server is accessible
- Test URL manually with curl
Data Not Mapping
- Test step and view output
- Check field names match
- Use Code to transform if needed
Example Apps
Connect HeadlessX with popular apps:
| App | Use Case |
|---|---|
| Slack | Send scrape alerts |
| Google Sheets | Log all scrapes |
| Airtable | Store structured data |
| Notion | Create knowledge base |
| HubSpot | Enrich contacts |
| Monday.com | Track scraping tasks |
| Mailchimp | Update email lists |