Poll for batch progress and retrieve per-item results
status is completed, failed, or cancelled, stop polling (the batch will not change further).
| Status | Meaning |
|---|---|
pending | Queued — no items have started yet |
running | At least one item is being processed |
completed | All items reached a terminal state. Check failedCount for partial failures |
failed | The batch failed unexpectedly |
cancelled | Cancelled via DELETE /api/batch/scrape/{batchId} |
completed does not guarantee every URL succeeded. A batch is marked completed when all items have a terminal status (completed or failed). Always inspect failedCount and individual item statuses to detect partial failures.| Field | Type | Description |
|---|---|---|
status | string | Batch-level status: pending, running, completed, failed, or cancelled |
totalUrls | number | Total number of URLs in the batch |
completedCount | number | Items that finished successfully |
failedCount | number | Items that encountered an error |
items | array | Per-item results (see below) |
createdAt | string | ISO 8601 timestamp when the batch was submitted |
finishedAt | string | null | ISO 8601 timestamp when the batch reached a terminal state, or null if still running |
items represents one URL:
| Field | Type | Description |
|---|---|---|
uuid | string | Unique ID for this batch item |
url | string | The URL that was processed |
jobId | string | null | Internal worker job ID. null if the item is still pending |
status | string | Item-level status: pending, running, completed, failed, or cancelled |
result | any | null | Extracted content. Object if output: "json", string if "markdown". null until completed |
error | string | null | Error description if status is failed, otherwise null |
creditsUsed | number | Credits consumed by this item. 0 for failed or cancelled items |
startedAt | string | null | ISO 8601 timestamp when the worker started this item |
finishedAt | string | null | ISO 8601 timestamp when this item completed or failed |
screenshotUrl | string | null | S3 URL for the screenshot, or null if screenshots were not requested |
completedCount + failedCount === totalUrls but some items failed, retry them without re-running the whole batch:
| Code | Reason |
|---|---|
401 | Missing x-api-key header |
403 | Invalid or expired API key |
404 | No batch found with this ID, or it belongs to a different user |
The batch ID returned by POST /batch/scrape