Scrape an explicit list of URLs in one async request. The API returns a batch id right away. Poll the status endpoint or set webhook_url to be notified when the batch finishes.
New to batches? Start with the batch scrape guide.
POST /v2/batch/scrape
https://api.webcrawlerapi.com/v2/batch/scrapeFormat: JSON
Method: POST
Request
urls- (required) array of URLs to scrape. Maximum is your plan's job items limit (100 during trial).output_formats- (optional) array of output formats. Valid values:markdown,cleaned,html,links,images. Default is["markdown"].main_content_only- (optional) extract only the main content. Default isfalse.clean_selectors- (optional) CSS selectors to clean from the output. See clean selectors.max_concurrency- (optional) max URLs scraped in parallel for this batch.0or omitted means no per-batch cap.ignore_invalid_urls- (optional) skip invalid URLs and report them ininvalid_urls. Iffalse, any invalid URL fails the whole request with400. Default istrue.webhook_url- (optional) public http(s) URL called once when the batch finishes. See webhooks.max_age- (optional) cache duration in seconds. Default is604800(7 days). Set to0to bypass the cache. See Caching.respect_robots_txt- (optional) respect each website's robots.txt. Default isfalse.
prompt, response_schema and actions are not supported in batch scrape.
URLs are normalized and deduplicated. Duplicates and rejected URLs are returned in invalid_urls.
curl example
curl --request POST \
--url https://api.webcrawlerapi.com/v2/batch/scrape \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"urls": [
"https://www.example.com/",
"https://www.example.com/pricing",
"https://www.example.com/blog"
],
"output_formats": ["markdown"],
"max_concurrency": 5,
"webhook_url": "https://your-server.com/webhook"
}'Response
{
"id": "6c391693-e566-4b99-97ca-5fa00032e281",
"status_url": "https://api.webcrawlerapi.com/v2/batch/scrape/6c391693-e566-4b99-97ca-5fa00032e281",
"invalid_urls": [
{
"url": "not a url",
"error_code": "invalid_request",
"error_message": "invalid url"
}
]
}GET /v2/batch/scrape/:id
https://api.webcrawlerapi.com/v2/batch/scrape/:idMethod: GET
Returns batch progress and one page of items.
Query params:
limit- (optional) items per page, 1 to 500. Default is100.cursor- (optional) value ofnextfrom the previous page.
curl --request GET \
--url 'https://api.webcrawlerapi.com/v2/batch/scrape/6c391693-e566-4b99-97ca-5fa00032e281?limit=100' \
--header 'Authorization: Bearer <YOUR_API_KEY>'Response
{
"id": "6c391693-e566-4b99-97ca-5fa00032e281",
"status": "completed",
"total": 3,
"completed": 2,
"failed": 1,
"canceled": 0,
"data": [
{
"url": "https://www.example.com/",
"status": "done",
"page_status_code": 200,
"title": "Example",
"markdown_url": "https://data.webcrawlerapi.com/.../page.md"
},
{
"url": "https://www.example.com/blog",
"status": "error",
"error_code": "webpage_non_success",
"error_message": "page returned a non-success status code"
}
],
"next": ""
}Fields:
status- batch status:scraping,completed,failedorcancelled.total,completed,failed,canceled- item counters.data[].status- item status, for exampledoneorerror.data[].markdown_url,cleaned_url,html_url- links to the output, present for finished items and only for requested formats.data[].from_cache-trueif the result came from cache.data[].error_code,error_message- set for failed items. See Errors.next- cursor for the next page. Empty on the last page.
GET /v2/batch/scrape/:id/errors
https://api.webcrawlerapi.com/v2/batch/scrape/:id/errorsMethod: GET
Lists URLs that failed. URLs blocked by robots.txt are returned separately in robots_blocked.
{
"errors": [
{
"url": "https://www.example.com/blog",
"error_code": "webpage_non_success",
"error_message": "page returned a non-success status code"
}
],
"robots_blocked": []
}DELETE /v2/batch/scrape/:id
https://api.webcrawlerapi.com/v2/batch/scrape/:idMethod: DELETE
Cancels a running batch. Items that did not start are marked canceled and are not charged.
curl --request DELETE \
--url https://api.webcrawlerapi.com/v2/batch/scrape/6c391693-e566-4b99-97ca-5fa00032e281 \
--header 'Authorization: Bearer <YOUR_API_KEY>'Response:
{"status": "canceled"}Webhook payload
When webhook_url is set, the API sends a POST request with the same body as GET /v2/batch/scrape/:id (first 100 items) once the batch finishes. For larger batches, fetch the remaining pages with cursor.
Error Responses
400 Bad Request- invalid parameters, no valid URLs, or batch already finished (on cancel)401 Unauthorized- invalid or missing API key402 Payment Required- insufficient account balance403 Forbidden- organization suspended404 Not Found- batch does not exist500 Internal Server Error- server-side error