Pagination

List endpoints cap results per request. Most use opaque cursors; market discovery also supports classic page numbers.

Cursor pagination

Collection endpoints (series, events, orders, fills, positions, settlements, the trade tape) return a cursor field. Pass it back as the cursor query param to fetch the next page. A nullcursor means you've reached the end.

First page
curl "https://api.majjha.com/api/portfolio/orders?limit=20"
Response
{
  "cursor": "eyJpZCI6ICJvcmRfMDQyIn0",
  "orders": [ /* … up to 20 items … */ ]
}
Next page
curl "https://api.majjha.com/api/portfolio/orders?limit=20&cursor=eyJpZCI6ICJvcmRfMDQyIn0"

Opaque by design

Treat the cursor as a black box. Don't parse, modify, or persist it across schema changes — only round-trip it verbatim.

Page-based (markets)

GET /api/markets defaults to page-based pagination so you can jump around a catalogue. The response includes total, page, and totalPages.

Page 2
curl "https://api.majjha.com/api/markets?page=2&limit=20"

Passing cursor, event_ticker, or series_ticker switches the markets endpoint into cursor mode, returning a cursor instead of the page envelope.

Limits

The default page size is 20 and the maximum is 100. Requests above the maximum are clamped, not rejected.