Stellar

Stellar Horizon API

Horizon provides an HTTP API to data in the Stellar network. It ingests and re-serves the data produced by the Stellar network in a form that is easier to…

Finance & banking#openapi

Fork copies the collection into your workspace, without the publisher's secrets, so you can add your own key and send requests. Star saves it to your starred APIs (Account › Marketplace) and helps others find it.

Overview

Horizon provides an HTTP API to data in the Stellar network. It ingests and re-serves the data produced by the Stellar network in a form that is easier to consume by the average application relative to the performance-oriented data representations used by Stellar Core. This API serves the bridge between apps and Stellar Core. Projects like wallets, decentralized exchanges, and asset issuers use Horizon to submit transactions, query an account balance, or stream events like transactions to an account.

Horizon can be accessed via cURL, a browser, or one of the Stellar SDKs. To reduce the complexity of your project, we recommend you use an SDK instead of making direct API calls.

This guide describes how to administer a production Horizon instance (refer to the Developers' Blog for some background on the performance and architectural improvements of this major version bump). For information about developing on the Horizon codebase, check out the Development Guide.

Before we begin, it's worth reiterating the sentiment echoed in the Core Node documentation: we do not endorse running Horizon backed by a standalone Stellar Core instance, and especially not by a _validating_ Stellar Core. These are two separate concerns, and decoupling them is important for both reliability and performance. Horizon instead manages its own, pared-down version of Stellar Core optimized for its own subset of needs (we'll refer to this as a "Captive Core" instance).

Endpoints 47

Accounts

  • GETList all Accounts/accountsThis endpoint lists accounts by one of four filters : signer, asset, liquidity pool or sponsor.
  • GETRetrieve an Account/accounts/:account_idThe single account endpoint provides information on a specific account. The balances section in the response will also list all the trustlines this account…
  • GETRetrieve an Account's Transactions/accounts/:account_id/transactionsThis endpoint represents successful transactions for a given account and can be used in streaming mode. Streaming mode allows you to listen for new…
  • GETRetrieve an Account's Operations/accounts/:account_id/operationsThis endpoint represents successful operations for a given account and can be used in streaming mode. Streaming mode allows you to listen for new operations…
  • GETRetrieve an Account's Payments/accounts/:account_id/paymentsThis endpoint represents successful payments for a given account and can be used in streaming mode. Streaming mode allows you to listen for new payments for…
  • GETRetrieve an Account's Effects/accounts/:account_id/effectsThis endpoint returns the effects of a specific account and can be used in streaming mode. Streaming mode allows you to listen for new effects for this…
  • GETRetrieve an Account's Offers/accounts/:account_id/offersThis endpoint represents all offers a given account has currently open and can be used in streaming mode. Streaming mode allows you to listen for new offers…
  • GETRetrieve an Account's Trades/accounts/:account_id/tradesThis endpoint represents all trades for a given account and can be used in streaming mode. Streaming mode allows you to listen for trades for this account as…
  • GETRetrieve an Account's Data/accounts/:account_id/data/:keyThis endpoint represents a single data for a given account.

Assets

  • GETList all Assets/assetsThis endpoint lists all assets.

Claimable Balances

  • GETList All Claimable Balances/claimable_balancesThis endpoint lists all available claimable balances.
  • GETRetrieve a Claimable Balance/claimable_balances/:claimable_balance_idThe single claimable balance endpoint provides information on a claimable balance.
  • GETRetrieve Related Transactions/claimable_balances/:claimable_balance_id/transactionsThis endpoint represents successful transactions referencing a given claimable balance and can be used in streaming mode. Streaming mode allows you to listen…
  • GETRetrieve Related Operations/claimable_balances/:claimable_balance_id/operationsThis endpoint represents successful operations referencing a given claimable balance and can be used in streaming mode. Streaming mode allows you to listen…

Effects

  • GETList All Effects/effectsThis endpoint lists all effects and can be used in streaming mode. Streaming mode allows you to listen for new effects as they are added to the Stellar…

Fee Stats

  • GETRetrieve Fee Stats/fee_statsThe fee stats endpoint provides information about per-operation fee stats over the last 5 ledgers.

Liquidity Pools

  • GETList Liquidity Pools/liquidity_poolsThis endpoint lists all available liquidity pools.
  • GETRetrieve a Liquidity Pool/liquidity_pools/:liquidity_pool_idThe single liquidity pool endpoint provides information on a liquidity pool.
  • GETRetrieve Related Effects/liquidity_pools/:liquidity_pool_id/effectsThis endpoint represents effects referencing a given liquidity pool and can be used in streaming mode. Streaming mode allows you to listen for new effects…
  • GETRetrieve Related Trades/liquidity_pools/:liquidity_pool_id/tradesThis endpoint represents successful trades fulfilled by the given liquidity pool and can be used in streaming mode. Streaming mode allows you to listen for…
  • GETRetrieve Related Transactions/liquidity_pools/:liquidity_pool_id/transactionsThis endpoint represents successful transactions referencing a given liquidity pool and can be used in streaming mode. Streaming mode allows you to listen for…
  • GETRetrieve Related Operations/liquidity_pools/:liquidity_pool_id/operationsThis endpoint represents successful operations referencing a given liquidity pool and can be used in streaming mode. Streaming mode allows you to listen for…

