Pagination
List endpoints return results a page at a time using cursors. Cursors stay stable while items are added, so you never see the same item twice or skip one because the list changed between requests.
The list object
{
"object": "list",
"data": [
{
"object": "keyword",
"id": "cm8kw0001",
"phrase": "espresso grind size",
…
}
],
"hasMore": true,
"nextCursor": "cm8kw0001"
}| Field | Description |
|---|---|
data | The items on this page, in the endpoint's documented order. |
hasMore | true when another page exists. |
nextCursor | Pass it as cursor to get the next page; null on the last page. |
Parameters
| Query parameter | Description |
|---|---|
limit | Items per page, 1–100. Default 25. |
cursor | The nextCursor of the previous page. Omit it for the first page. |
Filters (for example status or search) must stay the same while you page through results.
Second page
curl https://semanticson.com/api/v1/projects/PROJECT_ID/keywords?limit=100&cursor=NEXT_CURSOR \
-H "Authorization: Bearer $SEMANTICSON_API_KEY"Treat cursors as opaque strings. They are valid as long as the item they point to exists; if it was deleted, start again from the first page.
Fetching every page
async function listAll(path) {
const items = [];
let cursor = null;
do {
const url = new URL(`https://semanticson.com/api/v1${path}`);
url.searchParams.set("limit", "100");
if (cursor) url.searchParams.set("cursor", cursor);
const res = await fetch(url, { headers: { Authorization: `Bearer ${process.env.SEMANTICSON_API_KEY}` } });
const page = await res.json();
if (!res.ok) throw new Error(`${page.error.code}: ${page.error.message}`);
items.push(...page.data);
cursor = page.hasMore ? page.nextCursor : null;
} while (cursor);
return items;
}
const keywords = await listAll("/projects/PROJECT_ID/keywords");A few lists are short by nature and return everything at once with hasMore: false (for example GET /tools and audit schedules). The same loop handles them.
Paginated endpoints
| Endpoint | Summary |
|---|---|
| GET /projects | List projects |
| GET /projects/{projectId}/topical-maps | List topical maps |
| GET /projects/{projectId}/keywords | List keywords |
| GET /projects/{projectId}/clusters | List keyword clusters |
| GET /projects/{projectId}/briefs | List content briefs |
| GET /projects/{projectId}/documents | List documents |
| GET /documents/{documentId}/versions | List saved versions |
| GET /projects/{projectId}/entities | List entities |
| GET /executions | List tool runs |
| GET /projects/{projectId}/audits | List audits for a project |
| GET /audits/{auditId}/issues | List issues in an audit |
| GET /projects/{projectId}/reports | List reports |
| GET /sites | List connected sites |
| GET /sites/{siteId}/pages | List synced pages |
| GET /sites/{siteId}/redirects | List synced redirects |
| GET /sites/{siteId}/terms | List synced categories, tags and other terms |
| GET /sites/{siteId}/media | List synced media |
| GET /sites/{siteId}/changes | List changes for a site |
| GET /webhooks/{webhookId}/deliveries | List deliveries |