Skip to main content
Webhooks allow you to receive real-time notifications about the progress and completion of asynchronous operations like crawls and batch scrapes. Instead of polling for status, Firecrawl will send HTTP POST requests to your specified endpoint.

Webhook Events

Firecrawl sends webhooks for the following events:

Setting Up Webhooks

For Crawls

For Batch Scrapes

Webhook Configuration

URL (Required)

The HTTPS endpoint where Firecrawl will send webhook notifications.
Webhook URLs must use HTTPS. HTTP endpoints are not supported for security reasons.

Headers (Optional)

Custom headers to include with webhook requests. Commonly used for authentication.
Use headers to implement webhook authentication and verify that requests are coming from Firecrawl.

Metadata (Optional)

Custom metadata that will be included in all webhook payloads for the job. Useful for tracking context.

Events (Optional)

Filter which events trigger webhooks. By default, all events are sent.
Available events:
  • started - Job has started
  • page - A page has been scraped (can be high volume)
  • completed - Job completed successfully
  • failed - Job failed
If you only need to know when a job finishes, filter to ["completed", "failed"] to reduce webhook volume.

Webhook Payload

Firecrawl sends a POST request to your webhook URL with a JSON payload. The structure depends on the event type.

Started Event

Page Event

Sent for each page scraped. Contains the same data as the /scrape endpoint response.

Completed Event

Failed Event

Implementing a Webhook Handler

Here’s an example webhook handler implementation:

Best Practices

Return 200 quickly: Your webhook handler should return a 200 status code as quickly as possible. Process the webhook data asynchronously to avoid timeouts.
Implement authentication: Use the headers option to add authentication tokens, and verify them in your webhook handler.
Handle retries: Firecrawl will retry failed webhook deliveries. Make your handler idempotent to safely handle duplicate events.
Filter events: Use the events parameter to only receive the events you need, reducing webhook traffic and processing.
Webhook endpoints must respond within 30 seconds. Long-running operations should be queued for background processing.

Testing Webhooks Locally

To test webhooks during development, you can use tools like ngrok to expose your local server:

Troubleshooting

Webhooks Not Received

  1. Verify your endpoint is accessible via HTTPS
  2. Check that your server is returning a 200 status code
  3. Review your event filters - you may be filtering out the events
  4. Check your server logs for incoming requests

Authentication Failures

  1. Verify the Authorization header is being sent correctly
  2. Check that your handler is reading the header correctly (header names may be case-insensitive)
  3. Ensure the token matches exactly

High Volume Issues

If you’re receiving too many page events:
  1. Filter events to only ["completed", "failed"]
  2. Implement rate limiting in your webhook handler
  3. Process page events asynchronously using a queue