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

Pagination

List endpoints on the Platform API use a consistent pagination model.

Query parameters

ParamDefaultMaxDescription
offset0Number of items to skip
limit20100Page size

Invalid values return validation_error (HTTP 400).

Response envelope

{
"data": {
"items": [ ],
"total": 256,
"offset": 0,
"limit": 20
}
}
FieldMeaning
itemsCurrent page
totalTotal matching rows (for the same filters)
offsetEcho of request offset
limitEcho of request limit

Walking all pages

OFFSET=0
LIMIT=100

while true; do
RESP=$(curl -s "https://api.scrapy.infralyon.com/v1/runs?offset=$OFFSET&limit=$LIMIT" \
-H "Authorization: Bearer $SCRAPY_API_KEY")
COUNT=$(echo "$RESP" | jq '.data.items | length')
TOTAL=$(echo "$RESP" | jq '.data.total')
echo "got $COUNT (offset=$OFFSET / total=$TOTAL)"
[ "$COUNT" -eq 0 ] && break
OFFSET=$((OFFSET + LIMIT))
[ "$OFFSET" -ge "$TOTAL" ] && break
done

Dataset items

GET /v1/runs/{runId}/dataset/items also supports offset and limit for JSON responses. Export formats (format=csv, etc.) apply the same windowing where applicable.