Your first request
Fetch the two newest events of an account:read_view that fixes the snapshot for the whole
walk. Trimmed to one record:
Routes
Required means the request needs
since_ledger or a cursor; without one
it returns 400. For example, asset activity from a recent ledger:
Query parameters
These return
400 invalid_request: a limit below 1 or not a number,
until_ledger without since_ledger, a since_ledger that is not below
until_ledger, and an unknown or repeated parameter.
A since_ledger beyond the newest published ledger is not an error: the page is
empty and complete. There is no maximum range width. Each page scans for at most
about 8 seconds, so a sparse range can return a short or empty page with
range_complete: false and a next link that resumes where the scan stopped.
Keep following next; see pagination.
Account filters
direction=inkeeps movements to the account.direction=outkeeps movements from it and the fees it paid.include_fees=falsedrops fee events.include_fees=trueis the default and filters nothing.
direction or include_fees=false, rows where the account is
only the emitting contract or the asset issuer are dropped too, so a filtered
walk is not a complete history. Omit both for the complete history.
Selectors
- Accounts: checksum-valid
G,M,C,BorLStrKeys. A baseGaddress includes payments to its muxed (M) addresses; anMaddress returns only the payments to that muxed ID. - Contracts: checksum-valid
CStrKeys. - Assets:
nativeorCODE:ISSUERwith a checksum-validGissuer. - Transactions: a 64-character hexadecimal hash.
token_transfer event (transfer, mint, burn,
clawback, fee) the account takes part in. A custom contract’s
contract_event is filed under the contract that emitted it; find the ones that
name an address with contract events by address.
Token classification explains which events count as token
movements.
Transactions
GET /transactions/{hash} returns the indexed header: ledger, time
(created_at), success, fee charged, operation count and memo. It has no
envelope, result or meta XDR. For the envelope, call RPC
getTransaction, which keeps about 7 days of history.
404 with code not_found on both transaction routes.
The lookup searched real history, so it costs the route’s minimum credit.
Credits
Testnet requests are free: they cost 0 credits and count toward your organization’s daily Testnet cap of 10,000 requests, which resets at 00:00 UTC. On Mainnet, a page costs its route weight for every started 100 records (an empty page counts as one block), or one credit per started 64 KiB of response if that is more. A 1000-record account page costs 10 credits; a 200-record feed page costs 20. Errors cost nothing, except the unknown-hash404 above. See
credits and rate limits.
Errors
All codes are in errors.
This API returns decoded events, not every Horizon
operation. Use RPC for current state, simulation and submission.