Basics

Pagination

List endpoints return newest items first and use cursor pagination. Two query parameters control it:

ParameterMeaning
limitItems per page, 1 to 100. Default 20.
cursorWhere to continue. Take it from meta.next_cursor of the previous page.

Each list response has meta.has_more and meta.next_cursor. When has_more is false, you have reached the end and next_cursor is null.

Response meta
{
    <span class="tk-s">"</span>request_id<span class="tk-s">"</span>: <span class="tk-s">"</span>req_1a2b3c4d5e6f708192a3<span class="tk-s">"</span>,
    <span class="tk-s">"</span>mode<span class="tk-s">"</span>: <span class="tk-s">"</span>live<span class="tk-s">"</span>,
    <span class="tk-s">"</span>has_more<span class="tk-s">"</span>: true,
    <span class="tk-s">"</span>next_cursor<span class="tk-s">"</span>: <span class="tk-s">"</span>YzE6ODk5MQ<span class="tk-s">"</span>
}

Reading every page

import requests

API_KEY = 'ak_test_YOUR_KEY'

url = 'https://dev.adolfjon.uz/v1/me/orders'
headers = {'Authorization': f'Bearer {API_KEY}'}
params = {'limit': 100}
while True:
    body = requests.get(url, headers=headers, params=params, timeout=10).json()
    for order in body['data']:
        print(order['id'], order['status'])
    if not body['meta']['has_more']:
        break
    params['cursor'] = body['meta']['next_cursor']

Cursors are opaque: do not build or change them yourself. New items that appear while you page do not shift your position, because cursors point at an item, not at an offset.