Skip to main content
List endpoints return results in pages. Yoshi uses cursor-based pagination — each response includes an opaque cursor that points to the next page.

How it works

Send a request with an optional limit to control page size:
curl "https://api.yoshi.ai/transactions?limit=50" \
  -H "Authorization: Bearer yoshi_YOUR_KEY"
The response includes pagination fields alongside data:
{
  "data": [...],
  "has_more": true,
  "cursor": "eyJpZCI6InR4bl8xMjM0NTYifQ==",
  "count": 50,
  "meta": { ... }
}
FieldDescription
has_moretrue if more pages exist
cursorOpaque string to pass as ?cursor= on the next request. null on the last page.
countNumber of items in this page
To get the next page, pass the cursor from the previous response:
curl "https://api.yoshi.ai/transactions?limit=50&cursor=eyJpZCI6InR4bl8xMjM0NTYifQ==" \
  -H "Authorization: Bearer yoshi_YOUR_KEY"

Iterate all pages

import Yoshi from "@yoshi-ai/sdk";

const yoshi = new Yoshi();

// Auto-pagination with the SDK
const allTransactions = [];
for await (const tx of yoshi.transactions.list({ limit: 100 })) {
  allTransactions.push(tx);
}

console.log(`Fetched ${allTransactions.length} transactions`);
The SDKs handle pagination automatically with async iterators. Use manual pagination only if you’re calling the API directly.

Parameters

ParameterTypeDefaultDescription
limitinteger50Items per page (1–100)
cursorstringCursor from the previous page

Common pitfalls

Don’t parse the cursor. It’s an opaque string — its format may change without notice. Don’t store cursors long-term. Cursors are designed for sequential traversal within a single session. They may become invalid over time. Don’t assume stable ordering across pages. If new items are added while you’re paginating, you may see them on a later page or miss them. For transactions, new items typically appear at the beginning of the list. Handle invalid cursors. If a cursor is expired or malformed, the API returns a 400 error:
{
  "error": {
    "type": "https://api.yoshi.ai/errors/validation-error",
    "code": "VALIDATION_ERROR",
    "message": "Invalid or expired cursor",
    "param": "cursor"
  }
}
When this happens, restart pagination from the beginning (without a cursor).

Which endpoints support pagination

EndpointPaginated
GET /transactionsYes
GET /paper-trading/accounts/{id}/tradesYes
GET /actionsYes
GET /accountsNo (returns all accounts)
GET /recurringNo (returns all streams)
GET /investmentsNo (returns all holdings)
Last modified on April 17, 2026