/v1/ledger/at
Resolve a datetime to the last ledger closed at or before it (binary search). Close times are rounded to 10 seconds, so a ledger often closes exactly on the time asked. For a day [start, end): its first ledger is the one returned for start when that closed exactly at start, else the next; its last is the one returned for end, or the one before it when that closed exactly at end
Request
https://api.xrpl.to/v1/ledger/at?time=2026-07-01| Query parameter | Value | Description |
|---|---|---|
| time | unix ms or ISO date (required) |
curl 'https://api.xrpl.to/v1/ledger/at?time=2026-07-01'
Response
{ ledger_index, close_time, clampedToHead?, clampedToGenesis? }
What it does
Resolve a datetime to the last ledger closed at or before it (binary search). Close times are rounded to 10 seconds, so a ledger often closes exactly on the time asked. For a day [start, end): its first ledger is the one returned for start when that closed exactly at start, else the next; its last is the one returned for end, or the one before it when that closed exactly at end