Pagination
Page through lists with cursor and limit.
List operations return one page at a time.
Request a page
| Parameter | What it does |
|---|---|
limit | How many items to return, from 1 to 100. The default is 50. |
cursor | Where to continue. Pass the next_ of the previous page. |
The response has items, and next_ 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_ 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_.
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
limitout of range answers400 invalid_.request