For AI agents: a documentation index is available at /llms.txt. A markdown version of this page is available at the same URL with .md appended (or via Accept: text/markdown).
Skip to main content

getLedgerEntries

Returns the current value of one or more ledger entries. This method uses 160 credits from your daily balance.

Use this method to read accounts, trustlines, offers, claimable balances, liquidity pools, and contract data or code. Each key is a base64-encoded LedgerKey.

Parameters​

  • keys: (array) [required] - Ledger keys to retrieve, as base64-encoded strings. The maximum is 200 keys.
  • xdrFormat: (string) [optional] - Format for XDR fields in the response. base64 is the default. json returns unpacked JSON. Do not rely on a stable schema for the JSON form, because it changes when the underlying XDR changes.

Returns​

result: (object) - Matching ledger entries.

  • latestLedger: (integer) - Sequence number of the latest ledger known to the node when it handled the request.
  • entries: (array) - Ledger entries that were found. Each entry contains:
    • key: (string) - Base64-encoded LedgerKey for the entry.
    • xdr: (string) - Base64-encoded LedgerEntryData value.
    • lastModifiedLedgerSeq: (integer) - Sequence number of the ledger that last updated the entry.
    • extXdr: (string) - Base64-encoded extension for the entry.
    • liveUntilLedgerSeq: (integer) [optional] - Ledger sequence until which the entry stays live. May be 0 when the entry is no longer live.

Request​

curl https://stellar-mainnet.infura.io/v3/<YOUR-API-KEY> \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "getLedgerEntries", "params": {"keys": ["AAAAAAAAAAA7mRE4Dv6Yi6CokA6xz+RPNm99vpRr7QdyQPf2JN8VxQ=="]}}'

Response​

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"entries": [
{
"key": "AAAAAAAAAAA7mRE4Dv6Yi6CokA6xz+RPNm99vpRr7QdyQPf2JN8VxQ==",
"xdr": "AAAAAAAAAAA7mRE4Dv6Yi6CokA6xz+RPNm99vpRr7QdyQPf2JN8VxQAAADz09GKDAgDqmAAAAA0AAAAGAAAAAAAAAAIAAAAKY2lyY2xlLmNvbQAAAAICAgAAAAQAAAAAKKK7TUYIV3/7UnKlvk/DYeZ9DXkAiCEiQf5CVfpUqwsAAAABAAAAAC5Yu4w/iyCljSCrlPo7zcDUfEUTKt59A2xgM6EbT083AAAAAQAAAAB/vD2X7Hvv7NvpzgvijYy5HkMkocUZ7dQDJH02jPKnxgAAAAEAAAAAvAafI2CeqnehpBCVI3V2CMJMv888e8Iia5sLvJeBxVQAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAA7bTkAAAAABp753d",
"lastModifiedLedgerSeq": 64922391,
"extXdr": "AAAAAA=="
}
],
"latestLedger": 64923230
}
}