| id | list-all-ledgers |
|---|---|
| title | List All Ledgers |
| description | This endpoint lists all ledgers and can be used in streaming mode. Streaming mode allows you to listen for new ledgers as they close. If called in streaming mode, Horizon will start at the earliest known ledger unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream ledgers since your request time. |
| sidebar_label | List All Ledgers |
| hide_title | true |
| hide_table_of_contents | true |
| api | eJztWv1uGzcSf5UB/2iTYCWtFEu2BBS9tE3b4II0uLj3xzmGwiVnJdZccktyJbuGgHuNe717ksNwd6WVLTtOLtfLfRgGBGk5w/n6DYcze80CX3g2O2MvUS7QeXaeMIleOFUGZQ2bsdOl8oBGllaZAFr54IFrDbomAG4kCG4gQ6g8SlAGfHDIC2UWUFiJfXiz952o7drDla0g2MgRDeTWgcH1jq2HsMQrENp67MOLHATX+hD/BH60Tv1mDayV1uADdwF4IHJA7rRCH+DC2LVpmENlNHoPHETlvHWgPHgMCbFeL5VYguAeQYUuw9zZAsKSh4aoD99cEVUgMWirhteK6wpJL2PXSdSRjFNLvFXOKyOQHjpw+GtFAgZVYJ8lzJboOJn+hWQz9lL58Ezr1jkJK7njBQb6Mju7ZoYXyGas3pslTJHHfq3QXbGEEWvlULJZzrXHm459BqYqMnS1VtG9ngTn4EsUKlcCtBVRFrIMB2G1RhG/2xwc+tIaj3UEKA9lFf3TGAqh5AtlFvNgL9A0ZrE5cHAorJOkqxdLLDibXbNwVZIeygRcICmCl7woNbLZZJJOJsPjo+OT6Xg6TMebTbJV2zqJH661RK8Whrd6kKiR0c79tYQe/NJWWgIvS+SuDz9FHh6UEbqSCO+4F+/gEfcCjVRm8Risg3e03Tt4RB/NzzF6A8GIu0VVoAmgvPn7X/8WmrALIDHnla7tH9keNI8PTpkFWcdUBYGWe8FqBdl51zBaFSp8oGFOlwgFv1RFVbSBEb1cm8JhqJxB2QdaF/nHwHbcLLD2+ZCEH6Up9IAbqMoSXbMwBpjysOROCitrELegJeCX6HLrCk6ocMi9Nf4eo7UORHnLdsP0oXE1TDeb84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tmGFPoOIawteKSxZSDwGIHONElForBVqRv7FJSGVUH1FDchBlhmoxm14pnShDii6oRXfy/0CV0FN3yBHhQF19okUHKHsidp+NuGl833VbVlUEVMerRnQ0lJjVKezcEgSg+P1vil1tBBlopDag5v2be8jMcBsXvLtrajEImXJ1f4n/I36FZKYKcY63o2LurZPB5lKra3aKTERSyZm7FeK3Y3oL8n6EXns+RGsbdf2mHBVXyKWts/dJ9tEqaVQOOxs9ezkoslwqhPdwMlKXZzhW77pFc/2e3YpBMen0adGqZ+8PLFt89fvXlOJP1lKHTssJfWh4KbzpbUwoJnWsNu3L1XNVzvpmz/fyvh930roenYBrwMg1JzFYcR0ffXzY3mjOndGyRL6wP9dH1NCflnpzcb+rmeRNM9RyrPM33XLLrr6H//WwoHda9vgNv3Lpo7H4tXrg9R7j/mZYR7rNC+hvGRRvgvevHgHiO1r2TsjHROX5wiK7HZ2fl2StLpMDwTAssu1a13C/Y6DD88P2WbzT8Ap74wZQ== |
| sidebar_class_name | get api-method |
| info_path | docs/data/apis/horizon/api-reference/horizon |
| custom_edit_url |
import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; import ParamsDetails from "@theme/ParamsDetails"; import RequestSchema from "@theme/RequestSchema"; import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; import Heading from "@theme/Heading";
<Heading as={"h1"} className={"openapi__heading"} children={"List All Ledgers"}
<MethodEndpoint method={"get"} path={"/ledgers"} context={"endpoint"}
This endpoint lists all ledgers and can be used in streaming mode. Streaming mode allows you to listen for new ledgers as they close. If called in streaming mode, Horizon will start at the earliest known ledger unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream ledgers since your request time.
<Heading id={"request"} as={"h2"} className={"openapi-tabs__heading"} children={"Request"}
<ParamsDetails
parameters={[{"name":"cursor","in":"query","required":false,"description":"A number that points to a specific location in a collection of responses and is pulled from the paging_token value of a record.","schema":{"type":"integer","example":6606617478959105}},{"name":"order","in":"query","required":false,"description":"A designation of the order in which records should appear. Options include asc (ascending) or desc (descending). If this argument isn’t set, it defaults to asc.","schema":{"type":"string","enum":["asc","desc"]}},{"name":"limit","in":"query","required":false,"description":"The maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10.","schema":{"type":"integer","example":10}}]}
<RequestSchema title={"Body"} body={undefined}
<StatusCodes id={undefined} label={undefined} responses={{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"_embedded":{"type":"object","properties":{"records":{"type":"array","items":{"type":"object","properties":{"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"transactions":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"operations":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"payments":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"},"effects":{"type":"object","properties":{"href":{"type":"string","format":"link"},"templated":{"type":"boolean"}},"required":["href"],"title":"link"}},"required":["self","transactions","operations","effects"]},"id":{"type":"string","title":"id"},"paging_token":{"type":"string","title":"paging_token"},"hash":{"type":"string","title":"hash"},"pre_hash":{"type":"string","title":"hash"},"sequence":{"type":"integer","format":"int32"},"successful_transaction_count":{"type":"integer","format":"int32"},"failed_transaction_count":{"type":"integer","format":"int32"},"operation_count":{"type":"integer","format":"int32"},"tx_set_operation_count":{"type":"integer","format":"int32"},"closed_at":{"type":"string"},"total_coins":{"type":"string"},"fee_pool":{"type":"string"},"base_fee_in_stroops":{"type":"integer","format":"int32"},"base_reserve_in_stroops":{"type":"integer","format":"int32"},"max_tx_set_size":{"type":"integer","format":"int32"},"protocol_version":{"type":"integer","format":"int32"},"header_xdr":{"type":"string"}}}}},"required":["id","paging_token","hash","sequence","successful_transaction_count","failed_transaction_count","operation_count","tx_set_operation_count","closed_at","total_coins","fee_pool","base_fee_in_stroops","base_reserve_in_stroops","max_tx_set_size","protocol_version","header_xdr"]}},"title":"Ledger"},"examples":{"ListAllLedgers":{"value":{"_embedded":{"records":[{"_links":{"effects":{"href":"/ledgers/1/effects/{?cursor,limit,order}","templated":true},"operations":{"href":"/ledgers/1/operations/{?cursor,limit,order}","templated":true},"self":{"href":"/ledgers/1"},"transactions":{"href":"/ledgers/1/transactions/{?cursor,limit,order}","templated":true}},"id":"e8e10918f9c000c73119abe54cf089f59f9015cc93c49ccf00b5e8b9afb6e6b1","paging_token":"4294967296","hash":"e8e10918f9c000c73119abe54cf089f59f9015cc93c49ccf00b5e8b9afb6e6b1","sequence":1,"transaction_count":0,"successful_transaction_count":0,"failed_transaction_count":0,"operation_count":0,"tx_set_operation_count":0,"closed_at":"1970-01-01T00:00:00Z","total_coins":"100000000000.0000000","fee_pool":"0.0000000","base_fee_in_stroops":100,"base_reserve_in_stroops":100000000,"max_tx_set_size":50},{"_links":{"effects":{"href":"/ledgers/2/effects/{?cursor,limit,order}","templated":true},"operations":{"href":"/ledgers/2/operations/{?cursor,limit,order}","templated":true},"self":{"href":"/ledgers/2"},"transactions":{"href":"/ledgers/2/transactions/{?cursor,limit,order}","templated":true}},"id":"e12e5809ab8c59d8256e691cb48a024dd43960bc15902d9661cd627962b2bc71","paging_token":"8589934592","hash":"e12e5809ab8c59d8256e691cb48a024dd43960bc15902d9661cd627962b2bc71","prev_hash":"e8e10918f9c000c73119abe54cf089f59f9015cc93c49ccf00b5e8b9afb6e6b1","sequence":2,"transaction_count":0,"successful_transaction_count":0,"failed_transaction_count":0,"operation_count":0,"closed_at":"2015-07-16T23:49:00Z","total_coins":"100000000000.0000000","fee_pool":"0.0000000","base_fee_in_stroops":100,"base_reserve_in_stroops":100000000,"max_tx_set_size":100}]},"_links":{"next":{"href":"/ledgers?order=asc&limit=2&cursor=8589934592"},"prev":{"href":"/ledgers?order=desc&limit=2&cursor=4294967296"},"self":{"href":"/ledgers?order=asc&limit=2&cursor="}}}}}}}}}}