Paginating results
Walk a collection with a cursor, and why there is no page number.
Collections are paged with an opaque cursor. Every page carries nextCursor; pass it back to get
the next one, and stop when it is null.
curl "https://fabric.inc/api/v1/brands/$BRAND/products?limit=100" \
-H "Authorization: Bearer $FABRIC_API_KEY"{
"data": [{ "id": "prd_...", "sku": "SW-001" }],
"nextCursor": "eyJpZCI6InByZF8..."
}curl "https://fabric.inc/api/v1/brands/$BRAND/products?limit=100&cursor=eyJpZCI6InByZF8..." \
-H "Authorization: Bearer $FABRIC_API_KEY"nextCursor is always present — null on the last page rather than absent — so a loop can test it
without distinguishing missing from empty.
There is no page number
offset, page and skip are refused with 400, not ignored.
A catalog changes while you read it. An import lands, a product is archived, and every row after the change shifts position. Offset paging then silently skips rows and returns others twice, and nothing in the response says so. A cursor points at a row rather than a position, so neither happens.
Limits
limit defaults to 50 and caps at 200. Above 200 the request is refused, not quietly clamped —
asking for 1000 and receiving 200 looks identical to a catalog with 200 products in it.
Walking the whole catalog
cursor=""
while :; do
page=$(curl -s "https://fabric.inc/api/v1/brands/$BRAND/products?limit=200&cursor=$cursor" \
-H "Authorization: Bearer $FABRIC_API_KEY")
echo "$page" | jq -c '.data[]'
cursor=$(echo "$page" | jq -r '.nextCursor // empty')
[ -z "$cursor" ] && break
doneA cursor stays valid across pages of a changing catalog. It carries a position and nothing else — no filter, no brand, no permission — so a walk cannot outlive what your credential may read.