Runs
Base path: https://api.scrapy.infralyon.com/v1/runs
Auth required. All endpoints are owner-scoped to the API key’s account.
List runs
Request
GET /v1/runs
curl -s "https://api.scrapy.infralyon.com/v1/runs?kind=async_batch&status=succeeded&limit=20" \
-H "x-api-key: $SCRAPYIO_API_KEY"
Query parameters
| Name | Description |
|---|---|
kind | api_sync, async_batch, or aliases api, scraper |
toolId | Filter by internal tool id |
status | Public status; succeeded matches internal completed |
offset / limit | Pagination |
Response 200
{
"data": {
"items": [
{
"id": "…",
"kind": "async_batch",
"status": "succeeded",
"toolId": "…",
"publisher": "datadoping",
"toolSlug": "instagram-profile-scraper",
"runName": "ig-profiles-demo",
"totalItems": 3,
"processedItems": 3,
"completedItems": 3,
"failedItems": 0,
"billedAmount": 0.03,
"estimatedCost": 0.03,
"createdAt": "2026-09-07T10:00:00.000Z",
"completedAt": "2026-09-07T10:01:12.000Z"
}
],
"total": 1,
"offset": 0,
"limit": 20
}
}
Get run
Request
GET /v1/runs/{runId}
curl -s "https://api.scrapy.infralyon.com/v1/runs/$RUN_ID" \
-H "x-api-key: $SCRAPYIO_API_KEY"
Response 200
{ "data": { …run fields… } }
Also includes:
| Field | Description |
|---|---|
firstErrorMessage | First failed item’s error, or null |
errorJson | Run error payload, or null. A running abort sets abort_requested |
runId must be a UUID (400 otherwise).
Response 404
Unknown id or not owned by the caller.
Abort a run
POST /v1/runs/{runId}/abort
Only async batch runs that are queued or running.
| State | Result |
|---|---|
| Queued | status: cancelled |
| Running | status: running, abortRequested: true (workers stop cooperatively) |
| Already cancelled | status: cancelled |
| Sync run, or any other terminal state | 400 |
| Missing or another account’s run | 404 |
Resume a run
POST /v1/runs/{runId}/resume
Only cancelled or partial async batch runs that still have pending inputs. Success returns status: queued and pendingItems.
| Case | Result |
|---|---|
| No pending inputs | 400 |
| Sync run, or status other than cancelled/partial | 400 |
| Missing or another account’s run | 404 |
| Queue enqueue fails | 500, and the run is put back to its previous status when it is still queued |
Get dataset items
Request
GET /v1/runs/{runId}/dataset/items
# JSON envelope
curl -s "https://api.scrapy.infralyon.com/v1/runs/$RUN_ID/dataset/items?offset=0&limit=50" \
-H "x-api-key: $SCRAPYIO_API_KEY"
# CSV file
curl -s "https://api.scrapy.infralyon.com/v1/runs/$RUN_ID/dataset/items?format=csv" \
-H "x-api-key: $SCRAPYIO_API_KEY" \
-o out.csv
Query parameters
| Name | Description |
|---|---|
format | Omit or json for envelope; else csv, jsonl, xlsx, … |
fields / omit / clean / desc | Export shaping |
offset / limit | Window |
attachment | Control Content-Disposition |
See Export dataset.
Response 200 (JSON)
{
"data": {
"items": [ { } ],
"total": 50,
"offset": 0,
"limit": 50
}
}
Response 404
Run not found for this account.
Status values
queued · running · succeeded · partial · failed · cancelled