Pagination
Every MarketBotsLab list endpoint returns the same { items, pagination } envelope. Callers can page by opaque cursor (preferred) or by offset.
Parameters
limit— page size. Server clamps to[1, 200]. Default50.offset— offset-style pagination. Default0.cursor— opaque cursor from a priorpagination.nextCursor. Malformed cursors are silently treated as "first page".order—asc|desc. Defaultdesc.
Response envelope
{
"items": [ /* list rows */ ],
"pagination": {
"nextCursor": "ZDA0...", // pass back as ?cursor=
"hasMore": true,
"total": 1523, // optional — omitted on some endpoints
"limit": 25,
"offset": 0,
"order": "desc"
}
}Migrated endpoints
GET /api/breakoutsGET /api/breakouts/historyGET /api/breakouts/notificationsGET /api/notificationsGET /api/watchlistsGET /api/alerts/v2GET /api/journal/entriesGET /api/filings/[symbol]GET /api/social/[symbol]GET /api/community/feedGET /api/earningsGET /api/insiderGET /api/short-interestGET /api/exportsGET /api/sector-rotation/v2
Each endpoint keeps its legacy response keys for backwards compatibility; the new items + pagination keys are additive.
Examples
1. First page (default limit)
Omit cursor and offset. Default limit is 50. `order=desc` (newest first) is the default.
curl -s 'https://stock-insights.example.com/api/breakouts?limit=25'
2. Follow nextCursor for page 2
Take `pagination.nextCursor` from the previous response and pass it as `cursor`. The server echoes `pagination.limit` and `pagination.order` back so you can keep rendering consistently.
curl -s 'https://stock-insights.example.com/api/breakouts?limit=25&cursor=ZDA0MC57InYiOjEsInMiOjE3MTIzNDUsImkiOiJicm8tMTIifQ'
3. Offset-style (lightweight, no cursor)
For callers that don't want to track a cursor, `offset` + `limit` also works. Mixing `cursor` and `offset` in the same request is allowed; when both are supplied, `cursor` wins.
curl -s 'https://stock-insights.example.com/api/notifications?limit=50&offset=100'
4. Ascending order
Flip to oldest-first by passing `order=asc`. The cursor envelope encodes sort direction, so you can't accidentally mix forward/backward pages.
curl -s 'https://stock-insights.example.com/api/journal/entries?order=asc&limit=20'
5. Detect end-of-stream
When `pagination.hasMore` is `false` and `pagination.nextCursor` is `null`, stop paging. The server never returns a cursor that would produce an empty page.
curl -s 'https://stock-insights.example.com/api/community/feed?cursor=<last>'