Basic Usage
Your first request specifies alimit (items per page). The response includes a cursor and has_more flag:
cursor from the previous response:
has_more is false, you have reached the end of the result set. The cursor field will be null.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | integer | 20 | Items per page. Min 1, max 100. |
cursor | string | — | Opaque cursor from a previous response. |
sort | string | varies | Sort field with optional - prefix for descending (e.g., -filing_date). |
include_total | boolean | false | Include total_count in the pagination object. |
Response Shape
All list endpoints return the same structure. Default response (withoutinclude_total):
?include_total=true:
has_moreis always at the top level (not insidepagination).pagination.cursorisnullwhenhas_moreisfalse.pagination.total_countis only present wheninclude_total=trueis passed as a query parameter. It is omitted by default.pagination.total_count_approximateis emitted alongsidetotal_countwhenever the total is present. It isfalsewhen the count is exact andtruewhen the count was capped (for example, OpenSearch caps total hits at 10,000 for deep searches). Treat any exact count as a hard number and any approximate count as “at least this many”.
Cursor Stability
Cursors encode a position in the result set, not an offset. This means: Records inserted after your cursor was created will not appear in your current pagination session. You will not see duplicates or gaps. Records deleted after your cursor was created are silently skipped. Your page may contain fewer items than the requestedlimit in rare cases.
Concurrent updates do not affect cursor validity. Even if the underlying data changes, your cursor continues from where it left off.
Cursors are scoped to a specific query, sort order, and filter combination. Changing any of these parameters invalidates the cursor — start a fresh pagination session instead.
Cursor Expiration
Cursors expire after 24 hours. If you pass an expired cursor, you receive acursor_expired error:
Sorting
You can sort results using thesort parameter. The cursor encodes the sort position, so you must use the same sort value for every page in a session.
Supported sort fields vary by endpoint:
| Endpoint | Supported Sort Fields | Default |
|---|---|---|
GET and POST /v1/trademarks | filing_date, registration_date, expiry_date, renewal_due_date, updated_at, publication_date, termination_date, office_code, jurisdiction_code | Relevance when q is present; unordered (fast) when no q |
GET /v1/owners | name, updated_at | name |
- prefix for descending (no prefix = ascending):
When a text query (
q) is provided, the default sort is by relevance. When only filters are used (no q), results are returned in index order (fast, unordered). Providing an explicit sort overrides the default in both cases.Total Count
By default, thetotal_count is not included in the response. To include it on any list endpoint, pass include_total=true:
pagination.total_count— the count itself (integer, only present wheninclude_total=true).pagination.total_count_approximate—falsewhen the count is exact;truewhen the underlying engine capped the count (OpenSearch caps at 10,000 for deep search queries).
GET /v1/trademarks and POST /v1/trademarks currently also echo total_results, total_count_exact, and total_count_approximate under search_meta for backward compatibility with earlier SDK releases. These fields are deprecated and will be removed in v1.1 — read pagination.total_count and pagination.total_count_approximate going forward.SDK Support
The TypeScript SDK wraps pagination with async iterators,toArray(), and manual page control. See SDK Pagination for usage patterns.