Ledgers

  • GETRetrieve a Ledger/ledgers/:sequenceThe single ledger endpoint provides information on a specific ledger.
  • GETRetrieve a Ledger's Transactions/ledgers/:sequence/transactionsThis endpoint represents successful transactions in a given ledger.
  • GETRetrieve a Ledger's Payments/ledgers/:sequence/paymentsThis endpoint returns all payment-related operations in a specific ledger. Operation types that can be returned by this endpoint include: create_account,…
  • GETRetrieve a Ledger's Operations/ledgers/:sequence/operationsThis endpoint returns successful operations in a specific ledger.
  • GETRetrieve a Ledgers's Effects/ledgers/:sequence/effectsThis endpoint returns the effects of a specific ledger.
  • GETList All Ledgers/ledgersThis 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…

Offers

  • GETList All Offers/offersThis endpoint lists all currently open offers and can be used in streaming mode. Streaming mode allows you to listen for new offers as they are added to the…
  • GETRetrieve an Offer/offers/:offer_idThe single offer endpoint provides information on a specific offer.
  • GETRetrieve an Offer's Trades/offers/:offer_id/tradesThis endpoint represents all trades for a given offer and can be used in streaming mode. Streaming mode allows you to listen for trades for this offer as they…

Operations

  • GETRetrieve an Operation/operations/:idThe single operation endpoint provides information about a specific operation.
  • GETRetrieve an Operation's Effects/operations/:id/effectsThis endpoint returns the effects of a specific operation.
  • GETList All Operations/operationsThis endpoint lists all Successful operations and can be used in streaming mode. Streaming mode allows you to listen for new operations as they are added to…

Order Books

  • GETRetrieve an Order Book/order_book?selling_asset_type=nativeThe order book endpoint provides an order book's bids and asks and can be used in streaming mode. When filtering for a specific order book, you must use use…

Paths

  • GETList Strict Receive Payment Paths/paths/strict-receive?destination_asset_type=native&destination_amount=5The strict receive payment path endpoint lists the paths a payment can take based on the amount of an asset you want the recipient to receive. The destination…
  • GETList Strict Send Payment Paths/paths/strict-send?source_asset_type=native&source_amount=5The strict send payment path endpoint lists the paths a payment can take based on the amount of an asset you want to send. The source asset amount stays…

Payments

  • GETList All Payments/paymentsThis endpoint lists all Successful payment-related operations and can be used in streaming mode. Streaming mode allows you to listen for new payments as they…
  • GETRetrieve a Transaction's Payments/transactions/:transaction_hash/paymentsThis endpoint returns the payments of a specific transaction.

Trade Aggregations

  • GETList Trade Aggregations/trade_aggregations?base_asset_type=native&counter_asset_type=nativeThis endpoint displays trade data based on filters set in the arguments. This is done by dividing a given time range into segments and aggregating statistics,…

Trades

  • GETList All Trades/tradesThis endpoint lists all trades and can be used in streaming mode. Streaming mode allows you to listen for new trades as they are added to the Stellar ledger.…

Transactions

  • GETRetrieve a Transaction/transactions/:transaction_hashThe single transaction endpoint provides information on a specific transaction.
  • GETRetrieve a Transaction's Operations/transactions/:transaction_hash/operationsThis endpoint returns Successful operations for a specific transaction.
  • GETRetrieve a Transaction's Effects/transactions/:transaction_hash/effectsThis endpoint returns the effects of a specific transaction.
  • GETList All Transactions/transactionsThis endpoint lists all Successful transactions and can be used in streaming mode. Streaming mode allows you to listen for new transactions as they are added…
  • POSTSubmit a Transaction/transactions?tx=stringThis endpoint actually submits a transaction to the Stellar network. It only takes a single, required parameter: the signed transaction. Refer to the…
  • POSTSubmit a Transaction Asynchronously/transactions_async?tx=stringThis endpoint submits transactions to the Stellar network asynchronously. It is designed to allow users to submit transactions without blocking them while…

API details

Base URL
https://horizon-testnet.stellar.org
https://horizon-futurenet.stellar.org
Authentication
None declared in the description
Operations
47 operations on 46 pathsGET 45POST 2
Main resources
Accounts 9Ledgers 6Liquidity Pools 6Transactions 6Claimable Balances 4Offers 3Operations 3Paths 2Payments 2Assets 1
Response formats
application/json
Description format
OpenAPI 3.1.0, API version 0.0.1

How to test the Stellar Horizon API in Swastik Codes

  1. Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
  2. Fork it into your workspaceChoose a workspace. You get your own copy of the Stellar Horizon API collection, without the publisher's secrets.
  3. Add your credentialsOpen the collection's variables or an environment and enter your API key or token, if the API needs one.
  4. Send a requestPick an endpoint, for example “List all Accounts” (GET /accounts), and press Send. Check the response, add tests and run the whole collection with the runner.

Frequently asked questions

What is the Stellar Horizon API?

Horizon provides an HTTP API to data in the Stellar network. It ingests and re-serves the data produced by the Stellar network in a form that is easier to… It is listed under Finance & banking and has 47 endpoints.

Who publishes the Stellar Horizon API?

It is listed from Stellar's public API description (an OpenAPI document), not published by Stellar on Swastik Codes. Anyone who controls stellar.org can claim the profile by adding a DNS TXT record.

What is the base URL of the Stellar Horizon API?

Its description lists 2 base URLs: https://horizon-testnet.stellar.org, https://horizon-futurenet.stellar.org. The first is the usual one; the others are typically sandbox or regional servers.

How do I authenticate with the Stellar Horizon API?

Its OpenAPI description does not declare an authentication scheme. Some endpoints may be open; check the provider's documentation before relying on that.

How many endpoints does the Stellar Horizon API have?

47 operations on 46 paths (45 GET, 2 POST). The largest groups are Accounts, Ledgers, Liquidity Pools, Transactions.

Is forking the Stellar Horizon API free?

Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.

Suggest an API

Tell us which public API is missing. We check it, then add it here with its endpoints when it has an OpenAPI (Swagger) description.