Skip to main content
The Assets API answers “what does this address hold?” and “who holds this token?”. Answers come from an index of Stellar ledger state, not from summed events, so every balance is the exact state after one ledger. Use it for wallet portfolios, holder lists, token pages and balance checks before a payment. Set these once in your terminal. The sample values are real Testnet data, so the read examples return real results.
Trimmed live response (Testnet):
Two blocks tell you how far to trust an answer:
  • read_view says which ledger the answer describes: you are reading the state after as_of_ledger.
  • completeness (holdings only) says whether every balance is verified and lists token contracts that were left out. See accuracy.

Networks

Use the same network-scoped key as Activity and RPC. Testnet requests are free: they cost 0 credits and count toward your organization’s daily Testnet cap of 10,000 requests (resets 00:00 UTC). Mainnet requests cost the credits below. Readiness shows how current each index is.

Endpoints and credits

Credits apply on Mainnet; on Testnet every route below costs 0. Example: on Mainnet a holders page of 100 records costs 5 credits, and a full page of 200 costs 10. The full formula is in limits and credits.

Identifiers

  • Asset IDs: native for XLM, CODE:ISSUER for classic assets (the same string Activity uses; case-sensitive, never padded), a C... contract ID for a custom SEP-41 token, and pool:<64 hex> for a liquidity pool share. A Stellar Asset Contract (SAC) ID is accepted as an alias of its classic asset.
  • Holders: G... accounts or C... contracts. An M... (muxed) address resolves to its G... account and the response echoes muxed_input.
  • Amounts: balance is a decimal string and balance_raw an exact integer string. Never parse them as floating-point numbers; use BigInt or Decimal.

Read view

as_of_ledger means the same as Activity read_view.snapshot_ledger. To follow changes without gaps, read holdings at ledger N, then Activity from since_ledger=N+1.

Requests and errors

  • Unknown or repeated query parameters return 400 invalid_request.
  • Pages use _embedded.records and _links.next.href with an opaque cursor. limit defaults to 50; larger values are lowered to 200.
  • Errors are {"error", "code", "request_id"}, with code from the shared error codes. Every 503 carries Retry-After.

Next