Skip to content
msMarketSDK

// guide

Pagination

Lists come newest first, a page at a time. There are no page numbers and no offsets, so a page never skips or repeats an object when new ones arrive.

A page

GET /v1/orders?limit=2request
curl "https://api.marketsdk.com/v1/orders?limit=2" \
  -H "Authorization: Bearer $MARKETSDK_KEY"
200 listresponse
{
  "object": "list",
  "data": [ { "object": "order", "id": "ord_..." }, { "object": "order", "id": "ord_..." } ],
  "has_more": true,
  "next_cursor": "ord_034XtPDs7UJ0TXzTsdaHZa"
}
  • limit is 1 to 100. The default is 20.
  • has_more says whether another page follows.
  • next_cursor is the id of the last object on the page, or null on the last page.

The next page

Pass next_cursor back as starting_after, with the same filters.

GET /v1/orders?limit=2&starting_after=ord_...request
curl "https://api.marketsdk.com/v1/orders?limit=2&starting_after=ord_034XtPDs7UJ0TXzTsdaHZa" \
  -H "Authorization: Bearer $MARKETSDK_KEY"

A cursor from another list, or one that is not an id, gets 400 with param set to starting_after.

next: idempotency and rate limits