MarketBotsLab

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]. Default 50.
  • offset — offset-style pagination. Default 0.
  • cursor — opaque cursor from a prior pagination.nextCursor. Malformed cursors are silently treated as "first page".
  • order — asc | desc. Default desc.

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/breakouts
  • GET /api/breakouts/history
  • GET /api/breakouts/notifications
  • GET /api/notifications
  • GET /api/watchlists
  • GET /api/alerts/v2
  • GET /api/journal/entries
  • GET /api/filings/[symbol]
  • GET /api/social/[symbol]
  • GET /api/community/feed
  • GET /api/earnings
  • GET /api/insider
  • GET /api/short-interest
  • GET /api/exports
  • GET /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>'

See also