Batch scraping multiple URLs
You can now batch scrape multiple URLs at the same time. It takes the starting URLs and optional parameters as arguments. The params argument allows you to specify additional options for the batch scrape job, such as the output formats.How it works
It is very similar to how the/crawl
endpoint works. You can either start the batch and wait for completion, or start it and handle completion yourself.
batchScrape
(JS) /batch_scrape
(Python): starts a batch job and waits for it to complete, returning the results.startBatchScrape
(JS) /start_batch_scrape
(Python): starts a batch job and returns the job ID so you can poll or use webhooks.
Usage
Response
- Calling
batchScrape
/batch_scrape
returns the full results when the batch completes.
Completed
- Calling
startBatchScrape
/start_batch_scrape
returns a job ID you can track viagetBatchScrapeStatus
/get_batch_scrape_status
, using the API endpoint/batch/scrape/{id}
, or webhooks. This endpoint is intended for in-progress checks or immediately after completion, as batch jobs expire after 24 hours.
Batch scrape with structured extraction
You can also use the batch scrape endpoint to extract structured data from the pages. This is useful if you want to get the same structured data from a list of URLs.Response
batchScrape
/batch_scrape
returns full results:
Completed
startBatchScrape
/start_batch_scrape
returns a job ID:
Batch scrape with webhooks
You can configure webhooks to receive real-time notifications as each URL in your batch is scraped. This allows you to process results immediately instead of waiting for the entire batch to complete.cURL
Quick Reference
Event Types:batch_scrape.started
- When the batch scrape beginsbatch_scrape.page
- For each URL successfully scrapedbatch_scrape.completed
- When all URLs are processedbatch_scrape.failed
- If the batch scrape encounters an error
For detailed webhook configuration, security best practices, and troubleshooting, visit the Webhooks documentation.