Pagination
Cursor paging, limits, ordering and field selection.
Every list operation uses keyset cursors. A cursor points at a position in a fixed order, so a page does not skip or repeat rows when readers are added while you read.
Request#
| Query parameter | Meaning |
|---|---|
limit | Page size from 1 to 200. The default is 50. |
cursor | The next_cursor of the previous page. Leave it out for the first page. |
Filters are typed and explicit: status, list_id, tag, created_after, updated_after and so on, listed on each operation's page. There is no free-form query language.
Response#
{
"data": [ { "id": "lst_0123456789abcdefghjkmnpq", "name": "Main list" } ],
"next_cursor": "eyJ2IjoxfQ.example",
"has_more": true
}has_more is false and next_cursor is null on the last page. Always follow next_cursor; do not build your own.
curl 'https://api.seemly.com/v1/lists?limit=2' \
-H "Authorization: Bearer $SEEMLY_API_KEY"const response = await fetch("https://api.seemly.com/v1/lists?limit=2", {
headers: {
"Authorization": `Bearer ${process.env.SEEMLY_API_KEY}`,
},
});
const result = await response.json();
console.log(response.status, result);import os
import requests
response = requests.get(
"https://api.seemly.com/v1/lists?limit=2",
headers={
"Authorization": f"Bearer {os.environ['SEEMLY_API_KEY']}",
},
)
print(response.status_code, response.json())Rules for cursors#
- A cursor is opaque. Its text can change between releases, so store it only for the loop you are in.
- A cursor is signed and tied to your workspace and to the filters of the request that produced it. Using it with different filters, from another workspace, or after it was changed returns
validation_failedwith the fieldquery.cursor. Start again from the first page. - The same cursor returns the same page.
Order#
Each collection has one documented order. Most lists are newest first. list_events is newest first by default; pass order=asc, or after=<event id>, to read oldest first for a sync. Sorting by other fields is not offered.
Syncing changes#
To keep another system in step, read list_subscribers with updated_after set to the time of your last run, or poll list_events with after set to the last event you saw. Both are cheaper than reading everything again.
Smaller responses#
On any read, fields=id,name returns only those top-level fields (for a list, of every item in data). An unknown field name is a validation_failed, so a typo never returns an empty page quietly.
curl 'https://api.seemly.com/v1/lists?fields=id,name' \
-H "Authorization: Bearer $SEEMLY_API_KEY"const response = await fetch("https://api.seemly.com/v1/lists?fields=id,name", {
headers: {
"Authorization": `Bearer ${process.env.SEEMLY_API_KEY}`,
},
});
const result = await response.json();
console.log(response.status, result);import os
import requests
response = requests.get(
"https://api.seemly.com/v1/lists?fields=id,name",
headers={
"Authorization": f"Bearer {os.environ['SEEMLY_API_KEY']}",
},
)
print(response.status_code, response.json())