Docs examples target https://api.scrapy.infralyon.com (not production https://api.scrapy.io).
Skip to main content

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​

NameDescription
kindapi_sync, async_batch, or aliases api, scraper
toolIdFilter by internal tool id
statusPublic status; succeeded matches internal completed
offset / limitPagination

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:

FieldDescription
firstErrorMessageFirst failed item’s error, or null
errorJsonRun 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.

StateResult
Queuedstatus: cancelled
Runningstatus: running, abortRequested: true (workers stop cooperatively)
Already cancelledstatus: cancelled
Sync run, or any other terminal state400
Missing or another account’s run404

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.

CaseResult
No pending inputs400
Sync run, or status other than cancelled/partial400
Missing or another account’s run404
Queue enqueue fails500, 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​

NameDescription
formatOmit or json for envelope; else csv, jsonl, xlsx, …
fields / omit / clean / descExport shaping
offset / limitWindow
attachmentControl 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