API Reference
update Changelog

Pagination

List endpoints use cursor-based pagination. Request a page, then pass the next_cursor you received back as the starting_after query parameter.

The names differ: the response field is next_cursor, but the query parameter is starting_after. There is no cursor query parameter; sending ?cursor=... fails with a 400 because unknown query parameters are rejected.

Request parameters

ParameterTypeDefaultDescription
limitinteger25Items per page, 1 to 100
starting_afterstringnoneReturn items after this ID. Pass the next_cursor from the previous response. Omit it to get the first page

Response fields

FieldTypeDescription
dataarrayThe items in this page
has_morebooleantrue if more items exist after this page
next_cursorstringPass this as starting_after to get the next page. Only present when has_more is true

Fetching every page

Keep requesting pages until has_more is false.

let startingAfter;
const all = [];
do {
  const url = new URL('https://api.araucaria.money/v1/accounts/acc_xxx/transactions');
  url.searchParams.set('limit', '100');
  if (startingAfter) url.searchParams.set('starting_after', startingAfter);

  const res = await fetch(url, { headers: { Authorization: 'Bearer sk_live_xxx' } });
  const { data, has_more, next_cursor } = await res.json();

  all.push(...data);
  startingAfter = has_more ? next_cursor : undefined;
} while (startingAfter);