Skip to main content

Overview

List endpoints return paginated results using cursor-based pagination. This provides stable, efficient pagination even when data is being added or removed.

Query parameters

ParameterTypeDefaultDescription
limitinteger25Number of items per page (max 100)
cursorstringCursor from next_cursor in a previous response

Response format

List responses follow a consistent format:
{
  "object": "list",
  "data": [
    { "id": "qr_123", "object": "qr_code", "..." : "..." },
    { "id": "qr_124", "object": "qr_code", "..." : "..." }
  ],
  "has_more": true,
  "next_cursor": "eyJpZCI6InFyXzEyNCJ9"
}
FieldDescription
objectAlways "list"
dataArray of resource objects
has_moretrue if there are more pages
next_cursorCursor to pass as the cursor parameter for the next page. null if no more pages.

Fetching all pages

import requests

def fetch_all_qr_codes(api_key):
    all_codes = []
    cursor = None

    while True:
        params = {"limit": 100}
        if cursor:
            params["cursor"] = cursor

        response = requests.get(
            "https://api.useqrkit.com/v1/qr-codes",
            headers={"Authorization": f"Bearer {api_key}"},
            params=params,
        )
        data = response.json()
        all_codes.extend(data["data"])

        if not data["has_more"]:
            break
        cursor = data["next_cursor"]

    return all_codes

Sorting

List endpoints support sorting with sort and order parameters:
ParameterValuesDefault
sortcreated_at, updated_at, name, scan_countcreated_at
orderasc, descdesc
curl "https://api.useqrkit.com/v1/qr-codes?sort=scan_count&order=desc&limit=10" \
  -H "Authorization: Bearer qr_live_..."
Sorting is available on the List QR Codes endpoint. Other list endpoints return results sorted by created_at descending.