Skip to content

Pagination

Page through lists with cursor and limit.

On this page

List operations return one page at a time.

Request a page

Request a page
ParameterWhat it does
limitHow many items to return, from 1 to 100. The default is 50.
cursorWhere to continue. Pass the next_cursor of the previous page.

The response has items, and next_cursor when there's another page:

Shell
curl -s "https://api.legion.ambient.xyz/v1/rentals?limit=20" \
  -H "Authorization: Bearer $LEGION_API_KEY"
JSON
{
  "items": [ … ],
  "next_cursor": "…"
}

Get the next page

Pass next_cursor back as cursor, with the same filters:

Shell
curl -s "https://api.legion.ambient.xyz/v1/rentals?limit=20&cursor=$NEXT_CURSOR" \
  -H "Authorization: Bearer $LEGION_API_KEY"

The last page has no next_cursor.

Rules

  • A cursor is opaque. Don't build or change one.

  • A cursor that isn't one the API returned answers 400 invalid_cursor.

  • A limit out of range answers 400 invalid_request.