Why a Stellar Horizon page has no records
Last updated:
At a glance
| Property | Value |
|---|---|
| Empty page | HTTP 200 with _embedded.records = [] — nothing follows the cursor in this order |
| order | asc or desc; defaults to asc (oldest first) |
| limit | 1 to 200; defaults to 10 |
| cursor | A record's paging_token; _links.next carries the next one |
What you see
You request an account's payments or operations from Horizon and get HTTP 200 with "_embedded": { "records": [] }, or you get fewer records than the account obviously has — only ten, or only the oldest ones. No error is returned.
Why this happens
Horizon pages through collections with three query parameters. cursor is a position in the collection taken from the paging_token of a record; the response lists records after that position. order is asc or desc and defaults to asc, so a request without order starts from the oldest record, not the newest. limit is the page size, from 1 to 200, defaulting to 10. Responses are HAL JSON: records sit under _embedded and navigation links, including the next page, under _links. A page with no records therefore means that nothing follows the cursor in the chosen order: you have walked past the last record, a stored cursor is being reused in the opposite order direction, or the account genuinely has no records of that type. None of these is an error.
What to do
- Set order explicitly: desc for "latest first", asc to read history from the beginning.
- Set limit explicitly (up to 200) instead of relying on the default of 10.
- Page by following _links.next, or by passing the paging_token of the last record you processed as cursor — never build cursors from ledger numbers or timestamps.
- Read an empty records array as "nothing after this cursor in this order"; if you expected more, repeat the first request without a cursor to check the direction.
- If even the first page is empty, check that the account ID (the G… address) and the network (public vs testnet) are the ones you meant.
When this is not our problem
Cursor paging is Horizon's own API contract, the same on every Horizon server whoever operates it — Triport included. An empty page means nothing follows the cursor in the order you asked for, not a missing-data incident.
FAQ
- Why does Horizon only return 10 payments?
- limit defaults to 10. Pass limit up to 200 and keep following _links.next for more.
- How do I get the most recent operations first from Horizon?
- Pass order=desc. Without it Horizon uses asc and starts from the oldest record.