Skip to main content
The Activity API returns the decoded history of any Stellar account, asset, contract or transaction as JSON events: token movements, fees and Soroban contract events. History is complete from the first ledger, so you can query any address without registering it first. Set these once in your terminal. The sample values are real Testnet data, so the read examples return real results.

Your first request

Fetch the two newest events of an account:
The response is one page: the records, the page size used, links to the next and previous pages, and a read_view that fixes the snapshot for the whole walk. Trimmed to one record:
Events describes the record fields and pagination describes the page fields.

Routes

Required means the request needs since_ledger or a cursor; without one it returns 400. For example, asset activity from a recent ledger:
The account route has no asset or event-type filter. Filter those fields in your code, or use the asset route.

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=in keeps movements to the account. direction=out keeps movements from it and the fees it paid.
  • include_fees=false drops fee events. include_fees=true is the default and filters nothing.
When you send 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, B or L StrKeys. A base G address includes payments to its muxed (M) addresses; an M address returns only the payments to that muxed ID.
  • Contracts: checksum-valid C StrKeys.
  • Assets: native or CODE:ISSUER with a checksum-valid G issuer.
  • Transactions: a 64-character hexadecimal hash.
Account activity holds every 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.
An unknown hash returns 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-hash 404 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.