> ## Documentation Index
> Fetch the complete documentation index at: https://developers.stellar.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Horizon Endpoints

> Horizon is nearing end-of-life and will eventually be deprecated in favor of Stellar RPC and Portfolio APIs. While it will continue to receive updates to maintain compatibility with upcoming protocol releases, it won't receive new feature development. Consider switching to Stellar RPC or another data product.

> [!WARNING]
>
> Horizon is nearing end-of-life and will eventually be deprecated in favor of Stellar RPC and [Portfolio APIs](https://developers.stellar.org/docs/data/indexers#portfolio-apis). While it will continue to receive updates to maintain compatibility with upcoming protocol releases, it won't receive new feature development. Consider switching to [Stellar RPC or another data product](https://developers.stellar.org/docs/data/apis).

Horizon provides an HTTP API to access data stored on the Stellar network. This API acts as a bridge between applications and Stellar Core. Stellar Lab's [API Explorer](https://lab.stellar.org/endpoints) offers a Horizon Endpoints UI, enabling developers to interact with Horizon on Futurenet, Testnet, Mainnet, and custom networks. Developers can use Stellar Lab to build and submit transactions, query account balances, and stream events such as transactions for an account.

Data on the Stellar ledger is organized into [resources](../../../data/apis/horizon/api-reference/resources): **Accounts, Assets, Claimable Balances, Effects, Ledgers, Liquidity Pools, Offers, Operations, Trades**, and **Transactions**. Each resource has multiple endpoints. Endpoints that aggregate ledger data (also known as [aggregations](../../../data/apis/horizon/api-reference/aggregations)) include resources like **Order Books, Paths, Trade Aggregations**, and **Fee Stats**.

Stellar Lab's Horizon Endpoints lists each resource type in the menu, allowing developers to interact with its respective endpoints.

![Lab: Horizon Page](https://mintcdn.com/stellardevelopmentfoundation/1iVxlvEjme-PeN5h/assets/lab/horizon-endpoints.png?fit=max\&auto=format\&n=1iVxlvEjme-PeN5h\&q=85\&s=577658b3a92bd613bea5a3385b950868)

> [!NOTE]
>
> For detailed information about each endpoint on a page, click the **View Docs** link in the header to access its API Reference documentation.

![Lab: Horizon - View Docs](https://mintcdn.com/stellardevelopmentfoundation/hmWBKBicbGG4DTu6/assets/lab/lab-horizon-view-docs.png?fit=max\&auto=format\&n=hmWBKBicbGG4DTu6\&q=85\&s=5fe7729642982b755445908778522d0d)

## Examples of Horizon Endpoints

Let's explore a few examples of Horizon endpoints on Testnet and Mainnet. We also have a [documentation on how to set up a local Stellar network environment](https://developers.stellar.org/docs/tools/lab/quickstart-with-lab.md) if you are interested in using a local environment. This will demonstrate how to use the Lab to access these endpoints.

* [Single Account](#single-account): `/accounts/:account-id`
* [Payments for Account](#payments-for-account): `/accounts/:account-id/payments`
* [All Assets](#all-assets): `/assets`

### [Single Account](https://lab.stellar.org/endpoints/accounts/single)

The single account endpoint `/accounts/:account-id` provides information on a specific account. This example uses an account `GBPIMUEJFYS7RT23QO2ACH2JMKGXLXZI4E5ACBSQMF32RKZ5H3SVNL5F` on Testnet.

![Lab: Horizon - Single Account](https://mintcdn.com/stellardevelopmentfoundation/hmWBKBicbGG4DTu6/assets/lab/lab-single-account.png?fit=max\&auto=format\&n=hmWBKBicbGG4DTu6\&q=85\&s=233197468fce412f96cb516abea4bc17)

When I click the **Submit** button, the account endpoint returns the account details in `JSON` format. Developers can use the **Copy Json** functionality to copy and paste the response. Along with the account details such as `id`, `balances` of the account including the assets that the account has set its trustline to, `thresholds`, `flags`, and `signers` (3 signers in the example account).

The endpoint also provides links to related resource pages on the Stellar Lab for the queried account. For example, the response includes `transactions`, `operations`, `payments`, and more under `_links`. Clicking a transaction's `href` takes developers to the [Transactions for Account page](https://lab.stellar.org/endpoints/transactions/account?\$=network\$id=testnet\&label=Testnet\&horizonUrl=https:////horizon-testnet.stellar.org\&rpcUrl=https:////soroban-testnet.stellar.org\&passphrase=Test%20SDF%20Network%20/;%20September%202015;\&endpoints\$params\$account_id=GBPIMUEJFYS7RT23QO2ACH2JMKGXLXZI4E5ACBSQMF32RKZ5H3SVNL5F;;) page on the Stellar Lab where developers can query transactions for that account right away.

![Lab: Horizon - Single Account Response](https://mintcdn.com/stellardevelopmentfoundation/hmWBKBicbGG4DTu6/assets/lab/lab-single-account-response.png?fit=max\&auto=format\&n=hmWBKBicbGG4DTu6\&q=85\&s=a24e21c1b1146284b5d8c9b5566ac57c)

```{ theme={"theme":{"light":"github-light","dark":"github-dark"}}
  "_links": {
    "self": {
      "href": "https://horizon-testnet.stellar.org/accounts/GBPIMUEJFYS7RT23QO2ACH2JMKGXLXZI4E5ACBSQMF32RKZ5H3SVNL5F"
    },
    "transactions": {
      "href": "https://horizon-testnet.stellar.org/accounts/GBPIMUEJFYS7RT23QO2ACH2JMKGXLXZI4E5ACBSQMF32RKZ5H3SVNL5F/transactions{?cursor,limit,order}",
      "templated": true
    },
    "operations": {
      "href": "https://horizon-testnet.stellar.org/accounts/GBPIMUEJFYS7RT23QO2ACH2JMKGXLXZI4E5ACBSQMF32RKZ5H3SVNL5F/operations{?cursor,limit,order}",
      "templated": true
    },
    "payments": {
      "href": "https://horizon-testnet.stellar.org/accounts/GBPIMUEJFYS7RT23QO2ACH2JMKGXLXZI4E5ACBSQMF32RKZ5H3SVNL5F/payments{?cursor,limit,order}",
      "templated": true
    },
    "effects": {
      "href": "https://horizon-testnet.stellar.org/accounts/GBPIMUEJFYS7RT23QO2ACH2JMKGXLXZI4E5ACBSQMF32RKZ5H3SVNL5F/effects{?cursor,limit,order}",
      "templated": true
    },
    "offers": {
      "href": "https://horizon-testnet.stellar.org/accounts/GBPIMUEJFYS7RT23QO2ACH2JMKGXLXZI4E5ACBSQMF32RKZ5H3SVNL5F/offers{?cursor,limit,order}",
      "templated": true
    },
    "trades": {
      "href": "https://horizon-testnet.stellar.org/accounts/GBPIMUEJFYS7RT23QO2ACH2JMKGXLXZI4E5ACBSQMF32RKZ5H3SVNL5F/trades{?cursor,limit,order}",
      "templated": true
    },
    "data": {
      "href": "https://horizon-testnet.stellar.org/accounts/GBPIMUEJFYS7RT23QO2ACH2JMKGXLXZI4E5ACBSQMF32RKZ5H3SVNL5F/data/{key}",
      "templated": true
    }
  },
  "id": "GBPIMUEJFYS7RT23QO2ACH2JMKGXLXZI4E5ACBSQMF32RKZ5H3SVNL5F",
  "account_id": "GBPIMUEJFYS7RT23QO2ACH2JMKGXLXZI4E5ACBSQMF32RKZ5H3SVNL5F",
  "sequence": "4113457683103748",
  "sequence_ledger": 958608,
  "sequence_time": "1731620848",
  "subentry_count": 3,
  "last_modified_ledger": 958608,
  "last_modified_time": "2024-11-14T21:47:28Z",
  "thresholds": {
    "low_threshold": 5,
    "med_threshold": 5,
    "high_threshold": 5
  },
  "flags": {
    "auth_required": false,
    "auth_revocable": false,
    "auth_immutable": false,
    "auth_clawback_enabled": false
  },
  "balances": [
    {
      "balance": "0.0000000",
      "limit": "922337203685.4775807",
      "buying_liabilities": "0.0000000",
      "selling_liabilities": "0.0000000",
      "last_modified_ledger": 958608,
      "is_authorized": true,
      "is_authorized_to_maintain_liabilities": true,
      "asset_type": "credit_alphanum4",
      "asset_code": "USDC",
      "asset_issuer": "GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5"
    },
    {
      "balance": "9990.9999400",
      "buying_liabilities": "0.0000000",
      "selling_liabilities": "0.0000000",
      "asset_type": "native"
    }
  ],
  "signers": [
    {
      "weight": 2,
      "key": "GAGOOY3NKKNEXDOVKTKIP2AUCT6ZOQD4SMWAB54TSHTAXATLJSVVDJCZ",
      "type": "ed25519_public_key"
    },
    {
      "weight": 1,
      "key": "GBPIMUEJFYS7RT23QO2ACH2JMKGXLXZI4E5ACBSQMF32RKZ5H3SVNL5F",
      "type": "ed25519_public_key"
    },
    {
      "weight": 2,
      "key": "GDFHN4ILDFEBM5YHW6MYOQIRNY3EQ7VV72IW3YIAZNXDW363SUAK7BBL",
      "type": "ed25519_public_key"
    }
  ],
  "data": {},
  "num_sponsoring": 0,
  "num_sponsored": 0,
  "paging_token": "GBPIMUEJFYS7RT23QO2ACH2JMKGXLXZI4E5ACBSQMF32RKZ5H3SVNL5F"
}
```

### [Payments for Account](https://lab.stellar.org/endpoints/payments/account)

The Payments for Account endpoint `/accounts/:account-id/payments` provides successful payments for a given account and can be used in streaming mode. We're going to use the same account that we used from the previous example: `GBPIMUEJFYS7RT23QO2ACH2JMKGXLXZI4E5ACBSQMF32RKZ5H3SVNL5F`.

![Lab: Horizon - Payments](https://mintcdn.com/stellardevelopmentfoundation/1iVxlvEjme-PeN5h/assets/lab/horizon-payments.png?fit=max\&auto=format\&n=1iVxlvEjme-PeN5h\&q=85\&s=e87496c3f7b013eead92f4f3a7ffbab4)

When I click the **Submit** button, the endpoint returns the records of payments (see the [api reference](https://developers.stellar.org/docs/data/apis/horizon/api-reference/get-payments-by-account-id.md) for more information on the response format) including the [payment object](https://developers.stellar.org/docs/data/apis/horizon/api-reference/resources/payments/object.md) that were submitted successfully in the account in `JSON` format.

![Lab: Horizon - Payments Response](https://mintcdn.com/stellardevelopmentfoundation/1iVxlvEjme-PeN5h/assets/lab/horizon-payments-response.png?fit=max\&auto=format\&n=1iVxlvEjme-PeN5h\&q=85\&s=c8dfcb28171a6f4f54326cec99eac3ec)

```
{
  "_links": {
    "self": {
      "href": "https://horizon-testnet.stellar.org/accounts/GBPIMUEJFYS7RT23QO2ACH2JMKGXLXZI4E5ACBSQMF32RKZ5H3SVNL5F/payments?cursor=&limit=10&order=asc"
    },
    "next": {
      "href": "https://horizon-testnet.stellar.org/accounts/GBPIMUEJFYS7RT23QO2ACH2JMKGXLXZI4E5ACBSQMF32RKZ5H3SVNL5F/payments?cursor=4115390418391041&limit=10&order=asc"
    },
    "prev": {
      "href": "https://horizon-testnet.stellar.org/accounts/GBPIMUEJFYS7RT23QO2ACH2JMKGXLXZI4E5ACBSQMF32RKZ5H3SVNL5F/payments?cursor=4113457683111937&limit=10&order=desc"
    }
  },
  "_embedded": {
    "records": [
      {
        "_links": {
          "self": {
            "href": "https://horizon-testnet.stellar.org/operations/4113457683111937"
          },
          "transaction": {
            "href": "https://horizon-testnet.stellar.org/transactions/b86ad0433bd024d37739b803529e77601bceb83976d6ae328a61f8f0f8300cb6"
          },
          "effects": {
            "href": "https://horizon-testnet.stellar.org/operations/4113457683111937/effects"
          },
          "succeeds": {
            "href": "https://horizon-testnet.stellar.org/effects?order=desc&cursor=4113457683111937"
          },
          "precedes": {
            "href": "https://horizon-testnet.stellar.org/effects?order=asc&cursor=4113457683111937"
          }
        },
        "id": "4113457683111937",
        "paging_token": "4113457683111937",
        "transaction_successful": true,
        "source_account": "GAIH3ULLFQ4DGSECF2AR555KZ4KNDGEKN4AFI4SU2M7B43MGK3QJZNSR",
        "type": "create_account",
        "type_i": 0,
        "created_at": "2024-11-14T20:34:58Z",
        "transaction_hash": "b86ad0433bd024d37739b803529e77601bceb83976d6ae328a61f8f0f8300cb6",
        "starting_balance": "10000.0000000",
        "funder": "GAIH3ULLFQ4DGSECF2AR555KZ4KNDGEKN4AFI4SU2M7B43MGK3QJZNSR",
        "account": "GBPIMUEJFYS7RT23QO2ACH2JMKGXLXZI4E5ACBSQMF32RKZ5H3SVNL5F"
      },
      {
        "_links": {
          "self": {
            "href": "https://horizon-testnet.stellar.org/operations/4113586532130817"
          },
          "transaction": {
            "href": "https://horizon-testnet.stellar.org/transactions/bbc6b423efb9c5a8ebb1ac72437a326ffd4b8a202782157f9a9bca38f742f7d7"
          },
          "effects": {
            "href": "https://horizon-testnet.stellar.org/operations/4113586532130817/effects"
          },
          "succeeds": {
            "href": "https://horizon-testnet.stellar.org/effects?order=desc&cursor=4113586532130817"
          },
          "precedes": {
            "href": "https://horizon-testnet.stellar.org/effects?order=asc&cursor=4113586532130817"
          }
        },
        "id": "4113586532130817",
        "paging_token": "4113586532130817",
        "transaction_successful": true,
        "source_account": "GBPIMUEJFYS7RT23QO2ACH2JMKGXLXZI4E5ACBSQMF32RKZ5H3SVNL5F",
        "type": "payment",
        "type_i": 1,
        "created_at": "2024-11-14T20:37:28Z",
        "transaction_hash": "bbc6b423efb9c5a8ebb1ac72437a326ffd4b8a202782157f9a9bca38f742f7d7",
        "asset_type": "native",
        "from": "GBPIMUEJFYS7RT23QO2ACH2JMKGXLXZI4E5ACBSQMF32RKZ5H3SVNL5F",
        "to": "GDE25LQ34AFCSDMYTOI6AVVEHRXFRJI4MOAVIUGUDUQEC5ZWN5OZDLAZ",
        "amount": "4.0000000"
      },
      {
        "_links": {
          "self": {
            "href": "https://horizon-testnet.stellar.org/operations/4115390418391041"
          },
          "transaction": {
            "href": "https://horizon-testnet.stellar.org/transactions/6de546bd7702f1590f21928e6aa1329582b436f11d9fc9bcce304ea51f1893b0"
          },
          "effects": {
            "href": "https://horizon-testnet.stellar.org/operations/4115390418391041/effects"
          },
          "succeeds": {
            "href": "https://horizon-testnet.stellar.org/effects?order=desc&cursor=4115390418391041"
          },
          "precedes": {
            "href": "https://horizon-testnet.stellar.org/effects?order=asc&cursor=4115390418391041"
          }
        },
        "id": "4115390418391041",
        "paging_token": "4115390418391041",
        "transaction_successful": true,
        "source_account": "GBPIMUEJFYS7RT23QO2ACH2JMKGXLXZI4E5ACBSQMF32RKZ5H3SVNL5F",
        "type": "payment",
        "type_i": 1,
        "created_at": "2024-11-14T21:12:31Z",
        "transaction_hash": "6de546bd7702f1590f21928e6aa1329582b436f11d9fc9bcce304ea51f1893b0",
        "asset_type": "native",
        "from": "GBPIMUEJFYS7RT23QO2ACH2JMKGXLXZI4E5ACBSQMF32RKZ5H3SVNL5F",
        "to": "GCNJ2TA24PJNDPE2JF3BYVLUTJX2GLRDGGBG4SYMQHKHYDHSMAPRZXWC",
        "amount": "5.0000000"
      }
    ]
  }
}
```

### [All Assets](https://lab.stellar.org/endpoints/assets)

Horizon's `/assets` endpoint provides information about an asset. Since we are not interested in historical data, we will use SDF's Mainnet Horizon to retrieve the latest information about the asset.

![Lab: Horizon - Assets Page](https://mintcdn.com/stellardevelopmentfoundation/1iVxlvEjme-PeN5h/assets/lab/horizon-assets.png?fit=max\&auto=format\&n=1iVxlvEjme-PeN5h\&q=85\&s=b22e42f757f5397706b4c5ac134d7eab)

Let's inquire about one of the most popular assets on the Stellar network: [USDC by Circle](https://www.circle.com/usdc). To do this, enter `USDC` as the Asset Code and `GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN` as the Asset Issuer.

![Lab: Horizon - Assets Page](https://mintcdn.com/stellardevelopmentfoundation/1iVxlvEjme-PeN5h/assets/lab/horizon-assets-usdc.png?fit=max\&auto=format\&n=1iVxlvEjme-PeN5h\&q=85\&s=6583a6a929db2f1683ee47a38d250771)

When I click the **Submit** button, the `/assets` endpoint returns the `USDC` asset details in `JSON` format.

![Lab: Horizon - Assets Page](https://mintcdn.com/stellardevelopmentfoundation/1iVxlvEjme-PeN5h/assets/lab/horizon-assets-usdc-response.png?fit=max\&auto=format\&n=1iVxlvEjme-PeN5h\&q=85\&s=a49fa3f7dca813a00c8c9356c6831ffe)

The JSON response for the `USDC` asset includes [the asset object](https://developers.stellar.org/docs/data/apis/horizon/api-reference/resources/assets/object.md), which contains details about USDC, such as the asset's TOML file (also known as [the Stellar info file](https://developers.stellar.org/docs/tokens/publishing-asset-info.md)), the number of claimable balances, liquidity pools, contracts, accounts, balances, and flags.

It shows that `auth_revocable` is set to `true` under `flags`, indicating that this account (in this case, the `USDC` issuer) can freeze the balance of a holder of an asset it has issued.

```
{
  "_links": {
    "self": {
      "href": "https://horizon.stellar.org/assets?asset_code=USDC&asset_issuer=GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN&cursor=&limit=10&order=asc"
    },
    "next": {
      "href": "https://horizon.stellar.org/assets?asset_code=USDC&asset_issuer=GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN&cursor=USDC_GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN_credit_alphanum4&limit=10&order=asc"
    },
    "prev": {
      "href": "https://horizon.stellar.org/assets?asset_code=USDC&asset_issuer=GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN&cursor=USDC_GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN_credit_alphanum4&limit=10&order=desc"
    }
  },
  "_embedded": {
    "records": [
      {
        "_links": {
          "toml": {
            "href": "https://centre.io/.well-known/stellar.toml"
          }
        },
        "asset_type": "credit_alphanum4",
        "asset_code": "USDC",
        "asset_issuer": "GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
        "paging_token": "USDC_GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN_credit_alphanum4",
        "contract_id": "CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75",
        "num_claimable_balances": 449,
        "num_liquidity_pools": 645,
        "num_contracts": 388,
        "num_archived_contracts": 18,
        "accounts": {
          "authorized": 1058053,
          "authorized_to_maintain_liabilities": 0,
          "unauthorized": 0
        },
        "claimable_balances_amount": "8567.4304807",
        "liquidity_pools_amount": "6154162.8631633",
        "contracts_amount": "2734426.6007745",
        "archived_contracts_amount": "26.3776599",
        "balances": {
          "authorized": "121258232.6884846",
          "authorized_to_maintain_liabilities": "0.0000000",
          "unauthorized": "0.0000000"
        },
        "flags": {
          "auth_required": false,
          "auth_revocable": true,
          "auth_immutable": false,
          "auth_clawback_enabled": false
        }
      }
    ]
  }
}
```

## Share Feature

The Stellar Lab offers a share feature that allows you to copy a URL to its page, which redirects users to a form with the endpoint URL and parameter values pre-filled. This feature makes it easy to collaborate with others.

For example, clicking the share icon on the Payments for Account page with the account ID `GBPIMUEJFYS7RT23QO2ACH2JMKGXLXZI4E5ACBSQMF32RKZ5H3SVNL5F`, copies a URL that includes the account ID parameter and network setting. An example of a copied URL is [this link](https://lab.stellar.org/endpoints/payments/account?\$=network\$id=testnet\&label=Testnet\&horizonUrl=https:////horizon-testnet.stellar.org\&rpcUrl=https:////soroban-testnet.stellar.org\&passphrase=Test%20SDF%20Network%20/;%20September%202015;\&endpoints\$params\$account_id=GBPIMUEJFYS7RT23QO2ACH2JMKGXLXZI4E5ACBSQMF32RKZ5H3SVNL5F;;).

![Lab: Horizon - Share Feature](https://mintcdn.com/stellardevelopmentfoundation/1iVxlvEjme-PeN5h/assets/lab/horizon-share.png?fit=max\&auto=format\&n=1iVxlvEjme-PeN5h\&q=85\&s=585f252b04ea26f75ff92fb38e4f8a3f)

## Saved Requests

The icon next to the Share Feature icon allows you to save an endpoint with its parameters in your browser's local storage. It displays the endpoint for the selected network, which can be changed using the menu in the upper-right corner.

![Lab: Horizon - Save](https://mintcdn.com/stellardevelopmentfoundation/1iVxlvEjme-PeN5h/assets/lab/horizon-save.png?fit=max\&auto=format\&n=1iVxlvEjme-PeN5h\&q=85\&s=760edc11e767da37166ed89b338acdf4)

Clicking the icon opens a modal. We recommend providing an identifiable name to make it easier to search for later.

![Lab: Horizon - Modal](https://mintcdn.com/stellardevelopmentfoundation/1iVxlvEjme-PeN5h/assets/lab/horizon-save-modal.png?fit=max\&auto=format\&n=1iVxlvEjme-PeN5h\&q=85\&s=3926a22d058fc20ff1d698233e837cd5)

Saved endpoints are located in the main menu under the "Saved" menu, "[Requests](https://developers.stellar.org/docs/tools/lab/saved/requests.md)" submenu.
