Pagination

Retrieve complete datasets with cursor pagination.

Follow the cursor

Paginated endpoints accept limit (usually default 100, maximum 500; movers 1 to 50, default 20; tickers up to 1,000) and cursor. Copy meta.next_cursor into the next request while retaining every other parameter exactly. A null cursor ends the results.

JavaScript · server-side
let cursor;
do {
  const url = new URL("https://api.ohlc.io/v1/eod");
  url.searchParams.set("symbols", "XNAS:AAPL");
  url.searchParams.set("limit", "100");
  if (cursor) url.searchParams.set("cursor", cursor);
  const response = await fetch(url, { headers: {
    Authorization: `Bearer ${process.env.OHLC_API_KEY}`
  } });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  const { data, meta } = await response.json();
  for (const row of data) console.log(row);
  cursor = meta.next_cursor;
} while (cursor);

Expiry and batches

Cursors expire after one hour and are bound to the query and entitlement. Security-data cursors pin the snapshot and knowledge cutoff. Metadata cursors retain their query and last ID but do not pin a snapshot. Research cursors carry the first page's expiry forward, so a research walk must finish within an hour of its first page. An invalid or expired cursor returns 422.

symbols is a comma-separated MIC:TICKER list; a bare ticker such as AAPL resolves to the exchange listing that ticker. Batch size follows the effective plan. Batching and pagination are independent. Quotes returns the latest eligible observation per symbol. Health and exports do not accept pagination.