Scrape
Webhooks
Real-time notifications for your Firecrawl operations
Webhooks allow you to receive real-time notifications about your Firecrawl operations as they progress. Instead of polling for status updates, Firecrawl will automatically send HTTP POST requests to your specified endpoint when events occur.
Overview
Webhooks are supported for:
- Crawl operations - Get notified as pages are crawled and when crawls complete
- Batch scrape operations - Receive updates for each URL scraped in a batch
Basic Configuration
Configure webhooks by adding a webhook
object to your request:
JSON
Configuration Options
Field | Type | Required | Description |
---|---|---|---|
url | string | ✅ | Your webhook endpoint URL |
headers | object | ❌ | Custom headers to include in webhook requests |
metadata | object | ❌ | Custom data included in all webhook payloads |
events | array | ❌ | Event types to receive (default: all events) |
Event Types
Crawl Events
Event | Description | When Triggered |
---|---|---|
crawl.started | Crawl job initiated | When crawl begins |
crawl.page | Individual page scraped | After each page is successfully scraped |
crawl.completed | Crawl finished successfully | When all pages are processed |
crawl.failed | Crawl encountered an error | When crawl fails or is cancelled |
Batch Scrape Events
Event | Description | When Triggered |
---|---|---|
batch_scrape.started | Batch scrape job initiated | When batch scrape begins |
batch_scrape.page | Individual URL scraped | After each URL is successfully scraped |
batch_scrape.completed | Batch scrape finished | When all URLs are processed |
batch_scrape.failed | Batch scrape failed | When batch scrape fails or is cancelled |
Webhook Payload Structure
All webhook payloads follow this structure:
Payload Fields
Field | Type | Description |
---|---|---|
success | boolean | Whether the operation was successful |
type | string | Event type (e.g., crawl.page , batch_scrape.completed ) |
id | string | Unique identifier for the crawl/batch scrape job |
data | array | Scraped content (populated for page events) |
metadata | object | Custom metadata from your webhook configuration |
error | string | Error message (present when success is false ) |
timestamp | string | ISO 8601 timestamp of when the event occurred |
Examples
Crawl with Webhook
cURL
Batch Scrape with Webhook
cURL
Webhook Endpoint Example
Here’s how to handle webhooks in your application:
Event-Specific Payloads
started
Events
page
Events
completed
Events
failed
Events
Monitoring and Debugging
Testing Your Webhook
Use tools like ngrok for local development:
Webhook Logs
Monitor webhook delivery in your application:
Common Issues
Webhook Not Receiving Events
- Check URL accessibility - Ensure your endpoint is publicly accessible
- Verify HTTPS - Webhook URLs must use HTTPS
- Check firewall settings - Allow incoming connections to your webhook port
- Review event filters - Ensure you’re subscribed to the correct event types