Developers
Public API pagination
Read a Costfluent Public API list one page at a time with page and limit, and follow its links to the next page.
Every list operation answers with the same envelope: the page's items in data, and links to the neighbouring pages in links. Cost data adds what the whole query covers in meta.
Read a list page by page
- Request the first page with
page=1and thelimityou want. - Process
data. - When
links.nextis set, request that link; it keeps every filter of the first request. When it isnull, that was the last page.
Code
Code
Page size
| Operation | limit | Default |
|---|---|---|
| Every list, such as budgets, cost reports or integrations | 1 to 100; a larger or smaller value is held to that range | 20 |
Cost data, GET /v1/costs | 1 to 5,000; a larger value is refused with 400 | 20 |
Reading cost data in bulk
Cost data is the one bulk read: ask for limit=5000 to read a window in as few requests as possible. Paging reaches 100,000 rows, page × limit; a request past that is refused with 400, and its error says to split the date window. Read a large window as several shorter startDate to endDate ranges, each from page 1.
meta.totalRecords counts every row the query matches, so meta.totalRecords divided by limit tells you how many pages to expect before you start.
How it behaves
pagestarts at 1. A page past the end answers200with an emptydata.links.lastisnullwhen the total is not known.