Skip to content

Horizon API Reference

Horizon is an API for interacting with the Stellar network.

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 is a RESTful API and 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.

The Stellar Development Foundation (SDF) runs two instances of Horizon:

API Reference Sections
IntroductionHow Horizon is structured.
ResourcesDescriptions of resources and their endpoints.
AggregationsDescriptions of specialized endpoints.
ErrorsPotential errors and what they mean.

Response Format

Horizon delivers responses as JSON objects formatted according to HAL. The HAL format makes Horizon more explorable, paginates responses, and connects parent and child resources. Consuming this format is simple using one of the many open source libraries available for most major programming languages.

HAL is just JSON with two reserved attribute names:

  • _links
  • _embedded

If a response is a single record, the _links section will provide links to any parent or child records, and there will be no _embedded property.

If a response is a collection, the _links section will provide pagination links, and the response’s list of records will be nested underneath the _embedded property.

  • ATTRIBUTESDATA TYPE

    DESCRIPTION

  • _linksarray

    Provides links for navigating to other pages or to parents and children.

  • _embeddedarray

    Present when querying an endpoint that responds with a collection of records.

Example Response
{
  "_links": {
    "self": {
      "href": "https://horizon.stellar.org/accounts/GCRGHKY6RBFVQLF2JCHB7TK7A5BIABITFKVIEOXK4BPEIDE446OEFYXZ/payments?cursor=&limit=5&order=asc"
    },
    "next": {
      "href": "https://horizon.stellar.org/accounts/GCRGHKY6RBFVQLF2JCHB7TK7A5BIABITFKVIEOXK4BPEIDE446OEFYXZ/payments?cursor=111764193027313665&limit=5&order=asc"
    },
    "prev": {
      "href": "https://horizon.stellar.org/accounts/GCRGHKY6RBFVQLF2JCHB7TK7A5BIABITFKVIEOXK4BPEIDE446OEFYXZ/payments?cursor=111720727958269953&limit=5&order=desc"
    }
  },
  "_embedded": {
    "records": [
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/operations/111720727958269953"
          },
          "transaction": {
            "href": "https://horizon.stellar.org/transactions/4034838d5b47e4f8c23776faca4d9403637b1f037e436759b57fc892ae5cd96c"
          },
          "effects": {
            "href": "https://horizon.stellar.org/operations/111720727958269953/effects"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=111720727958269953"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=111720727958269953"
          }
        },
        "id": "111720727958269953",
        "paging_token": "111720727958269953",
        "transaction_successful": true,
        "source_account": "GAR4S3ASZ4HTJ6GQ2DEDLVL4YE6D64UPIOQI4I67L5VPYBGEZDGOI462",
        "type": "create_account",
        "type_i": 0,
        "created_at": "2019-09-26T12:34:24Z",
        "transaction_hash": "4034838d5b47e4f8c23776faca4d9403637b1f037e436759b57fc892ae5cd96c",
        "starting_balance": "20.0000000",
        "funder": "GAR4S3ASZ4HTJ6GQ2DEDLVL4YE6D64UPIOQI4I67L5VPYBGEZDGOI462",
        "account": "GCRGHKY6RBFVQLF2JCHB7TK7A5BIABITFKVIEOXK4BPEIDE446OEFYXZ"
      },
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/operations/111721376498331649"
          },
          "transaction": {
            "href": "https://horizon.stellar.org/transactions/cbf92ce9e2b75b0182597acb1e7c0b58695ec6f69e84a8625c5ab1dda8df31bc"
          },
          "effects": {
            "href": "https://horizon.stellar.org/operations/111721376498331649/effects"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=111721376498331649"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=111721376498331649"
          }
        },
        "id": "111721376498331649",
        "paging_token": "111721376498331649",
        "transaction_successful": true,
        "source_account": "GAR4S3ASZ4HTJ6GQ2DEDLVL4YE6D64UPIOQI4I67L5VPYBGEZDGOI462",
        "type": "payment",
        "type_i": 1,
        "created_at": "2019-09-26T12:47:50Z",
        "transaction_hash": "cbf92ce9e2b75b0182597acb1e7c0b58695ec6f69e84a8625c5ab1dda8df31bc",
        "asset_type": "native",
        "from": "GAR4S3ASZ4HTJ6GQ2DEDLVL4YE6D64UPIOQI4I67L5VPYBGEZDGOI462",
        "to": "GCRGHKY6RBFVQLF2JCHB7TK7A5BIABITFKVIEOXK4BPEIDE446OEFYXZ",
        "amount": "5000.0000000"
      },
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/operations/111722218311925761"
          },
          "transaction": {
            "href": "https://horizon.stellar.org/transactions/9fcf20d23862f40cd8a59f0ad0247a7d56a1b38cb79e4953b5aad8df5f2608a7"
          },
          "effects": {
            "href": "https://horizon.stellar.org/operations/111722218311925761/effects"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=111722218311925761"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=111722218311925761"
          }
        },
        "id": "111722218311925761",
        "paging_token": "111722218311925761",
        "transaction_successful": true,
        "source_account": "GBSIPZRLSM2KMLUZYEGKU2WMA6HPEE3NGB47YY4MLK43ISLLCJKFA2F2",
        "type": "payment",
        "type_i": 1,
        "created_at": "2019-09-26T13:05:12Z",
        "transaction_hash": "9fcf20d23862f40cd8a59f0ad0247a7d56a1b38cb79e4953b5aad8df5f2608a7",
        "asset_type": "native",
        "from": "GBSIPZRLSM2KMLUZYEGKU2WMA6HPEE3NGB47YY4MLK43ISLLCJKFA2F2",
        "to": "GCRGHKY6RBFVQLF2JCHB7TK7A5BIABITFKVIEOXK4BPEIDE446OEFYXZ",
        "amount": "10.0000000"
      },
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/operations/111747107647434753"
          },
          "transaction": {
            "href": "https://horizon.stellar.org/transactions/44af49d32061cdb352d131559560559e7be815b16c45412b7682600c71224623"
          },
          "effects": {
            "href": "https://horizon.stellar.org/operations/111747107647434753/effects"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=111747107647434753"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=111747107647434753"
          }
        },
        "id": "111747107647434753",
        "paging_token": "111747107647434753",
        "transaction_successful": true,
        "source_account": "GCRGHKY6RBFVQLF2JCHB7TK7A5BIABITFKVIEOXK4BPEIDE446OEFYXZ",
        "type": "payment",
        "type_i": 1,
        "created_at": "2019-09-26T21:43:41Z",
        "transaction_hash": "44af49d32061cdb352d131559560559e7be815b16c45412b7682600c71224623",
        "asset_type": "credit_alphanum4",
        "asset_code": "BTC",
        "asset_issuer": "GATEMHCCKCY67ZUCKTROYN24ZYT5GK4EQZ65JJLDHKHRUZI3EUEKMTCH",
        "from": "GCRGHKY6RBFVQLF2JCHB7TK7A5BIABITFKVIEOXK4BPEIDE446OEFYXZ",
        "to": "GBSIPZRLSM2KMLUZYEGKU2WMA6HPEE3NGB47YY4MLK43ISLLCJKFA2F2",
        "amount": "0.0000709"
      },
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/operations/111764193027313665"
          },
          "transaction": {
            "href": "https://horizon.stellar.org/transactions/7bd57f8cc75ce2d9740568eade9700cd7b19491a2c938232e5b3f0768f3e588a"
          },
          "effects": {
            "href": "https://horizon.stellar.org/operations/111764193027313665/effects"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=111764193027313665"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=111764193027313665"
          }
        },
        "id": "111764193027313665",
        "paging_token": "111764193027313665",
        "transaction_successful": true,
        "source_account": "GCRGHKY6RBFVQLF2JCHB7TK7A5BIABITFKVIEOXK4BPEIDE446OEFYXZ",
        "type": "payment",
        "type_i": 1,
        "created_at": "2019-09-27T03:37:57Z",
        "transaction_hash": "7bd57f8cc75ce2d9740568eade9700cd7b19491a2c938232e5b3f0768f3e588a",
        "asset_type": "credit_alphanum4",
        "asset_code": "BTC",
        "asset_issuer": "GATEMHCCKCY67ZUCKTROYN24ZYT5GK4EQZ65JJLDHKHRUZI3EUEKMTCH",
        "from": "GCRGHKY6RBFVQLF2JCHB7TK7A5BIABITFKVIEOXK4BPEIDE446OEFYXZ",
        "to": "GBSIPZRLSM2KMLUZYEGKU2WMA6HPEE3NGB47YY4MLK43ISLLCJKFA2F2",
        "amount": "0.0107156"
      }
    ]
  }
}

Streaming

Horizon provides a streaming mechanism for receiving events in near real time. Instead of repeatedly sending requests to Horizon for batch updates, a connection is established between a client and Horizon with updates to an endpoint response streaming as new ledgers close and updates occur.

This reduces requests that return no data and allows near instantaneous updates client-side.

All attributes for the endpoints that allow streaming are the same as regular responses. A caller can initiate streaming by setting ‘Accept: text/event-stream’ in the HTTP header when making the request. Study an example of using streaming in the Follow Received Payments tutorial.


Rate Limiting

Horizon rate limits on a per-IP-address basis. By default, a client is limited to 3600 requests per hour - one request per second on average.

While streaming, each update of the stream counts as a request and against a client’s allotted rate limit.


XDR

In the Stellar network, transactions are encoded using a standardized protocol called External Data Representation (XDR).

In Horizon, you will only encounter XDR when posting and getting transactions and in the ledger header.

When you post a transaction, a client will encode the transaction as XDR before submitting it to Horizon.

When you request a transaction, Horizon returns some data about the transaction in human-readable JSON. The full canonical data about the transaction is encoded in machine-readable XDR, available in XDR attributes at the end of the response.

You can decode this XDR in the Stellar Laboratory’s XDR Viewer.

  • ATTRIBUTETYPE

    DESCRIPTION

  • envelope_xdrstring

    The XDR encoded transaction as stellar-core sees it.

  • result_xdrstring

    The effects of a transaction encoded in XDR.

  • result_meta_xdrstring

    The details about the effects of a transaction encoded in XDR.

  • fee_meta_xdrstring

    The fees associated with the transaction encoded in XDR.

Example Transaction Response with XDR
{
  // Response truncated to highlight XDR-related attributes
  "envelope_xdr": "AAAAAPewD+/6X8o0bx3bp49Wf+mUhG3o+TUrcjcst717DWJVAAAAyAFvzscADTkNAAAAAAAAAAAAAAACAAAAAAAAAAYAAAACWE1BVEsAAAAAAAAAAAAAAAPvNOuztX4IjvV8pztsEc1/ZnTz0G3p5Cx4vcf04+xUAAONfqTGgAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAD2NyeXB0b21hcmluZS5ldQAAAAAAAAAAAAAAAAF7DWJVAAAAQK3vfUCZ8mbjW3ssMd0n1tJTF9Fv6EbuJ6cWKkYXBqG5itqanPbFzIQoZEHbPS8nr2vo4dROvKI0uQzNcfExKwM=",
  "result_xdr": "AAAAAAAAAMgAAAAAAAAAAgAAAAAAAAAGAAAAAAAAAAAAAAAFAAAAAAAAAAA=",
  "result_meta_xdr": "AAAAAQAAAAIAAAADAZU3mQAAAAAAAAAA97AP7/pfyjRvHdunj1Z/6ZSEbej5NStyNyy3vXsNYlUAAAAABlxskAFvzscADTkMAAAAAgAAAAAAAAAAAAAAD2NyeXB0b21hcmluZS5ldQABAAAAAAAAAAAAAAAAAAAAAAAAAQGVN5kAAAAAAAAAAPewD+/6X8o0bx3bp49Wf+mUhG3o+TUrcjcst717DWJVAAAAAAZcbJABb87HAA05DQAAAAIAAAAAAAAAAAAAAA9jcnlwdG9tYXJpbmUuZXUAAQAAAAAAAAAAAAAAAAAAAAAAAAIAAAACAAAAAwGVN5gAAAABAAAAAPewD+/6X8o0bx3bp49Wf+mUhG3o+TUrcjcst717DWJVAAAAAlhNQVRLAAAAAAAAAAAAAAAD7zTrs7V+CI71fKc7bBHNf2Z089Bt6eQseL3H9OPsVAAATfBgJfPoAAONfqTGgAAAAAABAAAAAAAAAAAAAAABAZU3mQAAAAEAAAAA97AP7/pfyjRvHdunj1Z/6ZSEbej5NStyNyy3vXsNYlUAAAACWE1BVEsAAAAAAAAAAAAAAAPvNOuztX4IjvV8pztsEc1/ZnTz0G3p5Cx4vcf04+xUAABN8GAl8+gAA41+pMaAAAAAAAEAAAAAAAAAAAAAAAIAAAADAZU3mQAAAAAAAAAA97AP7/pfyjRvHdunj1Z/6ZSEbej5NStyNyy3vXsNYlUAAAAABlxskAFvzscADTkNAAAAAgAAAAAAAAAAAAAAD2NyeXB0b21hcmluZS5ldQABAAAAAAAAAAAAAAAAAAAAAAAAAQGVN5kAAAAAAAAAAPewD+/6X8o0bx3bp49Wf+mUhG3o+TUrcjcst717DWJVAAAAAAZcbJABb87HAA05DQAAAAIAAAAAAAAAAAAAAA9jcnlwdG9tYXJpbmUuZXUAAQAAAAAAAAAAAAAAAAAAAA==",
  "fee_meta_xdr": "AAAAAgAAAAMBlTeXAAAAAAAAAAD3sA/v+l/KNG8d26ePVn/plIRt6Pk1K3I3LLe9ew1iVQAAAAAGXG1YAW/OxwANOQwAAAACAAAAAAAAAAAAAAAPY3J5cHRvbWFyaW5lLmV1AAEAAAAAAAAAAAAAAAAAAAAAAAABAZU3mQAAAAAAAAAA97AP7/pfyjRvHdunj1Z/6ZSEbej5NStyNyy3vXsNYlUAAAAABlxskAFvzscADTkMAAAAAgAAAAAAAAAAAAAAD2NyeXB0b21hcmluZS5ldQABAAAAAAAAAAAAAAAAAAAA"
  // Response truncated to highlight XDR-related attributes
}

Page Arguments

GET/{endpoint}?cursor={paging_token}&order={asc,desc}&limit={1-200}
  • ARGUMENTREQUIRED?

    DESCRIPTION

  • cursoroptional

    A number that points to a specific location in a collection of responses and is pulled from the paging_token value of a record.

  • orderoptional

    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.

  • limitoptional

    The total 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.

Example Request
curl "https://horizon.stellar.org/ledgers/26478723/operations?cursor=113725249324879872&limit=5&order=asc"
Example Response
{
  "_links": {
    "self": {
      "href": "https://horizon.stellar.org/ledgers/26478723/operations?cursor=113725249324879872\u0026limit=5\u0026order=asc"
    },
    "next": {
      "href": "https://horizon.stellar.org/ledgers/26478723/operations?cursor=113725249324916737\u0026limit=5\u0026order=asc"
    },
    "prev": {
      "href": "https://horizon.stellar.org/ledgers/26478723/operations?cursor=113725249324879873\u0026limit=5\u0026order=desc"
    }
  },
  "_embedded": {
    "records": [
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/operations/113725249324879873"
          },
          "transaction": {
            "href": "https://horizon.stellar.org/transactions/6adab48bbc0a38b9d40938b63a8ae0f5b334948c2d5acfb755dea616f98720d1"
          },
          "effects": {
            "href": "https://horizon.stellar.org/operations/113725249324879873/effects"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=113725249324879873"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=113725249324879873"
          }
        },
        "id": "113725249324879873",
        "paging_token": "113725249324879873",
        "transaction_successful": true,
        "source_account": "GCRGHKY6RBFVQLF2JCHB7TK7A5BIABITFKVIEOXK4BPEIDE446OEFYXZ",
        "type": "manage_offer",
        "type_i": 3,
        "created_at": "2019-10-25T20:45:51Z",
        "transaction_hash": "6adab48bbc0a38b9d40938b63a8ae0f5b334948c2d5acfb755dea616f98720d1",
        "amount": "5048.0792092",
        "price": "0.0000079",
        "price_r": {
          "n": 79,
          "d": 10000000
        },
        "buying_asset_type": "credit_alphanum4",
        "buying_asset_code": "BTC",
        "buying_asset_issuer": "GATEMHCCKCY67ZUCKTROYN24ZYT5GK4EQZ65JJLDHKHRUZI3EUEKMTCH",
        "selling_asset_type": "native",
        "offer_id": 125121197
      },
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/operations/113725249324888065"
          },
          "transaction": {
            "href": "https://horizon.stellar.org/transactions/c4de60af4815d94b6f3aa9947403f96dd0e8c3ba7d84eccce9c2c798470381ed"
          },
          "effects": {
            "href": "https://horizon.stellar.org/operations/113725249324888065/effects"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=113725249324888065"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=113725249324888065"
          }
        },
        "id": "113725249324888065",
        "paging_token": "113725249324888065",
        "transaction_successful": true,
        "source_account": "GCFKS7EBBZQTBBM7HHOASGZBE3L2TADWG6OJBVJXYIS44LQFXFL766UB",
        "type": "manage_offer",
        "type_i": 3,
        "created_at": "2019-10-25T20:45:51Z",
        "transaction_hash": "c4de60af4815d94b6f3aa9947403f96dd0e8c3ba7d84eccce9c2c798470381ed",
        "amount": "103.0721239",
        "price": "0.0655000",
        "price_r": {
          "n": 131,
          "d": 2000
        },
        "buying_asset_type": "credit_alphanum4",
        "buying_asset_code": "USD",
        "buying_asset_issuer": "GDSRCV5VTM3U7Y3L6DFRP3PEGBNQMGOWSRTGSBWX6Z3H6C7JHRI4XFJP",
        "selling_asset_type": "native",
        "offer_id": 0
      },
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/operations/113725249324892161"
          },
          "transaction": {
            "href": "https://horizon.stellar.org/transactions/6d0fe444dd346e05742776305f5e90dd102bd83dfa00a54cfd79bd94753beba0"
          },
          "effects": {
            "href": "https://horizon.stellar.org/operations/113725249324892161/effects"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=113725249324892161"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=113725249324892161"
          }
        },
        "id": "113725249324892161",
        "paging_token": "113725249324892161",
        "transaction_successful": true,
        "source_account": "GB44WLYD6HQXZHLRCPARIAMBASN35TDHXU5Q3I3DRHQMLLB3CBMIZLY5",
        "type": "manage_buy_offer",
        "type_i": 12,
        "created_at": "2019-10-25T20:45:51Z",
        "transaction_hash": "6d0fe444dd346e05742776305f5e90dd102bd83dfa00a54cfd79bd94753beba0",
        "amount": "2942.0268642",
        "price": "6.7000000",
        "price_r": {
          "n": 67,
          "d": 10
        },
        "buying_asset_type": "credit_alphanum4",
        "buying_asset_code": "SLT",
        "buying_asset_issuer": "GCKA6K5PCQ6PNF5RQBF7PQDJWRHO6UOGFMRLK3DYHDOI244V47XKQ4GP",
        "selling_asset_type": "native",
        "offer_id": 0
      },
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/operations/113725249324908545"
          },
          "transaction": {
            "href": "https://horizon.stellar.org/transactions/36907ac7f802a079fa1d7e7fddeb31decbed1218b47924243daaa508af8b1bbe"
          },
          "effects": {
            "href": "https://horizon.stellar.org/operations/113725249324908545/effects"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=113725249324908545"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=113725249324908545"
          }
        },
        "id": "113725249324908545",
        "paging_token": "113725249324908545",
        "transaction_successful": true,
        "source_account": "GBVI7F7QBE3ZEHP7HUAXAEKENITQKCXR5CML5JMOCHJN6EOQXLTSJYJI",
        "type": "payment",
        "type_i": 1,
        "created_at": "2019-10-25T20:45:51Z",
        "transaction_hash": "36907ac7f802a079fa1d7e7fddeb31decbed1218b47924243daaa508af8b1bbe",
        "asset_type": "credit_alphanum4",
        "asset_code": "TFC",
        "asset_issuer": "GDS3XDJAA4VY6MJYASIGSIMPHZ7AQNZ54RKLWT7MWCOU5YKYEVCNLVS3",
        "from": "GBVI7F7QBE3ZEHP7HUAXAEKENITQKCXR5CML5JMOCHJN6EOQXLTSJYJI",
        "to": "GAMKXMT23OMMOFJMZIHT5T3C65JI5YGAOHJMDYBBS4JJBB3X2CVLT3GO",
        "amount": "0.0380000"
      },
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/operations/113725249324916737"
          },
          "transaction": {
            "href": "https://horizon.stellar.org/transactions/785058d3363b448c95943a40230333b8d523607c9617089bb17c9202a2e7384a"
          },
          "effects": {
            "href": "https://horizon.stellar.org/operations/113725249324916737/effects"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=113725249324916737"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=113725249324916737"
          }
        },
        "id": "113725249324916737",
        "paging_token": "113725249324916737",
        "transaction_successful": true,
        "source_account": "GDD7ABRF7BCK76W33RXDQG5Q3WXVSQYVLGEMXSOWRGZ6Z3G3M2EM2TCP",
        "type": "manage_offer",
        "type_i": 3,
        "created_at": "2019-10-25T20:45:51Z",
        "transaction_hash": "785058d3363b448c95943a40230333b8d523607c9617089bb17c9202a2e7384a",
        "amount": "0.0000000",
        "price": "1.0000000",
        "price_r": {
          "n": 1,
          "d": 1
        },
        "buying_asset_type": "native",
        "selling_asset_type": "credit_alphanum4",
        "selling_asset_code": "BTC",
        "selling_asset_issuer": "GBVOL67TMUQBGL4TZYNMY3ZQ5WGQYFPFD5VJRWXR72VA33VFNL225PL5",
        "offer_id": 125126043
      }
    ]
  }
}

Pagination

To make it possible to explore the millions of records for resources like transactions and operations, Horizon paginates the data it returns for collection-based endpoints.

Each individual transaction, operation, ledger, etc. is returned as a record, and a group of records is called a collection. Records are returned as an array under the _embedded attribute.

To move between pages of a collection of records, use the links in the next and prev attributes nested under the top-level _links attribute.

  • ATTRIBUTEDATA TYPE

    DESCRIPTION

  • _linksarray

    Provides links for navigating to other pages.

  • _embeddedarray

    An href key with a link to the next page for this endpoint as the value.

Example Request
JavaScript
var StellarSdk = require('stellar-sdk')
var server = new StellarSdk.Server('https://horizon.stellar.org')

server
.transactions()
.call()
.then(function(resp) {
  // page 1
  console.log(resp)
  return resp.next()
})
.then(function(resp) {
  // page 2
  console.log(resp)
})
.catch(function(err) {
  console.error(err)
})
Example Paginated Response
{
  "_links": {
    "self": {
      "href": "https://horizon.stellar.org/transactions/2a09c3d79027721f2b8a78e2a936cbeda484bfe98a6e34856c1fee743b7e8906/operations?cursor=&limit=5&order=asc"
    },
    "next": {
      "href": "https://horizon.stellar.org/transactions/2a09c3d79027721f2b8a78e2a936cbeda484bfe98a6e34856c1fee743b7e8906/operations?cursor=113928152169844741&limit=5&order=asc"
    },
    "prev": {
      "href": "https://horizon.stellar.org/transactions/2a09c3d79027721f2b8a78e2a936cbeda484bfe98a6e34856c1fee743b7e8906/operations?cursor=113928152169844737&limit=5&order=desc"
    }
  },
  "_embedded": {
    "records": [
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/operations/113928152169844737"
          },
          "transaction": {
            "href": "https://horizon.stellar.org/transactions/2a09c3d79027721f2b8a78e2a936cbeda484bfe98a6e34856c1fee743b7e8906"
          },
          "effects": {
            "href": "https://horizon.stellar.org/operations/113928152169844737/effects"
          }
        },
        "id": "113928152169844737",
        "paging_token": "113928152169844737",
        "transaction_successful": true,
        "source_account": "GDO2BIMNH7T6MOJVPKEJHWAGMYGOQU5QMK5BKT5XMVWPZKHAGA4JNAQZ",
        "type": "manage_buy_offer",
        "type_i": 12,
        "created_at": "2019-10-28T19:44:09Z",
        "transaction_hash": "2a09c3d79027721f2b8a78e2a936cbeda484bfe98a6e34856c1fee743b7e8906",
        "amount": "0.0000000",
        "price": "0.0001000",
        "price_r": {
          "n": 1,
          "d": 10000
        },
        "buying_asset_type": "native",
        "selling_asset_type": "credit_alphanum4",
        "selling_asset_code": "SLT",
        "selling_asset_issuer": "GCKA6K5PCQ6PNF5RQBF7PQDJWRHO6UOGFMRLK3DYHDOI244V47XKQ4GP",
        "offer_id": 126229445
      },
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/operations/113928152169844738"
          },
          "transaction": {
            "href": "https://horizon.stellar.org/transactions/2a09c3d79027721f2b8a78e2a936cbeda484bfe98a6e34856c1fee743b7e8906"
          },
          "effects": {
            "href": "https://horizon.stellar.org/operations/113928152169844738/effects"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=113928152169844738"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=113928152169844738"
          }
        },
        "id": "113928152169844738",
        "paging_token": "113928152169844738",
        "transaction_successful": true,
        "source_account": "GDO2BIMNH7T6MOJVPKEJHWAGMYGOQU5QMK5BKT5XMVWPZKHAGA4JNAQZ",
        "type": "manage_buy_offer",
        "type_i": 12,
        "created_at": "2019-10-28T19:44:09Z",
        "transaction_hash": "2a09c3d79027721f2b8a78e2a936cbeda484bfe98a6e34856c1fee743b7e8906",
        "amount": "0.0000000",
        "price": "0.0001000",
        "price_r": {
          "n": 1,
          "d": 10000
        },
        "buying_asset_type": "native",
        "selling_asset_type": "credit_alphanum4",
        "selling_asset_code": "SLT",
        "selling_asset_issuer": "GCKA6K5PCQ6PNF5RQBF7PQDJWRHO6UOGFMRLK3DYHDOI244V47XKQ4GP",
        "offer_id": 126229446
      },
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/operations/113928152169844739"
          },
          "transaction": {
            "href": "https://horizon.stellar.org/transactions/2a09c3d79027721f2b8a78e2a936cbeda484bfe98a6e34856c1fee743b7e8906"
          },
          "effects": {
            "href": "https://horizon.stellar.org/operations/113928152169844739/effects"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=113928152169844739"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=113928152169844739"
          }
        },
        "id": "113928152169844739",
        "paging_token": "113928152169844739",
        "transaction_successful": true,
        "source_account": "GDO2BIMNH7T6MOJVPKEJHWAGMYGOQU5QMK5BKT5XMVWPZKHAGA4JNAQZ",
        "type": "manage_buy_offer",
        "type_i": 12,
        "created_at": "2019-10-28T19:44:09Z",
        "transaction_hash": "2a09c3d79027721f2b8a78e2a936cbeda484bfe98a6e34856c1fee743b7e8906",
        "amount": "0.0000000",
        "price": "0.0001000",
        "price_r": {
          "n": 1,
          "d": 10000
        },
        "buying_asset_type": "native",
        "selling_asset_type": "credit_alphanum4",
        "selling_asset_code": "SLT",
        "selling_asset_issuer": "GCKA6K5PCQ6PNF5RQBF7PQDJWRHO6UOGFMRLK3DYHDOI244V47XKQ4GP",
        "offer_id": 126229447
      },
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/operations/113928152169844740"
          },
          "transaction": {
            "href": "https://horizon.stellar.org/transactions/2a09c3d79027721f2b8a78e2a936cbeda484bfe98a6e34856c1fee743b7e8906"
          },
          "effects": {
            "href": "https://horizon.stellar.org/operations/113928152169844740/effects"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=113928152169844740"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=113928152169844740"
          }
        },
        "id": "113928152169844740",
        "paging_token": "113928152169844740",
        "transaction_successful": true,
        "source_account": "GDO2BIMNH7T6MOJVPKEJHWAGMYGOQU5QMK5BKT5XMVWPZKHAGA4JNAQZ",
        "type": "manage_buy_offer",
        "type_i": 12,
        "created_at": "2019-10-28T19:44:09Z",
        "transaction_hash": "2a09c3d79027721f2b8a78e2a936cbeda484bfe98a6e34856c1fee743b7e8906",
        "amount": "0.0000000",
        "price": "0.0001000",
        "price_r": {
          "n": 1,
          "d": 10000
        },
        "buying_asset_type": "native",
        "selling_asset_type": "credit_alphanum4",
        "selling_asset_code": "SLT",
        "selling_asset_issuer": "GCKA6K5PCQ6PNF5RQBF7PQDJWRHO6UOGFMRLK3DYHDOI244V47XKQ4GP",
        "offer_id": 126229448
      },
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/operations/113928152169844741"
          },
          "transaction": {
            "href": "https://horizon.stellar.org/transactions/2a09c3d79027721f2b8a78e2a936cbeda484bfe98a6e34856c1fee743b7e8906"
          },
          "effects": {
            "href": "https://horizon.stellar.org/operations/113928152169844741/effects"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=113928152169844741"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=113928152169844741"
          }
        },
        "id": "113928152169844741",
        "paging_token": "113928152169844741",
        "transaction_successful": true,
        "source_account": "GDO2BIMNH7T6MOJVPKEJHWAGMYGOQU5QMK5BKT5XMVWPZKHAGA4JNAQZ",
        "type": "manage_buy_offer",
        "type_i": 12,
        "created_at": "2019-10-28T19:44:09Z",
        "transaction_hash": "2a09c3d79027721f2b8a78e2a936cbeda484bfe98a6e34856c1fee743b7e8906",
        "amount": "0.0000000",
        "price": "0.0001000",
        "price_r": {
          "n": 1,
          "d": 10000
        },
        "buying_asset_type": "native",
        "selling_asset_type": "credit_alphanum4",
        "selling_asset_code": "SLT",
        "selling_asset_issuer": "GCKA6K5PCQ6PNF5RQBF7PQDJWRHO6UOGFMRLK3DYHDOI244V47XKQ4GP",
        "offer_id": 126229449
      }
    ]
  }
}

Resources

Data on the Stellar ledger is organized according to resources. Each resource has several different endpoints.


Ledgers

Each ledger stores the state of the network at a point in time and contains all the changes - transactions, operations, effects, etc. - to that state.

Learn more about ledgers.


The Ledger Object

When Horizon returns information about a ledger, it uses the following format:

  • ATTRIBUTEDATA TYPE

    DESCRIPTION

  • idstring

    A unique identifier for this ledger.

  • paging_tokennumber

    A cursor value for use in pagination.

  • hashstring

    A hex-encoded SHA-256 hash of this ledger’s XDR-encoded form.

  • prev_hashstring

    The hash of the ledger immediately preceding this ledger.

  • sequencenumber

    The sequence number of this ledger, and the parameter used in Horizon calls that require a ledger number.

  • successful_transaction_countnumber

    The number of successful transactions in this ledger.

  • failed_transaction_countnumber

    The number of failed transactions in this ledger.

  • operation_countnumber

    The number of operations applied in this ledger.

  • closed_atstring

    An ISO 8601 formatted string of when this ledger was closed.

  • total_coinsstring

    The total number of lumens in circulation.

  • fee_poolstring

    The sum of all transaction fees.

  • base_fee_in_stroopsnumber

    The fee the network charges per operation in a transaction.

  • base_reserve_in_stroopsnumber

    The reserve the network uses when calculating an account’s minimum balance.

  • max_tx_set_sizenumber

    The maximum number of transactions validators have agreed to process in a given ledger.

  • protocol_versionnumber

    The protocol version that the Stellar network was running when this ledger was committed.

  • header_xdrstring

    A base64 encoded string of the raw LedgerHeader xdr struct for this ledger.

Example
{
  "_links": {
    "self": {
      "href": "https://horizon.stellar.org/ledgers/26857634"
    },
    "transactions": {
      "href": "https://horizon.stellar.org/ledgers/26857634/transactions{?cursor,limit,order}",
      "templated": true
    },
    "operations": {
      "href": "https://horizon.stellar.org/ledgers/26857634/operations{?cursor,limit,order}",
      "templated": true
    },
    "payments": {
      "href": "https://horizon.stellar.org/ledgers/26857634/payments{?cursor,limit,order}",
      "templated": true
    },
    "effects": {
      "href": "https://horizon.stellar.org/ledgers/26857634/effects{?cursor,limit,order}",
      "templated": true
    }
  },
  "id": "548393ec23959e1959a62f003029ecf96be89e13df036073bf64918996ec4227",
  "paging_token": "115352659677937664",
  "hash": "548393ec23959e1959a62f003029ecf96be89e13df036073bf64918996ec4227",
  "prev_hash": "446d6eca81dd6db6daf50d93ca9d297bd60b1233b91de3765cccdf503cfffcb0",
  "sequence": 26857634,
  "successful_transaction_count": 27,
  "failed_transaction_count": 1,
  "operation_count": 133,
  "closed_at": "2019-11-18T19:27:21Z",
  "total_coins": "105443902087.3472865",
  "fee_pool": "1807038.9789761",
  "base_fee_in_stroops": 100,
  "base_reserve_in_stroops": 5000000,
  "max_tx_set_size": 1000,
  "protocol_version": 12,
  "header_xdr": "AAAADERtbsqB3W222vUNk8qdKXvWCxIzuR3jdlzM31A8//ywoQieYsSc05/BpgEqnLR7fKXz7t0K42V7NOjbGZA/wTEAAAAAXdLwmQAAAAAAAAAAplf68mTg/Z/DDyEZeLCoNbJnMZm4SYsYWjUjuDOSfPeRNFE4n9Hm19yKutjwVurFjk72JKVHI8J+ELwLZgWsywGZ0KIOoh6z7HlbYQAAEG9XKhRBAAABFgAAAAAH9M6YAAAAZABMS0AAAAPop9+CeMs1/7BHgFltiQPH+VT+ACYb5P0lSXh7RpBLtd34kEpeL8qKJxYz4ufmkQ2lEv/HMR/i3bi1Rt0PYj185/0kAZ3ZRbmm2mVRMzmaCOak1rn2vejHXDh+MGlr6D6vI2tc/M6VIumTKUa7SgumWDyW0r5FcJTbu/FXDQ/6C4YAAAAA"
}

Retrieve a Ledger

The single ledger endpoint provides information on a specific ledger.

GET/ledgers/:ledger_sequence
  • ARGUMENTREQUIRED

    DESCRIPTION

  • sequencerequired

    The sequence number of a specific ledger.

Example Request
curl "https://horizon.stellar.org/ledgers/69859"
Example Response
  "_links": {
    "self": {
      "href": "https://horizon.stellar.org/ledgers/27146933"
    },
    "transactions": {
      "href": "https://horizon.stellar.org/ledgers/27146933/transactions{?cursor,limit,order}",
      "templated": true
    },
    "operations": {
      "href": "https://horizon.stellar.org/ledgers/27146933/operations{?cursor,limit,order}",
      "templated": true
    },
    "payments": {
      "href": "https://horizon.stellar.org/ledgers/27146933/payments{?cursor,limit,order}",
      "templated": true
    },
    "effects": {
      "href": "https://horizon.stellar.org/ledgers/27146933/effects{?cursor,limit,order}",
      "templated": true
    }
  },
  "id": "e1218a337cecda05526fba902c61d3d7130baa58d8db41f544bf563f779b6329",
  "paging_token": "116595189421703168",
  "hash": "e1218a337cecda05526fba902c61d3d7130baa58d8db41f544bf563f779b6329",
  "prev_hash": "9eac16fecd885147067b58b7684f60d216f931b813f651265bbc97de4cea313d",
  "sequence": 27146933,
  "successful_transaction_count": 26,
  "failed_transaction_count": 9,
  "operation_count": 67,
  "closed_at": "2019-12-06T22:39:32Z",
  "total_coins": "105443902087.3472865",
  "fee_pool": "1807264.7509661",
  "base_fee_in_stroops": 100,
  "base_reserve_in_stroops": 5000000,
  "max_tx_set_size": 1000,
  "protocol_version": 12,
  "header_xdr": "AAAADJ6sFv7NiFFHBntYt2hPYNIW+TG4E/ZRJlu8l95M6jE9bsvzId+Gtul2mNMW4UZQ+KqSb/nbN8F1CTxAfQsyUy8AAAAAXerYpAAAAAAAAAAAXQNpS8daKGZUeY5quYUcIiJZBMB7LiLsZJsEx9qw79fx99Bu/lk+sIePNUNcuOC2euthzfhLuWJ1nZBuoQFDjgGeOrUOoh6z7HlbYQAAEG/dvCadAAABFgAAAAAIOwAqAAAAZABMS0AAAAPooSNtHXJNJKKWlBtgkAM1LBxzlzYjIlS0xwpjP+uCi76fQj59wgTy0+xtx7O1qTb+W6zcI2zWZnrUU/8v8RZHFBfoo20QYKh95+wWr348yZAexZpdrjhyCxbChxlVTZOX6nZfIgcYBMnZRkOTCLdPO76yeqpDhqu9KrPe3YPTO3wAAAAA"
}

Retrieve a Ledger's Transactions

This endpoint represents successful transactions in a given ledger.

GET/ledgers/:ledger_sequence/transactions?cursor={paging_token}&order={asc,desc}&limit={1-200}&include_failed{true,false}
  • ARGUMENTREQUIRED

    DESCRIPTION

  • sequencerequired

    The sequence number of a specific ledger.

  • cursoroptional

    A number that points to a specific location in a collection of responses and is pulled from the paging_token value of a record.

  • orderoptional

    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.

  • limitoptional

    The total 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.

  • include_failedoptional

    Set to true to include failed transactions in results. Options include true and false.

Example Request
curl "https://horizon.stellar.org/ledgers/27147222/transactions?limit=2"
Example Response
{
  "_links": {
    "self": {
      "href": "https://horizon.stellar.org/ledgers/27147222/transactions?cursor=\u0026limit=2\u0026order=asc"
    },
    "next": {
      "href": "https://horizon.stellar.org/ledgers/27147222/transactions?cursor=116596430667259904\u0026limit=2\u0026order=asc"
    },
    "prev": {
      "href": "https://horizon.stellar.org/ledgers/27147222/transactions?cursor=116596430667255808\u0026limit=2\u0026order=desc"
    }
  },
  "_embedded": {
    "records": [
      {
        "memo": "FadBcV0owHrsLQif/V2TxZKGA2YiX+MoifI7oB/UjJM=",
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/transactions/3a644389bbec63dd2b107a03c16711563fc549daa7b7f56f951a2e470f81f2e0"
          },
          "account": {
            "href": "https://horizon.stellar.org/accounts/GBKTEASNXABG2NC4TY6N3IA5UFC6YW53Y4KTIKY3CUEKQ2W5EIYRMYVB"
          },
          "ledger": {
            "href": "https://horizon.stellar.org/ledgers/27147222"
          },
          "operations": {
            "href": "https://horizon.stellar.org/transactions/3a644389bbec63dd2b107a03c16711563fc549daa7b7f56f951a2e470f81f2e0/operations{?cursor,limit,order}",
            "templated": true
          },
          "effects": {
            "href": "https://horizon.stellar.org/transactions/3a644389bbec63dd2b107a03c16711563fc549daa7b7f56f951a2e470f81f2e0/effects{?cursor,limit,order}",
            "templated": true
          },
          "precedes": {
            "href": "https://horizon.stellar.org/transactions?order=asc\u0026cursor=116596430667255808"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/transactions?order=desc\u0026cursor=116596430667255808"
          }
        },
        "id": "3a644389bbec63dd2b107a03c16711563fc549daa7b7f56f951a2e470f81f2e0",
        "paging_token": "116596430667255808",
        "successful": true,
        "hash": "3a644389bbec63dd2b107a03c16711563fc549daa7b7f56f951a2e470f81f2e0",
        "ledger": 27147222,
        "created_at": "2019-12-06T23:05:38Z",
        "source_account": "GBKTEASNXABG2NC4TY6N3IA5UFC6YW53Y4KTIKY3CUEKQ2W5EIYRMYVB",
        "source_account_sequence": "113943107245989112",
        "fee_paid": 100,
        "fee_charged": 100,
        "max_fee": 100,
        "operation_count": 1,
        "envelope_xdr": "AAAAAFUyAk24Am00XJ483aAdoUXsW7vHFTQrGxUIqGrdIjEWAAAAZAGUzqcAAFz4AAAAAQAAAAAAAAAAAAAAAAAAAAAAAAADFadBcV0owHrsLQif/V2TxZKGA2YiX+MoifI7oB/UjJMAAAABAAAAAQAAAADhZHiqD/Q3uSTgjYEWGVRfCCHYvFmeqJU12G9SkzJYEQAAAAEAAAAAB77j4CQxLlm5aPrq/PDwFhGNs2ldqbdCZwkSfzXhUhYAAAABTk9ETAAAAAB1jYLXrFzNBOWCoPnZSHI3PJAhHtc1TrCaiPuZwSf5pgAAAAAAAABNAAAAAAAAAALw9Tl2AAAAQLSLnL3XT3F6dq5m2WHZ7tH3HBrK/e+p2G7Hrl3WXQToUsgxKIRH6bhHT/mIWwnrfLZ9nlVjMCFoZPqVKrI2lgLdIjEWAAAAQCrZ9IbjDAB408VgQaqNpwX8hXr/OUsoEexkWGkN9PjcBG2nf4bKWdbjiaqHZ+LrvM+DdmhxtA3L9bzmCie8NgA=",
        "result_xdr": "AAAAAAAAAGQAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAA=",
        "result_meta_xdr": "AAAAAQAAAAIAAAADAZ471gAAAAAAAAAAVTICTbgCbTRcnjzdoB2hRexbu8cVNCsbFQioat0iMRYAAAAAB5tToAGUzqcAAFz3AAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAABAZ471gAAAAAAAAAAVTICTbgCbTRcnjzdoB2hRexbu8cVNCsbFQioat0iMRYAAAAAB5tToAGUzqcAAFz4AAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAABAAAAAMBnju+AAAAAQAAAAAHvuPgJDEuWblo+ur88PAWEY2zaV2pt0JnCRJ/NeFSFgAAAAFOT0RMAAAAAHWNgtesXM0E5YKg+dlIcjc8kCEe1zVOsJqI+5nBJ/mmAAAAAAAIP38ASptjhEiAAAAAAAEAAAAAAAAAAAAAAAEBnjvWAAAAAQAAAAAHvuPgJDEuWblo+ur88PAWEY2zaV2pt0JnCRJ/NeFSFgAAAAFOT0RMAAAAAHWNgtesXM0E5YKg+dlIcjc8kCEe1zVOsJqI+5nBJ/mmAAAAAAAIP8wASptjhEiAAAAAAAEAAAAAAAAAAAAAAAMBnjvVAAAAAQAAAADhZHiqD/Q3uSTgjYEWGVRfCCHYvFmeqJU12G9SkzJYEQAAAAFOT0RMAAAAAHWNgtesXM0E5YKg+dlIcjc8kCEe1zVOsJqI+5nBJ/mmAAAALEhqMpZ//////////wAAAAEAAAAAAAAAAAAAAAEBnjvWAAAAAQAAAADhZHiqD/Q3uSTgjYEWGVRfCCHYvFmeqJU12G9SkzJYEQAAAAFOT0RMAAAAAHWNgtesXM0E5YKg+dlIcjc8kCEe1zVOsJqI+5nBJ/mmAAAALEhqMkl//////////wAAAAEAAAAAAAAAAA==",
        "fee_meta_xdr": "AAAAAgAAAAMBnjvKAAAAAAAAAABVMgJNuAJtNFyePN2gHaFF7Fu7xxU0KxsVCKhq3SIxFgAAAAAHm1QEAZTOpwAAXPcAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAEBnjvWAAAAAAAAAABVMgJNuAJtNFyePN2gHaFF7Fu7xxU0KxsVCKhq3SIxFgAAAAAHm1OgAZTOpwAAXPcAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA==",
        "memo_type": "hash",
        "signatures": [
          "tIucvddPcXp2rmbZYdnu0fccGsr976nYbseuXdZdBOhSyDEohEfpuEdP+YhbCet8tn2eVWMwIWhk+pUqsjaWAg==",
          "Ktn0huMMAHjTxWBBqo2nBfyFev85SygR7GRYaQ30+NwEbad/hspZ1uOJqodn4uu8z4N2aHG0Dcv1vOYKJ7w2AA=="
        ],
        "valid_after": "1970-01-01T00:00:00Z"
      },
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/transactions/83eabfa824b57436eda49bb9ac28675285f6d945325f69db41792078a83d3479"
          },
          "account": {
            "href": "https://horizon.stellar.org/accounts/GDUHYA43LEQWXLJ5GQGNDJHZY6TZN2OK3KA4YQXQ47BRMRDRIUUC4IU5"
          },
          "ledger": {
            "href": "https://horizon.stellar.org/ledgers/27147222"
          },
          "operations": {
            "href": "https://horizon.stellar.org/transactions/83eabfa824b57436eda49bb9ac28675285f6d945325f69db41792078a83d3479/operations{?cursor,limit,order}",
            "templated": true
          },
          "effects": {
            "href": "https://horizon.stellar.org/transactions/83eabfa824b57436eda49bb9ac28675285f6d945325f69db41792078a83d3479/effects{?cursor,limit,order}",
            "templated": true
          },
          "precedes": {
            "href": "https://horizon.stellar.org/transactions?order=asc\u0026cursor=116596430667259904"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/transactions?order=desc\u0026cursor=116596430667259904"
          }
        },
        "id": "83eabfa824b57436eda49bb9ac28675285f6d945325f69db41792078a83d3479",
        "paging_token": "116596430667259904",
        "successful": true,
        "hash": "83eabfa824b57436eda49bb9ac28675285f6d945325f69db41792078a83d3479",
        "ledger": 27147222,
        "created_at": "2019-12-06T23:05:38Z",
        "source_account": "GDUHYA43LEQWXLJ5GQGNDJHZY6TZN2OK3KA4YQXQ47BRMRDRIUUC4IU5",
        "source_account_sequence": "113383696345604336",
        "fee_paid": 100,
        "fee_charged": 100,
        "max_fee": 100,
        "operation_count": 1,
        "envelope_xdr": "AAAAAOh8A5tZIWutPTQM0aT5x6eW6cragcxC8OfDFkRxRSguAAAAZAGS0d8AACDwAAAAAQAAAAAAAAAAAAAAAF3q3zYAAAAAAAAAAQAAAAEAAAAASe2g7z3OqB0F+vr+sM6vGMHgnomyJOLJeGMMjT1jgPcAAAADAAAAAVJNVAAAAAAAyGdd4j3sXGNb4PWMyeROuBvzRJJbU+On/O1oSxFvcqwAAAAAAAAAAAAAABcAB2UNAJiWgAAAAAAAAAAAAAAAAAAAAAJxRSguAAAAQG/ksOk2naI/PrA/6qes3c0IhoOpnBghd038S62rayiophPSs3HyUbgbOEpYQCkJezrf1bP+s2fFXVCEXbgveQk9Y4D3AAAAQAINPdxGV1VIeQ1OUDDlqtrSy8FrWQ/+CtRxqVHcHg98SYh5co/gd83R4IGDxukCByTbYapkrUOD0XDJKC/hcg4=",
        "result_xdr": "AAAAAAAAAGQAAAAAAAAAAQAAAAAAAAADAAAAAAAAAAAAAAACAAAAAA==",
        "result_meta_xdr": "AAAAAQAAAAIAAAADAZ471gAAAAAAAAAA6HwDm1kha609NAzRpPnHp5bpytqBzELw58MWRHFFKC4AAAAAAKovMAGS0d8AACDvAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAABAZ471gAAAAAAAAAA6HwDm1kha609NAzRpPnHp5bpytqBzELw58MWRHFFKC4AAAAAAKovMAGS0d8AACDwAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAAAA==",
        "fee_meta_xdr": "AAAAAgAAAAMBnjukAAAAAAAAAADofAObWSFrrT00DNGk+cenlunK2oHMQvDnwxZEcUUoLgAAAAAAqi+UAZLR3wAAIO8AAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAEBnjvWAAAAAAAAAADofAObWSFrrT00DNGk+cenlunK2oHMQvDnwxZEcUUoLgAAAAAAqi8wAZLR3wAAIO8AAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA==",
        "memo_type": "none",
        "signatures": [
          "b+Sw6Tadoj8+sD/qp6zdzQiGg6mcGCF3TfxLratrKKimE9KzcfJRuBs4SlhAKQl7Ot/Vs/6zZ8VdUIRduC95CQ==",
          "Ag093EZXVUh5DU5QMOWq2tLLwWtZD/4K1HGpUdweD3xJiHlyj+B3zdHggYPG6QIHJNthqmStQ4PRcMkoL+FyDg=="
        ],
        "valid_after": "1970-01-01T00:00:00Z",
        "valid_before": "2019-12-06T23:07:34Z"
      }
    ]
  }
}

Retrieve a Ledger's Operations

This endpoint returns successful operations in a specific ledger.

GET/ledgers/:ledger_sequence/operations?cursor={paging_token}&order={asc,desc}&limit={1-200}&include_failed{true,false}&join={transactions}
  • ARGUMENTREQUIRED

    DESCRIPTION

  • ledger_sequencerequired

    The sequence number of a specific ledger.

  • cursoroptional

    A number that points to a specific location in a collection of responses and is pulled from the paging_token value of a record.

  • orderoptional

    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.

  • limitoptional

    The total 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.

  • include_failedoptional

    Set to true to include failed operations in results. Options include true and false.

  • joinoptional

    Set to transactions to include the transactions which created each of the operations in the response.

Example Request
curl "https://horizon.stellar.org/ledgers/27147222/operations?limit=2"
Example Response
{
  "_links": {
    "self": {
      "href": "https://horizon.stellar.org/ledgers/27147222/operations?cursor=\u0026limit=2\u0026order=asc"
    },
    "next": {
      "href": "https://horizon.stellar.org/ledgers/27147222/operations?cursor=116596430667259905\u0026limit=2\u0026order=asc"
    },
    "prev": {
      "href": "https://horizon.stellar.org/ledgers/27147222/operations?cursor=116596430667255809\u0026limit=2\u0026order=desc"
    }
  },
  "_embedded": {
    "records": [
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/operations/116596430667255809"
          },
          "transaction": {
            "href": "https://horizon.stellar.org/transactions/3a644389bbec63dd2b107a03c16711563fc549daa7b7f56f951a2e470f81f2e0"
          },
          "effects": {
            "href": "https://horizon.stellar.org/operations/116596430667255809/effects"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=116596430667255809"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=116596430667255809"
          }
        },
        "id": "116596430667255809",
        "paging_token": "116596430667255809",
        "transaction_successful": true,
        "source_account": "GDQWI6FKB72DPOJE4CGYCFQZKRPQQIOYXRMZ5KEVGXMG6UUTGJMBCASH",
        "type": "payment",
        "type_i": 1,
        "created_at": "2019-12-06T23:05:38Z",
        "transaction_hash": "3a644389bbec63dd2b107a03c16711563fc549daa7b7f56f951a2e470f81f2e0",
        "asset_type": "credit_alphanum4",
        "asset_code": "NODL",
        "asset_issuer": "GB2Y3AWXVROM2BHFQKQPTWKIOI3TZEBBD3LTKTVQTKEPXGOBE742NODL",
        "from": "GDQWI6FKB72DPOJE4CGYCFQZKRPQQIOYXRMZ5KEVGXMG6UUTGJMBCASH",
        "to": "GAD35Y7AEQYS4WNZND5OV7HQ6ALBDDNTNFO2TN2CM4ERE7ZV4FJBNXZ6",
        "amount": "0.0000077"
      },
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/operations/116596430667259905"
          },
          "transaction": {
            "href": "https://horizon.stellar.org/transactions/83eabfa824b57436eda49bb9ac28675285f6d945325f69db41792078a83d3479"
          },
          "effects": {
            "href": "https://horizon.stellar.org/operations/116596430667259905/effects"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=116596430667259905"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=116596430667259905"
          }
        },
        "id": "116596430667259905",
        "paging_token": "116596430667259905",
        "transaction_successful": true,
        "source_account": "GBE63IHPHXHKQHIF7L5P5MGOV4MMDYE6RGZCJYWJPBRQZDJ5MOAPOX7A",
        "type": "manage_offer",
        "type_i": 3,
        "created_at": "2019-12-06T23:05:38Z",
        "transaction_hash": "83eabfa824b57436eda49bb9ac28675285f6d945325f69db41792078a83d3479",
        "amount": "0.0000023",
        "price": "0.0484621",
        "price_r": {
          "n": 484621,
          "d": 10000000
        },
        "buying_asset_type": "native",
        "selling_asset_type": "credit_alphanum4",
        "selling_asset_code": "RMT",
        "selling_asset_issuer": "GDEGOXPCHXWFYY234D2YZSPEJ24BX42ESJNVHY5H7TWWQSYRN5ZKZE3N",
        "offer_id": 0
      }
    ]
  }
}

Retrieve a Ledger's Payments

This endpoint returns all payment-related operations in a specific ledger.

Operation types that can be returned by this endpoint include:

  • create_account
  • payment
  • path_payment
  • account_merge
GET/ledgers/:ledger_sequence/payments?cursor={paging_token}&order={asc,desc}&limit={1-200}&include_failed{true,false}&join={transactions}
  • ARGUMENTREQUIRED

    DESCRIPTION

  • ledger_sequencerequired

    The sequence number of a specific ledger.

  • cursoroptional

    A number that points to a specific location in a collection of responses and is pulled from the paging_token value of a record.

  • orderoptional

    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.

  • limitoptional

    The total 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.

  • include_failedoptional

    Set to true to include failed payments in results. Options include true and false.

  • joinoptional

    Set to transactions to include the transactions which created each of the payments in the response.

Example Request
curl "https://horizon.stellar.org/ledgers/27521176/payments?limit=1"
Example Response
{
  "_links": {
    "self": {
      "href": "https://horizon.stellar.org/ledgers/27521176/payments?cursor=\u0026limit=1\u0026order=asc"
    },
    "next": {
      "href": "https://horizon.stellar.org/ledgers/27521176/payments?cursor=118202550867476481\u0026limit=1\u0026order=asc"
    },
    "prev": {
      "href": "https://horizon.stellar.org/ledgers/27521176/payments?cursor=118202550867476481\u0026limit=1\u0026order=desc"
    }
  },
  "_embedded": {
    "records": [
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/operations/118202550867476481"
          },
          "transaction": {
            "href": "https://horizon.stellar.org/transactions/971454b84a82baa38afa975e9eb4ff2632821b5a3e7f7993a7e20bbd9d7633ea"
          },
          "effects": {
            "href": "https://horizon.stellar.org/operations/118202550867476481/effects"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=118202550867476481"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=118202550867476481"
          }
        },
        "id": "118202550867476481",
        "paging_token": "118202550867476481",
        "transaction_successful": true,
        "source_account": "GDQWI6FKB72DPOJE4CGYCFQZKRPQQIOYXRMZ5KEVGXMG6UUTGJMBCASH",
        "type": "payment",
        "type_i": 1,
        "created_at": "2019-12-30T22:35:49Z",
        "transaction_hash": "971454b84a82baa38afa975e9eb4ff2632821b5a3e7f7993a7e20bbd9d7633ea",
        "asset_type": "credit_alphanum4",
        "asset_code": "NODL",
        "asset_issuer": "GB2Y3AWXVROM2BHFQKQPTWKIOI3TZEBBD3LTKTVQTKEPXGOBE742NODL",
        "from": "GDQWI6FKB72DPOJE4CGYCFQZKRPQQIOYXRMZ5KEVGXMG6UUTGJMBCASH",
        "to": "GDGJS7AXAUFDZARIRDVZ5V7CFW6XY47WSBE2OVLCCGCDWOE7INKYN3PS",
        "amount": "0.0000017"
      }
    ]
  }
}

Transactions

Transactions are commands that modify the ledger state and consist of one or more operations.

Learn more about transactions.


The Transaction Object

When Horizon returns information about a transaction, it uses the following format:

  • ATTRIBUTEDATA TYPE

    DESCRIPTION

  • idstring

    A unique identifier for this transaction.

  • paging_tokennumber

    A cursor value for use in pagination.

  • successfulboolean

    Indicates if this transaction was successful or not.

  • hashstring

    A hex-encoded SHA-256 hash of this transaction’s XDR-encoded form.

  • ledgernumber

    The sequence number of the ledger that this transaction was included in.

  • created_atISO8601 string

    The date this transaction was created.

  • source_accountstring

    The originating account for this transaction.

  • source_account_sequencestring

    The source account’s sequence number that this transaction consumed.

  • fee_chargednumber

    The fee (in stroops) paid by the source account to apply this transaction to the ledger.

  • max_feenumber

    The maximum fee (in stroops) that the source account was willing to pay.

  • operation_countnumber

    The number of operations contained within this transaction.

  • envelope_xdrstring

    A base64 encoded string of the raw TransactionEnvelope XDR struct for this transaction.

  • result_xdrstring

    A base64 encoded string of the raw TransactionResult XDR struct for this transaction.

  • result_meta_xdrstring

    A base64 encoded string of the raw TransactionMeta XDR struct for this transaction

  • fee_meta_xdrstring

    A base64 encoded string of the raw LedgerEntryChanges XDR struct produced by taking fees for this transaction.

  • memostring

    The optional memo attached to a transaction.

  • memo_typestring

    The type of memo. Potential values include MEMO_TEXT, MEMO_ID, MEMO_HASH, MEMO_RETURN.

  • signaturesstring

    An array of signatures used to sign this transaction.

  • valid_afterRFC3339 date-time string

    The date after which a transaction is valid.

  • valid_beforeRFC3339 date-time string

    The date before which a transaction is valid.

Example
{
  "memo": "298424",
  "_links": {
    "self": {
      "href": "https://horizon.stellar.org/transactions/132c440e984ab97d895f3477015080aafd6c4375f6a70a87327f7f95e13c4e31"
    },
    "account": {
      "href": "https://horizon.stellar.org/accounts/GCO2IP3MJNUOKS4PUDI4C7LGGMQDJGXG3COYX3WSB4HHNAHKYV5YL3VC"
    },
    "ledger": {
      "href": "https://horizon.stellar.org/ledgers/27956256"
    },
    "operations": {
      "href": "https://horizon.stellar.org/transactions/132c440e984ab97d895f3477015080aafd6c4375f6a70a87327f7f95e13c4e31/operations{?cursor,limit,order}",
      "templated": true
    },
    "effects": {
      "href": "https://horizon.stellar.org/transactions/132c440e984ab97d895f3477015080aafd6c4375f6a70a87327f7f95e13c4e31/effects{?cursor,limit,order}",
      "templated": true
    },
    "precedes": {
      "href": "https://horizon.stellar.org/transactions?order=asc\u0026cursor=120071205238677504"
    },
    "succeeds": {
      "href": "https://horizon.stellar.org/transactions?order=desc\u0026cursor=120071205238677504"
    }
  },
  "id": "132c440e984ab97d895f3477015080aafd6c4375f6a70a87327f7f95e13c4e31",
  "paging_token": "120071205238677504",
  "successful": true,
  "hash": "132c440e984ab97d895f3477015080aafd6c4375f6a70a87327f7f95e13c4e31",
  "ledger": 27956256,
  "created_at": "2020-01-27T22:13:17Z",
  "source_account": "GCO2IP3MJNUOKS4PUDI4C7LGGMQDJGXG3COYX3WSB4HHNAHKYV5YL3VC",
  "source_account_sequence": "64034663849209932",
  "fee_paid": 100,
  "fee_charged": 100,
  "max_fee": 100,
  "operation_count": 1,
  "envelope_xdr": "AAAAAJ2kP2xLaOVLj6DRwX1mMyA0mubYnYvu0g8OdoDqxXuFAAAAZADjfzAACzBMAAAAAQAAAAAAAAAAAAAAAF4vYIYAAAABAAAABjI5ODQyNAAAAAAAAQAAAAAAAAABAAAAAKdeYELovtcnTxqPEVsdbxHLMoMRalZsK7lo/+3ARzUZAAAAAAAAAADUFJPYAAAAAAAAAAHqxXuFAAAAQBpLpQyh+mwDd5nDSxTaAh5wopBBUaSD1eOK9MdiO+4kWKVTqSr/Ko3kYE/+J42Opsewf81TwINONPbY2CtPggE=",
  "result_xdr": "AAAAAAAAAGQAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAA=",
  "result_meta_xdr": "AAAAAQAAAAIAAAADAaqUIAAAAAAAAAAAnaQ/bEto5UuPoNHBfWYzIDSa5tidi+7SDw52gOrFe4UAAkRg8uGCXADjfzAACzBLAAAAAAAAAAEAAAAAnaQ/bEto5UuPoNHBfWYzIDSa5tidi+7SDw52gOrFe4UAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAABAaqUIAAAAAAAAAAAnaQ/bEto5UuPoNHBfWYzIDSa5tidi+7SDw52gOrFe4UAAkRg8uGCXADjfzAACzBMAAAAAAAAAAEAAAAAnaQ/bEto5UuPoNHBfWYzIDSa5tidi+7SDw52gOrFe4UAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAABAAAAAMBqoicAAAAAAAAAACnXmBC6L7XJ08ajxFbHW8RyzKDEWpWbCu5aP/twEc1GQAAAAAAmwWMAaVkEgAAAC0AAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAEBqpQgAAAAAAAAAACnXmBC6L7XJ08ajxFbHW8RyzKDEWpWbCu5aP/twEc1GQAAAADUr5lkAaVkEgAAAC0AAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAMBqpQgAAAAAAAAAACdpD9sS2jlS4+g0cF9ZjMgNJrm2J2L7tIPDnaA6sV7hQACRGDy4YJcAON/MAALMEwAAAAAAAAAAQAAAACdpD9sS2jlS4+g0cF9ZjMgNJrm2J2L7tIPDnaA6sV7hQAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAEBqpQgAAAAAAAAAACdpD9sS2jlS4+g0cF9ZjMgNJrm2J2L7tIPDnaA6sV7hQACRGAezO6EAON/MAALMEwAAAAAAAAAAQAAAACdpD9sS2jlS4+g0cF9ZjMgNJrm2J2L7tIPDnaA6sV7hQAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA==",
  "fee_meta_xdr": "AAAAAgAAAAMBqpQYAAAAAAAAAACdpD9sS2jlS4+g0cF9ZjMgNJrm2J2L7tIPDnaA6sV7hQACRGDy4YLAAON/MAALMEsAAAAAAAAAAQAAAACdpD9sS2jlS4+g0cF9ZjMgNJrm2J2L7tIPDnaA6sV7hQAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAEBqpQgAAAAAAAAAACdpD9sS2jlS4+g0cF9ZjMgNJrm2J2L7tIPDnaA6sV7hQACRGDy4YJcAON/MAALMEsAAAAAAAAAAQAAAACdpD9sS2jlS4+g0cF9ZjMgNJrm2J2L7tIPDnaA6sV7hQAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA==",
  "memo_type": "text",
  "signatures": [
    "GkulDKH6bAN3mcNLFNoCHnCikEFRpIPV44r0x2I77iRYpVOpKv8qjeRgT/4njY6mx7B/zVPAg0409tjYK0+CAQ=="
  ],
  "valid_after": "1970-01-01T00:00:00Z",
  "valid_before": "2020-01-27T22:13:26Z"
}

Retrieve a Transaction

The single transaction endpoint provides information on a specific transaction.

GET/transactions/:transaction_id
  • ARGUMENTREQUIRED

    DESCRIPTION

  • hashrequired

    A hex-encoded SHA-256 hash of this transaction’s XDR-encoded form.

Example Request
curl "https://horizon.stellar.org/transactions/5ebd5c0af4385500b53dd63b0ef5f6e8feef1a7e1c86989be3cdcce825f3c0cc"
Example Response
{
  "_links": {
    "self": {
      "href": "https://horizon.stellar.org/transactions/5ebd5c0af4385500b53dd63b0ef5f6e8feef1a7e1c86989be3cdcce825f3c0cc"
    },
    "account": {
      "href": "https://horizon.stellar.org/accounts/GDI5EK4HNMBHJJQGP3GUXQJIIOHU2CJO3LABPWD6WYSPJZP5NP67TMNN"
    },
    "ledger": {
      "href": "https://horizon.stellar.org/ledgers/27963785"
    },
    "operations": {
      "href": "https://horizon.stellar.org/transactions/5ebd5c0af4385500b53dd63b0ef5f6e8feef1a7e1c86989be3cdcce825f3c0cc/operations{?cursor,limit,order}",
      "templated": true
    },
    "effects": {
      "href": "https://horizon.stellar.org/transactions/5ebd5c0af4385500b53dd63b0ef5f6e8feef1a7e1c86989be3cdcce825f3c0cc/effects{?cursor,limit,order}",
      "templated": true
    },
    "precedes": {
      "href": "https://horizon.stellar.org/transactions?order=asc\u0026cursor=120103542047408128"
    },
    "succeeds": {
      "href": "https://horizon.stellar.org/transactions?order=desc\u0026cursor=120103542047408128"
    }
  },
  "id": "5ebd5c0af4385500b53dd63b0ef5f6e8feef1a7e1c86989be3cdcce825f3c0cc",
  "paging_token": "120103542047408128",
  "successful": true,
  "hash": "5ebd5c0af4385500b53dd63b0ef5f6e8feef1a7e1c86989be3cdcce825f3c0cc",
  "ledger": 27963785,
  "created_at": "2020-01-28T10:03:33Z",
  "source_account": "GDI5EK4HNMBHJJQGP3GUXQJIIOHU2CJO3LABPWD6WYSPJZP5NP67TMNN",
  "source_account_sequence": "65046128646685383",
  "fee_paid": 100,
  "fee_charged": 100,
  "max_fee": 100,
  "operation_count": 1,
  "envelope_xdr": "AAAAANHSK4drAnSmBn7NS8EoQ49NCS7awBfYfrYk9OX9a/35AAAAZADnFxwAAALHAAAAAAAAAAAAAAABAAAAAQAAAADR0iuHawJ0pgZ+zUvBKEOPTQku2sAX2H62JPTl/Wv9+QAAAAEAAAAA+qpaPAsU/CGcSeS4KnvqE9y+Bcjhyr1l6jiwixRsvu8AAAABTkdOVAAAAAAs4YIuYne69wMuNtfiZ64gb7E3qnTR7A4yD4jZDSS8AQAAAdGpSiAAAAAAAAAAAAH9a/35AAAAQM5LSBiFRQKtFYRPpNabwVuvIhZSVRDaajf0KzYaqJmgaXAlFaTOYyYc11YuxUM1Fzl1VT4UEbI22BvO/8HzUgQ=",
  "result_xdr": "AAAAAAAAAGQAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAA=",
  "result_meta_xdr": "AAAAAQAAAAIAAAADAaqxiQAAAAAAAAAA0dIrh2sCdKYGfs1LwShDj00JLtrAF9h+tiT05f1r/fkAAAAAAhWQlADnFxwAAALGAAAAAQAAAAEAAAAAhD8BLsZFQEF33rKS6YopQUT3b6iLBG4nspe68/DBNBYAAAAAAAAAAAEAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBqrGJAAAAAAAAAADR0iuHawJ0pgZ+zUvBKEOPTQku2sAX2H62JPTl/Wv9+QAAAAACFZCUAOcXHAAAAscAAAABAAAAAQAAAACEPwEuxkVAQXfespLpiilBRPdvqIsEbieyl7rz8ME0FgAAAAAAAAAAAQAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAQAAAADAan62gAAAAEAAAAA+qpaPAsU/CGcSeS4KnvqE9y+Bcjhyr1l6jiwixRsvu8AAAABTkdOVAAAAAAs4YIuYne69wMuNtfiZ64gb7E3qnTR7A4yD4jZDSS8AQAAAAAAAAALf/////////8AAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBqrGJAAAAAQAAAAD6qlo8CxT8IZxJ5Lgqe+oT3L4FyOHKvWXqOLCLFGy+7wAAAAFOR05UAAAAACzhgi5id7r3Ay421+JnriBvsTeqdNHsDjIPiNkNJLwBAAAB0alKIAt//////////wAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwGp+6EAAAABAAAAANHSK4drAnSmBn7NS8EoQ49NCS7awBfYfrYk9OX9a/35AAAAAU5HTlQAAAAALOGCLmJ3uvcDLjbX4meuIG+xN6p00ewOMg+I2Q0kvAEAAAkQQwRXzX//////////AAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAaqxiQAAAAEAAAAA0dIrh2sCdKYGfs1LwShDj00JLtrAF9h+tiT05f1r/fkAAAABTkdOVAAAAAAs4YIuYne69wMuNtfiZ64gb7E3qnTR7A4yD4jZDSS8AQAABz6ZujfNf/////////8AAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
  "fee_meta_xdr": "AAAAAgAAAAMBqfuhAAAAAAAAAADR0iuHawJ0pgZ+zUvBKEOPTQku2sAX2H62JPTl/Wv9+QAAAAACFZD4AOcXHAAAAsYAAAABAAAAAQAAAACEPwEuxkVAQXfespLpiilBRPdvqIsEbieyl7rz8ME0FgAAAAAAAAAAAQAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQGqsYkAAAAAAAAAANHSK4drAnSmBn7NS8EoQ49NCS7awBfYfrYk9OX9a/35AAAAAAIVkJQA5xccAAACxgAAAAEAAAABAAAAAIQ/AS7GRUBBd96ykumKKUFE92+oiwRuJ7KXuvPwwTQWAAAAAAAAAAABAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=",
  "memo_type": "none",
  "signatures": [
    "zktIGIVFAq0VhE+k1pvBW68iFlJVENpqN/QrNhqomaBpcCUVpM5jJhzXVi7FQzUXOXVVPhQRsjbYG87/wfNSBA=="
  ]
}

Retrieve a Transaction's Operations

This endpoint returns successful operations for a specific transaction.

GET/transactions/:transaction_hash/operations?cursor={paging_token}&order={asc,desc}&limit={1-200}&include_failed{true,false}&join={transactions}
  • ARGUMENTREQUIRED

    DESCRIPTION

  • transaction_hashrequired

    A hex-encoded SHA-256 hash of this transaction’s XDR-encoded form.

  • cursoroptional

    A number that points to a specific location in a collection of responses and is pulled from the paging_token value of a record.

  • orderoptional

    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.

  • limitoptional

    The total 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.

  • include_failedoptional

    Set to true to include failed operations in results. Options include true and false.

  • joinoptional

    Set to transactions to include the transactions which created each of the operations in the response.

Example Request
curl "https://horizon.stellar.org/transactions/6b983a4e0dc3c04f4bd6b9037c55f70a09c434dfd01492be1077cf7ea68c2e4a/operations"
Example Response
{
  "_links": {
    "self": {
      "href": "https://horizon.stellar.org/transactions/6b983a4e0dc3c04f4bd6b9037c55f70a09c434dfd01492be1077cf7ea68c2e4a/operations?cursor=\u0026limit=10\u0026order=asc"
    },
    "next": {
      "href": "https://horizon.stellar.org/transactions/6b983a4e0dc3c04f4bd6b9037c55f70a09c434dfd01492be1077cf7ea68c2e4a/operations?cursor=120133379185221636\u0026limit=10\u0026order=asc"
    },
    "prev": {
      "href": "https://horizon.stellar.org/transactions/6b983a4e0dc3c04f4bd6b9037c55f70a09c434dfd01492be1077cf7ea68c2e4a/operations?cursor=120133379185221633\u0026limit=10\u0026order=desc"
    }
  },
  "_embedded": {
    "records": [
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/operations/120133379185221633"
          },
          "transaction": {
            "href": "https://horizon.stellar.org/transactions/6b983a4e0dc3c04f4bd6b9037c55f70a09c434dfd01492be1077cf7ea68c2e4a"
          },
          "effects": {
            "href": "https://horizon.stellar.org/operations/120133379185221633/effects"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=120133379185221633"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=120133379185221633"
          }
        },
        "id": "120133379185221633",
        "paging_token": "120133379185221633",
        "transaction_successful": true,
        "source_account": "GDJX67SFY2N73H72TWMKKBQP5UPBNKBNUMNE2IGFKNES43S4327X6DHG",
        "type": "manage_buy_offer",
        "type_i": 12,
        "created_at": "2020-01-28T21:14:59Z",
        "transaction_hash": "6b983a4e0dc3c04f4bd6b9037c55f70a09c434dfd01492be1077cf7ea68c2e4a",
        "amount": "0.0000000",
        "price": "0.0001000",
        "price_r": {
          "n": 1,
          "d": 10000
        },
        "buying_asset_type": "native",
        "selling_asset_type": "credit_alphanum4",
        "selling_asset_code": "ETH",
        "selling_asset_issuer": "GBDEVU63Y6NTHJQQZIKVTC23NWLQVP3WJ2RI2OTSJTNYOIGICST6DUXR",
        "offer_id": 149983118
      },
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/operations/120133379185221634"
          },
          "transaction": {
            "href": "https://horizon.stellar.org/transactions/6b983a4e0dc3c04f4bd6b9037c55f70a09c434dfd01492be1077cf7ea68c2e4a"
          },
          "effects": {
            "href": "https://horizon.stellar.org/operations/120133379185221634/effects"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=120133379185221634"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=120133379185221634"
          }
        },
        "id": "120133379185221634",
        "paging_token": "120133379185221634",
        "transaction_successful": true,
        "source_account": "GDJX67SFY2N73H72TWMKKBQP5UPBNKBNUMNE2IGFKNES43S4327X6DHG",
        "type": "manage_buy_offer",
        "type_i": 12,
        "created_at": "2020-01-28T21:14:59Z",
        "transaction_hash": "6b983a4e0dc3c04f4bd6b9037c55f70a09c434dfd01492be1077cf7ea68c2e4a",
        "amount": "0.0000000",
        "price": "0.0001000",
        "price_r": {
          "n": 1,
          "d": 10000
        },
        "buying_asset_type": "native",
        "selling_asset_type": "credit_alphanum4",
        "selling_asset_code": "ETH",
        "selling_asset_issuer": "GBDEVU63Y6NTHJQQZIKVTC23NWLQVP3WJ2RI2OTSJTNYOIGICST6DUXR",
        "offer_id": 149983119
      },
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/operations/120133379185221635"
          },
          "transaction": {
            "href": "https://horizon.stellar.org/transactions/6b983a4e0dc3c04f4bd6b9037c55f70a09c434dfd01492be1077cf7ea68c2e4a"
          },
          "effects": {
            "href": "https://horizon.stellar.org/operations/120133379185221635/effects"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=120133379185221635"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=120133379185221635"
          }
        },
        "id": "120133379185221635",
        "paging_token": "120133379185221635",
        "transaction_successful": true,
        "source_account": "GDJX67SFY2N73H72TWMKKBQP5UPBNKBNUMNE2IGFKNES43S4327X6DHG",
        "type": "manage_offer",
        "type_i": 3,
        "created_at": "2020-01-28T21:14:59Z",
        "transaction_hash": "6b983a4e0dc3c04f4bd6b9037c55f70a09c434dfd01492be1077cf7ea68c2e4a",
        "amount": "98.5005752",
        "price": "0.0003494",
        "price_r": {
          "n": 17471,
          "d": 50000000
        },
        "buying_asset_type": "credit_alphanum4",
        "buying_asset_code": "ETH",
        "buying_asset_issuer": "GBDEVU63Y6NTHJQQZIKVTC23NWLQVP3WJ2RI2OTSJTNYOIGICST6DUXR",
        "selling_asset_type": "native",
        "offer_id": 0
      },
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/operations/120133379185221636"
          },
          "transaction": {
            "href": "https://horizon.stellar.org/transactions/6b983a4e0dc3c04f4bd6b9037c55f70a09c434dfd01492be1077cf7ea68c2e4a"
          },
          "effects": {
            "href": "https://horizon.stellar.org/operations/120133379185221636/effects"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=120133379185221636"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=120133379185221636"
          }
        },
        "id": "120133379185221636",
        "paging_token": "120133379185221636",
        "transaction_successful": true,
        "source_account": "GDJX67SFY2N73H72TWMKKBQP5UPBNKBNUMNE2IGFKNES43S4327X6DHG",
        "type": "manage_buy_offer",
        "type_i": 12,
        "created_at": "2020-01-28T21:14:59Z",
        "transaction_hash": "6b983a4e0dc3c04f4bd6b9037c55f70a09c434dfd01492be1077cf7ea68c2e4a",
        "amount": "291.8057980",
        "price": "0.0002565",
        "price_r": {
          "n": 250039,
          "d": 975000000
        },
        "buying_asset_type": "native",
        "selling_asset_type": "credit_alphanum4",
        "selling_asset_code": "ETH",
        "selling_asset_issuer": "GBDEVU63Y6NTHJQQZIKVTC23NWLQVP3WJ2RI2OTSJTNYOIGICST6DUXR",
        "offer_id": 0
      }
    ]
  }
}

Retrieve a Transaction's Effects

This endpoint returns the effects of a specific transaction.

GET/transactions/:transaction_hash/effects?cursor={paging_token}&order={asc,desc}&limit={1-200}
  • ARGUMENTREQUIRED

    DESCRIPTION

  • transaction_hashrequired

    A hex-encoded SHA-256 hash of this transaction’s XDR-encoded form.

  • cursoroptional

    A number that points to a specific location in a collection of responses and is pulled from the paging_token value of a record.

  • orderoptional

    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.

  • limitoptional

    The total 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.

Example Request
curl "https://horizon.stellar.org/transactions/512a9946bc7ff4a363299f14f79e0beb9b9cdbd0103e3a69a44446a0aa6471a8/effects"
Example Response
{
  "_links": {
    "self": {
      "href": "https://horizon.stellar.org/transactions/512a9946bc7ff4a363299f14f79e0beb9b9cdbd0103e3a69a44446a0aa6471a8/effects?cursor=\u0026limit=10\u0026order=asc"
    },
    "next": {
      "href": "https://horizon.stellar.org/transactions/512a9946bc7ff4a363299f14f79e0beb9b9cdbd0103e3a69a44446a0aa6471a8/effects?cursor=121628667754319873-2\u0026limit=10\u0026order=asc"
    },
    "prev": {
      "href": "https://horizon.stellar.org/transactions/512a9946bc7ff4a363299f14f79e0beb9b9cdbd0103e3a69a44446a0aa6471a8/effects?cursor=121628667754319873-1\u0026limit=10\u0026order=desc"
    }
  },
  "_embedded": {
    "records": [
      {
        "_links": {
          "operation": {
            "href": "https://horizon.stellar.org/operations/121628667754319873"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=121628667754319873-1"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=121628667754319873-1"
          }
        },
        "id": "0121628667754319873-0000000001",
        "paging_token": "121628667754319873-1",
        "account": "GAHK7EEG2WWHVKDNT4CEQFZGKF2LGDSW2IVM4S5DP42RBW3K6BTODB4A",
        "type": "account_credited",
        "type_i": 2,
        "created_at": "2020-02-20T21:18:33Z",
        "asset_type": "native",
        "amount": "1573.5112616"
      },
      {
        "_links": {
          "operation": {
            "href": "https://horizon.stellar.org/operations/121628667754319873"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=121628667754319873-2"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=121628667754319873-2"
          }
        },
        "id": "0121628667754319873-0000000002",
        "paging_token": "121628667754319873-2",
        "account": "GA2XP4KMY4KWNPW4KUCUKYUF2J7Y6HO5HLPUEA3VPVSMYCM3TGNEZP5S",
        "type": "account_debited",
        "type_i": 3,
        "created_at": "2020-02-20T21:18:33Z",
        "asset_type": "native",
        "amount": "1573.5112616"
      }
    ]
  }
}

List All Transactions

This 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 to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known transaction unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream transactions created since your request time.

GET/transactions?cursor={paging_token}&order={asc,desc}&limit={1-200}&include_failed{true,false}
  • ARGUMENTREQUIRED

    DESCRIPTION

  • cursoroptional

    A number that points to a specific location in a collection of responses and is pulled from the paging_token value of a record.

  • orderoptional

    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.

  • limitoptional

    The total 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.

  • include_failedoptional

    Set to true to include failed operations in results. Options include true and false.

Example Request
curl "https://horizon.stellar.org/transactions?limit=3"
Example Response
{
  "_links": {
    "self": {
      "href": "https://horizon.stellar.org/transactions?cursor=\u0026limit=3\u0026order=asc"
    },
    "next": {
      "href": "https://horizon.stellar.org/transactions?cursor=33736968114176\u0026limit=3\u0026order=asc"
    },
    "prev": {
      "href": "https://horizon.stellar.org/transactions?cursor=12884905984\u0026limit=3\u0026order=desc"
    }
  },
  "_embedded": {
    "records": [
      {
        "memo": "hello world",
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/transactions/3389e9f0f1a65f19736cacf544c2e825313e8447f569233bb8db39aa607c8889"
          },
          "account": {
            "href": "https://horizon.stellar.org/accounts/GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN7"
          },
          "ledger": {
            "href": "https://horizon.stellar.org/ledgers/3"
          },
          "operations": {
            "href": "https://horizon.stellar.org/transactions/3389e9f0f1a65f19736cacf544c2e825313e8447f569233bb8db39aa607c8889/operations{?cursor,limit,order}",
            "templated": true
          },
          "effects": {
            "href": "https://horizon.stellar.org/transactions/3389e9f0f1a65f19736cacf544c2e825313e8447f569233bb8db39aa607c8889/effects{?cursor,limit,order}",
            "templated": true
          },
          "precedes": {
            "href": "https://horizon.stellar.org/transactions?order=asc\u0026cursor=12884905984"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/transactions?order=desc\u0026cursor=12884905984"
          }
        },
        "id": "3389e9f0f1a65f19736cacf544c2e825313e8447f569233bb8db39aa607c8889",
        "paging_token": "12884905984",
        "successful": true,
        "hash": "3389e9f0f1a65f19736cacf544c2e825313e8447f569233bb8db39aa607c8889",
        "ledger": 3,
        "created_at": "2015-09-30T17:15:54Z",
        "source_account": "GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN7",
        "source_account_sequence": "1",
        "fee_paid": 300,
        "fee_charged": 300,
        "max_fee": 300,
        "operation_count": 3,
        "envelope_xdr": "AAAAAAGUcmKO5465JxTSLQOQljwk2SfqAJmZSG6JH6wtqpwhAAABLAAAAAAAAAABAAAAAAAAAAEAAAALaGVsbG8gd29ybGQAAAAAAwAAAAAAAAAAAAAAABbxCy3mLg3hiTqX4VUEEp60pFOrJNxYM1JtxXTwXhY2AAAAAAvrwgAAAAAAAAAAAQAAAAAW8Qst5i4N4Yk6l+FVBBKetKRTqyTcWDNSbcV08F4WNgAAAAAN4Lazj4x61AAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABLaqcIQAAAEBKwqWy3TaOxoGnfm9eUjfTRBvPf34dvDA0Nf+B8z4zBob90UXtuCqmQqwMCyH+okOI3c05br3khkH0yP4kCwcE",
        "result_xdr": "AAAAAAAAASwAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAFAAAAAAAAAAA=",
        "result_meta_xdr": "AAAAAAAAAAMAAAACAAAAAAAAAAMAAAAAAAAAABbxCy3mLg3hiTqX4VUEEp60pFOrJNxYM1JtxXTwXhY2AAAAAAvrwgAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAGUcmKO5465JxTSLQOQljwk2SfqAJmZSG6JH6wtqpwhDeC2s5t4PNQAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAEAAAADAAAAAAAAAAABlHJijueOuScU0i0DkJY8JNkn6gCZmUhuiR+sLaqcIQAAAAAL68IAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAW8Qst5i4N4Yk6l+FVBBKetKRTqyTcWDNSbcV08F4WNgAAAAAL68IAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAAAAAAAW8Qst5i4N4Yk6l+FVBBKetKRTqyTcWDNSbcV08F4WNg3gtrObeDzUAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAwAAAAAAAAAAAZRyYo7njrknFNItA5CWPCTZJ+oAmZlIbokfrC2qnCEAAAAAC+vCAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=",
        "fee_meta_xdr": "AAAAAgAAAAMAAAABAAAAAAAAAAABlHJijueOuScU0i0DkJY8JNkn6gCZmUhuiR+sLaqcIQ3gtrOnZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAAAAAAABlHJijueOuScU0i0DkJY8JNkn6gCZmUhuiR+sLaqcIQ3gtrOnY/7UAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA==",
        "memo_type": "text",
        "signatures": [
          "SsKlst02jsaBp35vXlI300Qbz39+HbwwNDX/gfM+MwaG/dFF7bgqpkKsDAsh/qJDiN3NOW695IZB9Mj+JAsHBA=="
        ]
      },
      {
        "memo": "testpool,faucet,sdf",
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/transactions/2db4b22ca018119c5027a80578813ffcf582cda4aa9e31cd92b43cf1bda4fc5a"
          },
          "account": {
            "href": "https://horizon.stellar.org/accounts/GALPCCZN4YXA3YMJHKL6CVIECKPLJJCTVMSNYWBTKJW4K5HQLYLDMZTB"
          },
          "ledger": {
            "href": "https://horizon.stellar.org/ledgers/7841"
          },
          "operations": {
            "href": "https://horizon.stellar.org/transactions/2db4b22ca018119c5027a80578813ffcf582cda4aa9e31cd92b43cf1bda4fc5a/operations{?cursor,limit,order}",
            "templated": true
          },
          "effects": {
            "href": "https://horizon.stellar.org/transactions/2db4b22ca018119c5027a80578813ffcf582cda4aa9e31cd92b43cf1bda4fc5a/effects{?cursor,limit,order}",
            "templated": true
          },
          "precedes": {
            "href": "https://horizon.stellar.org/transactions?order=asc\u0026cursor=33676838572032"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/transactions?order=desc\u0026cursor=33676838572032"
          }
        },
        "id": "2db4b22ca018119c5027a80578813ffcf582cda4aa9e31cd92b43cf1bda4fc5a",
        "paging_token": "33676838572032",
        "successful": true,
        "hash": "2db4b22ca018119c5027a80578813ffcf582cda4aa9e31cd92b43cf1bda4fc5a",
        "ledger": 7841,
        "created_at": "2015-10-01T04:15:01Z",
        "source_account": "GALPCCZN4YXA3YMJHKL6CVIECKPLJJCTVMSNYWBTKJW4K5HQLYLDMZTB",
        "source_account_sequence": "12884901890",
        "fee_paid": 300,
        "fee_charged": 300,
        "max_fee": 300,
        "operation_count": 3,
        "envelope_xdr": "AAAAABbxCy3mLg3hiTqX4VUEEp60pFOrJNxYM1JtxXTwXhY2AAABLAAAAAMAAAACAAAAAAAAAAEAAAATdGVzdHBvb2wsZmF1Y2V0LHNkZgAAAAADAAAAAAAAAAAAAAAAH6Ue1GOPj6Hb/ROPyIFCJpQPMujihEIvJSfK0UfMDIgAAAAAC+vCAAAAAAAAAAAAAAAAALMw4P7yJTyqj6ptNh7BPyXEoT+zVwTcU4JVbGyonvgbAAAAAAvrwgAAAAAAAAAAAAAAAABJlwu05Op/5x1uyrweYsyR6pTTos33hRNZe5IF6blnzwAAAAAL68IAAAAAAAAAAAHwXhY2AAAAQDSBB5eNEKkWIoQbZ1YQabJuE5mW/AKhrHTxw9H3m/sai90YcaZlsAe3ueO9jExjSZF289ZcR4vc0wFw1p/WyAc=",
        "result_xdr": "AAAAAAAAASwAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=",
        "result_meta_xdr": "AAAAAAAAAAMAAAACAAAAAAAAHqEAAAAAAAAAAB+lHtRjj4+h2/0Tj8iBQiaUDzLo4oRCLyUnytFHzAyIAAAAAAvrwgAAAB6hAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAQAAHqEAAAAAAAAAABbxCy3mLg3hiTqX4VUEEp60pFOrJNxYM1JtxXTwXhY2DeC2s4+MeHwAAAADAAAAAgAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAB6hAAAAAAAAAACzMOD+8iU8qo+qbTYewT8lxKE/s1cE3FOCVWxsqJ74GwAAAAAL68IAAAAeoQAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAEAAB6hAAAAAAAAAAAW8Qst5i4N4Yk6l+FVBBKetKRTqyTcWDNSbcV08F4WNg3gtrODoLZ8AAAAAwAAAAIAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAeoQAAAAAAAAAASZcLtOTqf+cdbsq8HmLMkeqU06LN94UTWXuSBem5Z88AAAAAC+vCAAAAHqEAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAeoQAAAAAAAAAAFvELLeYuDeGJOpfhVQQSnrSkU6sk3FgzUm3FdPBeFjYN4Lazd7T0fAAAAAMAAAACAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAA=",
        "fee_meta_xdr": "AAAAAgAAAAMAAB55AAAAAAAAAAAW8Qst5i4N4Yk6l+FVBBKetKRTqyTcWDNSbcV08F4WNg3gtrObeDuoAAAAAwAAAAEAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAEAAB6hAAAAAAAAAAAW8Qst5i4N4Yk6l+FVBBKetKRTqyTcWDNSbcV08F4WNg3gtrObeDp8AAAAAwAAAAIAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA==",
        "memo_type": "text",
        "signatures": [
          "NIEHl40QqRYihBtnVhBpsm4TmZb8AqGsdPHD0feb+xqL3RhxpmWwB7e5472MTGNJkXbz1lxHi9zTAXDWn9bIBw=="
        ]
      },
      {
        "memo": "",
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/transactions/3ce2aca2fed36da2faea31352c76c5e412348887a4c119b1e90de8d1b937396a"
          },
          "account": {
            "href": "https://horizon.stellar.org/accounts/GALPCCZN4YXA3YMJHKL6CVIECKPLJJCTVMSNYWBTKJW4K5HQLYLDMZTB"
          },
          "ledger": {
            "href": "https://horizon.stellar.org/ledgers/7855"
          },
          "operations": {
            "href": "https://horizon.stellar.org/transactions/3ce2aca2fed36da2faea31352c76c5e412348887a4c119b1e90de8d1b937396a/operations{?cursor,limit,order}",
            "templated": true
          },
          "effects": {
            "href": "https://horizon.stellar.org/transactions/3ce2aca2fed36da2faea31352c76c5e412348887a4c119b1e90de8d1b937396a/effects{?cursor,limit,order}",
            "templated": true
          },
          "precedes": {
            "href": "https://horizon.stellar.org/transactions?order=asc\u0026cursor=33736968114176"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/transactions?order=desc\u0026cursor=33736968114176"
          }
        },
        "id": "3ce2aca2fed36da2faea31352c76c5e412348887a4c119b1e90de8d1b937396a",
        "paging_token": "33736968114176",
        "successful": true,
        "hash": "3ce2aca2fed36da2faea31352c76c5e412348887a4c119b1e90de8d1b937396a",
        "ledger": 7855,
        "created_at": "2015-10-01T04:16:11Z",
        "source_account": "GALPCCZN4YXA3YMJHKL6CVIECKPLJJCTVMSNYWBTKJW4K5HQLYLDMZTB",
        "source_account_sequence": "12884901891",
        "fee_paid": 100,
        "fee_charged": 100,
        "max_fee": 100,
        "operation_count": 1,
        "envelope_xdr": "AAAAABbxCy3mLg3hiTqX4VUEEp60pFOrJNxYM1JtxXTwXhY2AAAAZAAAAAMAAAADAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAAFAAAAAQAAAAAfpR7UY4+Podv9E4/IgUImlA8y6OKEQi8lJ8rRR8wMiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHwXhY2AAAAQNbDcWsR3s3z8Qzqatcdc/k2L4LXWJMA6eXac8dbXkAdc4ppH25isGC5OwvG06Vwvc3Ce3/r2rYcBP3vxhx18A8=",
        "result_xdr": "AAAAAAAAAGQAAAAAAAAAAQAAAAAAAAAFAAAAAAAAAAA=",
        "result_meta_xdr": "AAAAAAAAAAEAAAABAAAAAQAAHq8AAAAAAAAAABbxCy3mLg3hiTqX4VUEEp60pFOrJNxYM1JtxXTwXhY2DeC2s3e09BgAAAADAAAAAwAAAAAAAAABAAAAAB+lHtRjj4+h2/0Tj8iBQiaUDzLo4oRCLyUnytFHzAyIAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAA",
        "fee_meta_xdr": "AAAAAgAAAAMAAB6hAAAAAAAAAAAW8Qst5i4N4Yk6l+FVBBKetKRTqyTcWDNSbcV08F4WNg3gtrN3tPR8AAAAAwAAAAIAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAEAAB6vAAAAAAAAAAAW8Qst5i4N4Yk6l+FVBBKetKRTqyTcWDNSbcV08F4WNg3gtrN3tPQYAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA==",
        "memo_type": "text",
        "signatures": [
          "1sNxaxHezfPxDOpq1x1z+TYvgtdYkwDp5dpzx1teQB1zimkfbmKwYLk7C8bTpXC9zcJ7f+vathwE/e/GHHXwDw=="
        ]
      }
    ]
  }
}
JavaScript Streaming Example
JavaScript
var StellarSdk = require('stellar-sdk')
var server = new StellarSdk.Server('https://horizon.stellar.org')

var tradesHandler = function(resp) {
  console.log(resp)
}

var es = server
.transactions()
.cursor('now')
.stream({onmessage: tradesHandler})

Operations

Operations are objects that represent a desired change to the ledger: payments, offers to exchange currency, changes made to account options, etc. Operations are submitted to the Stellar network grouped in a Transaction.

Each of Stellar’s operations have a unique operation object.


The Operation Object

Each of Stellar’s operations have unique response shapes. Below are the attributes that are consistent across each operation object.

See the generic Operation errors.

  • ATTRIBUTEDATA TYPE

    DESCRIPTION

  • idnumber

    The operation’s ID number.

  • paging_tokenstring

    A cursor value for use in pagination.

  • type_inumber

    A number indicating the operation type.

  • typestring

    The name of the operation type.

Example
{
  "_links": {
    "effects": {
      "href": "/operations/402494270214144/effects/{?cursor,limit,order}",
      "templated": true
    },
    "precedes": {
      "href": "/operations?cursor=402494270214144&order=asc"
    },
    "self": {
      "href": "/operations/402494270214144"
    },
    "succeeds": {
      "href": "/operations?cursor=402494270214144&order=desc"
    },
    "transactions": {
      "href": "/transactions/402494270214144"
    }
  },
  "id": 402494270214144,
  "paging_token": "402494270214144",
  "type_i": 0,
  "type": "create_account"
}

Create Account Object

Creates and funds a new account with the specified starting balance.

See the Create Account errors.

  • ATTRIBUTEDATA TYPE

    DESCRIPTION

  • accountstring

    A new account that is funded.

  • funderstring

    The account that funds the new account.

  • paging_tokenstring

    A token that specifies where to begin results for a page of operations.

  • starting_balancestring

    The amount of XLM to send the newly created account.

  • type_inumber

    A number indicating the operation type.

  • typestring

    The name of the operation type.

Example
{
  "_links": {
    "effects": {
      "href": "/operations/402494270214144/effects/{?cursor,limit,order}",
      "templated": true
    },
    "precedes": {
      "href": "/operations?cursor=402494270214144&order=asc"
    },
    "self": {
      "href": "/operations/402494270214144"
    },
    "succeeds": {
      "href": "/operations?cursor=402494270214144&order=desc"
    },
    "transactions": {
      "href": "/transactions/402494270214144"
    }
  },
  "account": "GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ",
  "funder": "GBIA4FH6TV64KSPDAJCNUQSM7PFL4ILGUVJDPCLUOPJ7ONMKBBVUQHRO",
  "id": 402494270214144,
  "paging_token": "402494270214144",
  "starting_balance": "10000.0",
  "type_i": 0,
  "type": "create_account"
}

Path Payment object


Payment Object

Sends an amount in a specific asset to a destination account.

See the Payment errors.

  • ATTRIBUTEDATA TYPE

    DESCRIPTION

  • amountstring

    Amount sent.

  • asset_typestring

    Asset type: lumens (“native”) or all other assets (alphanum4 or alphanum12).

  • fromstring

    The payment sender’s public key.

  • idnumber

    The operation’s ID number.

  • paging_tokenstring

    A token that specifies where to begin results for a page of operations.

  • tostring

    The payment destination’s public key.

  • transaction_successfulboolean

    Whether or not the parent transaction’s effects were included in the ledger.

  • type_inumber

    A number indicating the operation type.

  • typestring

    The name of the operation type.

Example
{
  "_links": {
    "effects": {
      "href": "/operations/58402965295104/effects/{?cursor,limit,order}",
      "templated": true
    },
    "precedes": {
      "href": "/operations?cursor=58402965295104&order=asc"
    },
    "self": {
      "href": "/operations/58402965295104"
    },
    "succeeds": {
      "href": "/operations?cursor=58402965295104&order=desc"
    },
    "transactions": {
      "href": "/transactions/58402965295104"
    }
  },
  "amount": "200.0",
  "asset_type": "native",
  "from": "GAKLBGHNHFQ3BMUYG5KU4BEWO6EYQHZHAXEWC33W34PH2RBHZDSQBD75",
  "id": 58402965295104,
  "paging_token": "58402965295104",
  "to": "GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ",
  "transaction_successful": true,
  "type_i": 1,
  "type": "payment"
}

Manage Sell Offer object


Manage Buy Offer object


Create Passive Sell Offer object


Set Options object


Change Trust object


Allow Trust object


Account Merge object


Inflation object


Manage Data object


Bump Sequence object


Retrieve an Operation

The single operation endpoint provides information about a specific operation.

GET/operations/:operation_id
  • ARGUMENTREQUIRED

    DESCRIPTION

  • idrequired

    The ID number for this operation.

  • joinoptional

    Set to transactions to include the transactions which created each of the operations in the response.

Example Request
curl "https://horizon.stellar.org/operations/121692259040116737"
Example Response
{
  "_links": {
    "self": {
      "href": "https://horizon.stellar.org/operations/121692259040116737"
    },
    "transaction": {
      "href": "https://horizon.stellar.org/transactions/f92a9648c1084d1de0fd786faac5d5e1637d4127c60841d2366c70d2e7f77b85"
    },
    "effects": {
      "href": "https://horizon.stellar.org/operations/121692259040116737/effects"
    },
    "succeeds": {
      "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=121692259040116737"
    },
    "precedes": {
      "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=121692259040116737"
    }
  },
  "id": "121692259040116737",
  "paging_token": "121692259040116737",
  "transaction_successful": true,
  "source_account": "GBDVKE33GVVMBXX73OHIBRP6RAHKHHW2P4PQVV6UNOKQCOXU7GNUM4QI",
  "type": "manage_offer",
  "type_i": 3,
  "created_at": "2020-02-21T20:10:21Z",
  "transaction_hash": "f92a9648c1084d1de0fd786faac5d5e1637d4127c60841d2366c70d2e7f77b85",
  "amount": "10000.0000000",
  "price": "0.0704336",
  "price_r": {
    "n": 44021,
    "d": 625000
  },
  "buying_asset_type": "credit_alphanum4",
  "buying_asset_code": "USD",
  "buying_asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX",
  "selling_asset_type": "native",
  "offer_id": 161536436
}

Retrieve an Operation's Effects

This endpoint returns the effects of a specific operation.

GET/operations/:operation_id/effects?cursor={paging_token}&order={asc,desc}&limit={1-200}
  • ARGUMENTREQUIRED

    DESCRIPTION

  • idrequired

    The ID number for this operation.

  • cursoroptional

    A number that points to a specific location in a collection of responses and is pulled from the paging_token value of a record.

  • orderoptional

    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.

  • limitoptional

    The total 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.

Example Request
curl "https://horizon.stellar.org/operations/121693057904021505/effects"
Example Response
{
  "_links": {
    "self": {
      "href": "https://horizon.stellar.org/operations/121693057904021505/effects?cursor=\u0026limit=10\u0026order=asc"
    },
    "next": {
      "href": "https://horizon.stellar.org/operations/121693057904021505/effects?cursor=121693057904021505-2\u0026limit=10\u0026order=asc"
    },
    "prev": {
      "href": "https://horizon.stellar.org/operations/121693057904021505/effects?cursor=121693057904021505-1\u0026limit=10\u0026order=desc"
    }
  },
  "_embedded": {
    "records": [
      {
        "_links": {
          "operation": {
            "href": "https://horizon.stellar.org/operations/121693057904021505"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=121693057904021505-1"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=121693057904021505-1"
          }
        },
        "id": "0121693057904021505-0000000001",
        "paging_token": "121693057904021505-1",
        "account": "GALSPNVKGNRJ3VIOQ26QKPZBDCTVJK7XPLSPF3UVZV3JJXCKVCHNSPCK",
        "type": "account_credited",
        "type_i": 2,
        "created_at": "2020-02-21T20:27:30Z",
        "asset_type": "credit_alphanum4",
        "asset_code": "NODL",
        "asset_issuer": "GB2Y3AWXVROM2BHFQKQPTWKIOI3TZEBBD3LTKTVQTKEPXGOBE742NODL",
        "amount": "0.0000027"
      },
      {
        "_links": {
          "operation": {
            "href": "https://horizon.stellar.org/operations/121693057904021505"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=121693057904021505-2"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=121693057904021505-2"
          }
        },
        "id": "0121693057904021505-0000000002",
        "paging_token": "121693057904021505-2",
        "account": "GDQWI6FKB72DPOJE4CGYCFQZKRPQQIOYXRMZ5KEVGXMG6UUTGJMBCASH",
        "type": "account_debited",
        "type_i": 3,
        "created_at": "2020-02-21T20:27:30Z",
        "asset_type": "credit_alphanum4",
        "asset_code": "NODL",
        "asset_issuer": "GB2Y3AWXVROM2BHFQKQPTWKIOI3TZEBBD3LTKTVQTKEPXGOBE742NODL",
        "amount": "0.0000027"
      }
    ]
  }
}

List All Operations

This 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 the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known operation unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream operations created since your request time.

GET/operations?cursor={paging_token}&order={asc,desc}&limit={1-200}&include_failed={true,false}&join={transactions]
  • ARGUMENTREQUIRED

    DESCRIPTION

  • cursoroptional

    A number that points to a specific location in a collection of responses and is pulled from the paging_token value of a record.

  • orderoptional

    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.

  • limitoptional

    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.

  • include_failedoptional

    Set to true to include failed operations in results. Options include true and false.

  • joinoptional

    Set to transactions to include the transactions which created each of the operations in the response.

Example Request
curl "https://horizon.stellar.org/operations?limit=3"
Example Response
{
  "_links": {
    "self": {
      "href": "https://horizon.stellar.org/operations?cursor=\u0026limit=3\u0026order=asc"
    },
    "next": {
      "href": "https://horizon.stellar.org/operations?cursor=12884905987\u0026limit=3\u0026order=asc"
    },
    "prev": {
      "href": "https://horizon.stellar.org/operations?cursor=12884905985\u0026limit=3\u0026order=desc"
    }
  },
  "_embedded": {
    "records": [
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/operations/12884905985"
          },
          "transaction": {
            "href": "https://horizon.stellar.org/transactions/3389e9f0f1a65f19736cacf544c2e825313e8447f569233bb8db39aa607c8889"
          },
          "effects": {
            "href": "https://horizon.stellar.org/operations/12884905985/effects"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=12884905985"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=12884905985"
          }
        },
        "id": "12884905985",
        "paging_token": "12884905985",
        "transaction_successful": true,
        "source_account": "GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN7",
        "type": "create_account",
        "type_i": 0,
        "created_at": "2015-09-30T17:15:54Z",
        "transaction_hash": "3389e9f0f1a65f19736cacf544c2e825313e8447f569233bb8db39aa607c8889",
        "starting_balance": "20.0000000",
        "funder": "GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN7",
        "account": "GALPCCZN4YXA3YMJHKL6CVIECKPLJJCTVMSNYWBTKJW4K5HQLYLDMZTB"
      },
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/operations/12884905986"
          },
          "transaction": {
            "href": "https://horizon.stellar.org/transactions/3389e9f0f1a65f19736cacf544c2e825313e8447f569233bb8db39aa607c8889"
          },
          "effects": {
            "href": "https://horizon.stellar.org/operations/12884905986/effects"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=12884905986"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=12884905986"
          }
        },
        "id": "12884905986",
        "paging_token": "12884905986",
        "transaction_successful": true,
        "source_account": "GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN7",
        "type": "payment",
        "type_i": 1,
        "created_at": "2015-09-30T17:15:54Z",
        "transaction_hash": "3389e9f0f1a65f19736cacf544c2e825313e8447f569233bb8db39aa607c8889",
        "asset_type": "native",
        "from": "GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN7",
        "to": "GALPCCZN4YXA3YMJHKL6CVIECKPLJJCTVMSNYWBTKJW4K5HQLYLDMZTB",
        "amount": "99999999959.9999700"
      },
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/operations/12884905987"
          },
          "transaction": {
            "href": "https://horizon.stellar.org/transactions/3389e9f0f1a65f19736cacf544c2e825313e8447f569233bb8db39aa607c8889"
          },
          "effects": {
            "href": "https://horizon.stellar.org/operations/12884905987/effects"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=12884905987"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=12884905987"
          }
        },
        "id": "12884905987",
        "paging_token": "12884905987",
        "transaction_successful": true,
        "source_account": "GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN7",
        "type": "set_options",
        "type_i": 5,
        "created_at": "2015-09-30T17:15:54Z",
        "transaction_hash": "3389e9f0f1a65f19736cacf544c2e825313e8447f569233bb8db39aa607c8889",
        "master_key_weight": 0
      }
    ]
  }
}
JavaScript Streaming Example
JavaScript
var StellarSdk = require('stellar-sdk')
var server = new StellarSdk.Server('https://horizon.stellar.org')

var callback = function(resp) {
  console.log(resp)
}

var es = server
.operations()
.cursor('now')
.stream({onmessage: callback})

List All Payments

This 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 are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known payment unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream payments created since your request time.

Operations that can be returned by this endpoint include:

  • create_account
  • payment
  • path_payment
  • account_merge
GET/payments?cursor={paging_token}&order={asc,desc}&limit={1-200}&include_failed={true,false}&join={transactions]
  • ARGUMENTREQUIRED

    DESCRIPTION

  • cursoroptional

    A number that points to a specific location in a collection of responses and is pulled from the paging_token value of a record.

  • orderoptional

    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.

  • limitoptional

    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.

  • include_failedoptional

    Set to true to include failed operations in results. Options include true and false.

  • joinoptional

    Set to transactions to include the transactions which created each of the operations in the response.

Example Request
curl "https://horizon.stellar.org/payments?limit=3"
Example Response
{
  "_links": {
    "self": {
      "href": "https://horizon.stellar.org/payments?cursor=\u0026limit=3\u0026order=asc"
    },
    "next": {
      "href": "https://horizon.stellar.org/payments?cursor=33676838572033\u0026limit=3\u0026order=asc"
    },
    "prev": {
      "href": "https://horizon.stellar.org/payments?cursor=12884905985\u0026limit=3\u0026order=desc"
    }
  },
  "_embedded": {
    "records": [
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/operations/12884905985"
          },
          "transaction": {
            "href": "https://horizon.stellar.org/transactions/3389e9f0f1a65f19736cacf544c2e825313e8447f569233bb8db39aa607c8889"
          },
          "effects": {
            "href": "https://horizon.stellar.org/operations/12884905985/effects"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=12884905985"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=12884905985"
          }
        },
        "id": "12884905985",
        "paging_token": "12884905985",
        "transaction_successful": true,
        "source_account": "GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN7",
        "type": "create_account",
        "type_i": 0,
        "created_at": "2015-09-30T17:15:54Z",
        "transaction_hash": "3389e9f0f1a65f19736cacf544c2e825313e8447f569233bb8db39aa607c8889",
        "starting_balance": "20.0000000",
        "funder": "GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN7",
        "account": "GALPCCZN4YXA3YMJHKL6CVIECKPLJJCTVMSNYWBTKJW4K5HQLYLDMZTB"
      },
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/operations/12884905986"
          },
          "transaction": {
            "href": "https://horizon.stellar.org/transactions/3389e9f0f1a65f19736cacf544c2e825313e8447f569233bb8db39aa607c8889"
          },
          "effects": {
            "href": "https://horizon.stellar.org/operations/12884905986/effects"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=12884905986"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=12884905986"
          }
        },
        "id": "12884905986",
        "paging_token": "12884905986",
        "transaction_successful": true,
        "source_account": "GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN7",
        "type": "payment",
        "type_i": 1,
        "created_at": "2015-09-30T17:15:54Z",
        "transaction_hash": "3389e9f0f1a65f19736cacf544c2e825313e8447f569233bb8db39aa607c8889",
        "asset_type": "native",
        "from": "GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN7",
        "to": "GALPCCZN4YXA3YMJHKL6CVIECKPLJJCTVMSNYWBTKJW4K5HQLYLDMZTB",
        "amount": "99999999959.9999700"
      },
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/operations/33676838572033"
          },
          "transaction": {
            "href": "https://horizon.stellar.org/transactions/2db4b22ca018119c5027a80578813ffcf582cda4aa9e31cd92b43cf1bda4fc5a"
          },
          "effects": {
            "href": "https://horizon.stellar.org/operations/33676838572033/effects"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=33676838572033"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=33676838572033"
          }
        },
        "id": "33676838572033",
        "paging_token": "33676838572033",
        "transaction_successful": true,
        "source_account": "GALPCCZN4YXA3YMJHKL6CVIECKPLJJCTVMSNYWBTKJW4K5HQLYLDMZTB",
        "type": "create_account",
        "type_i": 0,
        "created_at": "2015-10-01T04:15:01Z",
        "transaction_hash": "2db4b22ca018119c5027a80578813ffcf582cda4aa9e31cd92b43cf1bda4fc5a",
        "starting_balance": "20.0000000",
        "funder": "GALPCCZN4YXA3YMJHKL6CVIECKPLJJCTVMSNYWBTKJW4K5HQLYLDMZTB",
        "account": "GAP2KHWUMOHY7IO37UJY7SEBIITJIDZS5DRIIQRPEUT4VUKHZQGIRWS4"
      }
    ]
  }
}
JavaScript Streaming Example
JavaScript
var StellarSdk = require('stellar-sdk')
var server = new StellarSdk.Server('https://horizon.stellar.org')

var callback = function(resp) {
  console.log(resp)
}

var es = server
.payments()
.cursor('now')
.stream({onmessage: callback})

Effects


Accounts

Users interact with the Stellar network through accounts. Everything else in the ledger—assets, offers, trustlines, etc.—are owned by accounts, and accounts must authorize all changes to the ledger through signed transactions.

Learn more about accounts.


The Account Object

When Horizon returns information about an account, it uses the following format:

  • ATTRIBUTEDATA TYPE

    DESCRIPTION

  • idstring

    A unique identifier for this account.

  • account_idstring

    This account’s public key encoded in a base32 string representation.

  • sequencenumber

    This account’s current sequence number. For use when submitting this account’s next transaction.

  • subentry_countnumber

    The number of subentries on this account.

  • home_domainstring

    The domain that hosts this account’s stellar.toml file.

  • last_modified_ledgernumber

    The ID of the last ledger that included changes to this account.

  • thresholdsobject

    Operations have varying levels of access. This field specifies thresholds for different access levels, as well as the weight of the master key.

  • flagsobject

    Flags denote the enabling/disabling of certain asset issuer privileges.

  • balancesobject

    The assets this account holds.

  • signersarray of objects

    The public keys and associated weights that can be used to authorize transactions for this account. Used for multi-sig.

  • dataobject

    An array of account data fields.

Example
{
  "_links": {
    "self": {
      "href": "https://horizon.stellar.org/accounts/GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U"
    },
    "transactions": {
      "href": "https://horizon.stellar.org/accounts/GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U/transactions{?cursor,limit,order}",
      "templated": true
    },
    "operations": {
      "href": "https://horizon.stellar.org/accounts/GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U/operations{?cursor,limit,order}",
      "templated": true
    },
    "payments": {
      "href": "https://horizon.stellar.org/accounts/GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U/payments{?cursor,limit,order}",
      "templated": true
    },
    "effects": {
      "href": "https://horizon.stellar.org/accounts/GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U/effects{?cursor,limit,order}",
      "templated": true
    },
    "offers": {
      "href": "https://horizon.stellar.org/accounts/GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U/offers{?cursor,limit,order}",
      "templated": true
    },
    "trades": {
      "href": "https://horizon.stellar.org/accounts/GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U/trades{?cursor,limit,order}",
      "templated": true
    },
    "data": {
      "href": "https://horizon.stellar.org/accounts/GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U/data/{key}",
      "templated": true
    }
  },
  "id": "GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U",
  "account_id": "GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U",
  "sequence": "24739097524306468",
  "subentry_count": 3,
  "inflation_destination": "GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U",
  "home_domain": "tempo.eu.com",
  "last_modified_ledger": 23569316,
  "thresholds": {
    "low_threshold": 5,
    "med_threshold": 0,
    "high_threshold": 0
  },
  "flags": {
    "auth_required": false,
    "auth_revocable": true,
    "auth_immutable": false
  },
  "balances": [
    {
      "balance": "1.0000005",
      "limit": "922337203685.4775807",
      "buying_liabilities": "0.0000000",
      "selling_liabilities": "0.0000000",
      "last_modified_ledger": 22651481,
      "is_authorized": true,
      "asset_type": "credit_alphanum4",
      "asset_code": "EURT",
      "asset_issuer": "GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S"
    },
    {
      "balance": "0.0000000",
      "limit": "922337203685.4775807",
      "buying_liabilities": "0.0000000",
      "selling_liabilities": "0.0000000",
      "last_modified_ledger": 7877447,
      "is_authorized": false,
      "asset_type": "credit_alphanum4",
      "asset_code": "PHP",
      "asset_issuer": "GBUQWP3BOUZX34TOND2QV7QQ7K7VJTG6VSE7WMLBTMDJLLAW7YKGU6EP"
    },
    {
      "balance": "0.0000000",
      "limit": "922337203685.4775807",
      "buying_liabilities": "0.0000000",
      "selling_liabilities": "0.0000000",
      "last_modified_ledger": 20213845,
      "is_authorized": true,
      "asset_type": "credit_alphanum4",
      "asset_code": "NGN",
      "asset_issuer": "GCC4YLCR7DDWFCIPTROQM7EB2QMFD35XRWEQVIQYJQHVW6VE5MJZXIGW"
    },
    {
      "balance": "198.8944970",
      "buying_liabilities": "0.0000000",
      "selling_liabilities": "0.0000000",
      "asset_type": "native"
    }
  ],
  "signers": [
    {
      "weight": 10,
      "key": "GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U",
      "type": "ed25519_public_key"
    }
  ],
  "data": {},
  "paging_token": ""
}

Retrieve an Account

The single account endpoint provides information on a specific account.

The balances section in the response will also list all the trustlines this account has established. Note this will only return trustlines that have the necessary authorization to work. If an account A trusts another account B that has the authorization required flag set, the trustline won’t show up until account B allows account A to hold its assets.

GET/accounts/:account_id
  • ARGUMENTREQUIRED

    DESCRIPTION

  • account_idrequired

    This account’s public key encoded in a base32 string representation.

Example Request
curl "https://horizon.stellar.org/accounts/GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA"
Example Response
{
  "_links": {
    "self": {
      "href": "https://horizon.stellar.org/accounts/GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA"
    },
    "transactions": {
      "href": "https://horizon.stellar.org/accounts/GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA/transactions{?cursor,limit,order}",
      "templated": true
    },
    "operations": {
      "href": "https://horizon.stellar.org/accounts/GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA/operations{?cursor,limit,order}",
      "templated": true
    },
    "payments": {
      "href": "https://horizon.stellar.org/accounts/GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA/payments{?cursor,limit,order}",
      "templated": true
    },
    "effects": {
      "href": "https://horizon.stellar.org/accounts/GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA/effects{?cursor,limit,order}",
      "templated": true
    },
    "offers": {
      "href": "https://horizon.stellar.org/accounts/GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA/offers{?cursor,limit,order}",
      "templated": true
    },
    "trades": {
      "href": "https://horizon.stellar.org/accounts/GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA/trades{?cursor,limit,order}",
      "templated": true
    },
    "data": {
      "href": "https://horizon.stellar.org/accounts/GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA/data/{key}",
      "templated": true
    }
  },
  "id": "GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA",
  "account_id": "GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA",
  "sequence": "120192344791187470",
  "subentry_count": 5,
  "last_modified_ledger": 28105812,
  "thresholds": {
    "low_threshold": 0,
    "med_threshold": 0,
    "high_threshold": 0
  },
  "flags": {
    "auth_required": false,
    "auth_revocable": false,
    "auth_immutable": false
  },
  "balances": [
    {
      "balance": "3.0000000",
      "limit": "922337203685.4775807",
      "buying_liabilities": "0.0000000",
      "selling_liabilities": "0.0000000",
      "last_modified_ledger": 27984507,
      "is_authorized": true,
      "asset_type": "credit_alphanum4",
      "asset_code": "EURT",
      "asset_issuer": "GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S"
    },
    {
      "balance": "20.0000000",
      "limit": "922337203685.4775807",
      "buying_liabilities": "0.0000000",
      "selling_liabilities": "0.0000000",
      "last_modified_ledger": 27984988,
      "is_authorized": true,
      "asset_type": "credit_alphanum4",
      "asset_code": "CNY",
      "asset_issuer": "GAREELUB43IRHWEASCFBLKHURCGMHE5IF6XSE7EXDLACYHGRHM43RFOX"
    },
    {
      "balance": "199.9999990",
      "limit": "922337203685.4775807",
      "buying_liabilities": "0.0000000",
      "selling_liabilities": "0.0000000",
      "last_modified_ledger": 27984513,
      "is_authorized": true,
      "asset_type": "credit_alphanum4",
      "asset_code": "NGNT",
      "asset_issuer": "GAWODAROMJ33V5YDFY3NPYTHVYQG7MJXVJ2ND3AOGIHYRWINES6ACCPD"
    },
    {
      "balance": "1.0000000",
      "limit": "922337203685.4775807",
      "buying_liabilities": "0.0000000",
      "selling_liabilities": "0.0000000",
      "last_modified_ledger": 27984972,
      "is_authorized": true,
      "asset_type": "credit_alphanum4",
      "asset_code": "BB1",
      "asset_issuer": "GD5J6HLF5666X4AZLTFTXLY46J5SW7EXRKBLEYPJP33S33MXZGV6CWFN"
    },
    {
      "balance": "4.0000000",
      "limit": "922337203685.4775807",
      "buying_liabilities": "0.0000000",
      "selling_liabilities": "0.0000000",
      "last_modified_ledger": 27985131,
      "is_authorized": true,
      "asset_type": "credit_alphanum4",
      "asset_code": "USD",
      "asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX"
    },
    {
      "balance": "72.8563792",
      "buying_liabilities": "0.0000000",
      "selling_liabilities": "0.0000000",
      "asset_type": "native"
    }
  ],
  "signers": [
    {
      "weight": 1,
      "key": "GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA",
      "type": "ed25519_public_key"
    }
  ],
  "data": {},
  "paging_token": ""
}

Retrieve an Account's Transactions

This endpoint represents successful transactions for a given account and can be used in streaming mode.

Streaming mode allows you to listen for new transactions for this account as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known transaction unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream transactions created since your request time.

GET/accounts/:account_id/transactions?cursor={paging_token}&order={asc,desc}&limit={1-200}&include_failed{true,false}
  • ARGUMENTREQUIRED

    DESCRIPTION

  • account_idrequired

    This account’s public key encoded in a base32 string representation.

  • cursoroptional

    A number that points to a specific location in a collection of responses and is pulled from the paging_token value of a record.

  • orderoptional

    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.

  • limitoptional

    The total 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.

  • include_failedoptional

    Set to true to include failed transactions in results. Options include true and false.

Example Request
curl "https://horizon.stellar.org/accounts/GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA/transactions?limit=2"
Example Response
{
  "_links": {
    "self": {
      "href": "https://horizon.stellar.org/accounts/GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA/transactions?cursor=\u0026limit=2\u0026order=asc"
    },
    "next": {
      "href": "https://horizon.stellar.org/accounts/GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA/transactions?cursor=120192370561220608\u0026limit=2\u0026order=asc"
    },
    "prev": {
      "href": "https://horizon.stellar.org/accounts/GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA/transactions?cursor=120192344791343104\u0026limit=2\u0026order=desc"
    }
  },
  "_embedded": {
    "records": [
      {
        "memo": "hello universe",
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/transactions/ef0fe04ac3c7de7228ca2598886059868ad05c224a041e8b2d9ee2a8a9dd6894"
          },
          "account": {
            "href": "https://horizon.stellar.org/accounts/GBVFTZL5HIPT4PFQVTZVIWR77V7LWYCXU4CLYWWHHOEXB64XPG5LDMTU"
          },
          "ledger": {
            "href": "https://horizon.stellar.org/ledgers/27984461"
          },
          "operations": {
            "href": "https://horizon.stellar.org/transactions/ef0fe04ac3c7de7228ca2598886059868ad05c224a041e8b2d9ee2a8a9dd6894/operations{?cursor,limit,order}",
            "templated": true
          },
          "effects": {
            "href": "https://horizon.stellar.org/transactions/ef0fe04ac3c7de7228ca2598886059868ad05c224a041e8b2d9ee2a8a9dd6894/effects{?cursor,limit,order}",
            "templated": true
          },
          "precedes": {
            "href": "https://horizon.stellar.org/transactions?order=asc\u0026cursor=120192344791343104"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/transactions?order=desc\u0026cursor=120192344791343104"
          }
        },
        "id": "ef0fe04ac3c7de7228ca2598886059868ad05c224a041e8b2d9ee2a8a9dd6894",
        "paging_token": "120192344791343104",
        "successful": true,
        "hash": "ef0fe04ac3c7de7228ca2598886059868ad05c224a041e8b2d9ee2a8a9dd6894",
        "ledger": 27984461,
        "created_at": "2020-01-29T19:43:59Z",
        "source_account": "GBVFTZL5HIPT4PFQVTZVIWR77V7LWYCXU4CLYWWHHOEXB64XPG5LDMTU",
        "source_account_sequence": "94658837230911490",
        "fee_paid": 100,
        "fee_charged": 100,
        "max_fee": 100,
        "operation_count": 1,
        "envelope_xdr": "AAAAAGpZ5X06Hz48sKzzVFo//X67YFenBLxaxzuJcPuXebqxAAAAZAFQS7YAAAACAAAAAQAAAAAAAAAAAAAAAF4x4NYAAAABAAAADmhlbGxvIHVuaXZlcnNlAAAAAAABAAAAAAAAAAAAAAAAMOWtdEZJweWBDrIVGDQOVodinrlXbfzBfquR7AFtxW4AAAAAATEtAAAAAAAAAAABl3m6sQAAAEDwdDlpQv5IfweTkLjytpWIa+bpQv7BAHRFpMCHscM3g+WBKjXPVEnSP1BghLuy3uhvgv4LnCkI+gFEDZxwV/YF",
        "result_xdr": "AAAAAAAAAGQAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAA=",
        "result_meta_xdr": "AAAAAQAAAAIAAAADAasCTQAAAAAAAAAAalnlfTofPjywrPNUWj/9frtgV6cEvFrHO4lw+5d5urEAAAACzQs6uAFQS7YAAAABAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAABAasCTQAAAAAAAAAAalnlfTofPjywrPNUWj/9frtgV6cEvFrHO4lw+5d5urEAAAACzQs6uAFQS7YAAAACAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAAAwAAAAMBqwJNAAAAAAAAAABqWeV9Oh8+PLCs81RaP/1+u2BXpwS8Wsc7iXD7l3m6sQAAAALNCzq4AVBLtgAAAAIAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAEBqwJNAAAAAAAAAABqWeV9Oh8+PLCs81RaP/1+u2BXpwS8Wsc7iXD7l3m6sQAAAALL2g24AVBLtgAAAAIAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAABqwJNAAAAAAAAAAAw5a10RknB5YEOshUYNA5Wh2KeuVdt/MF+q5HsAW3FbgAAAAABMS0AAasCTQAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA==",
        "fee_meta_xdr": "AAAAAgAAAAMBnbxLAAAAAAAAAABqWeV9Oh8+PLCs81RaP/1+u2BXpwS8Wsc7iXD7l3m6sQAAAALNCzscAVBLtgAAAAEAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAEBqwJNAAAAAAAAAABqWeV9Oh8+PLCs81RaP/1+u2BXpwS8Wsc7iXD7l3m6sQAAAALNCzq4AVBLtgAAAAEAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA==",
        "memo_type": "text",
        "signatures": [
          "8HQ5aUL+SH8Hk5C48raViGvm6UL+wQB0RaTAh7HDN4PlgSo1z1RJ0j9QYIS7st7ob4L+C5wpCPoBRA2ccFf2BQ=="
        ],
        "valid_after": "1970-01-01T00:00:00Z",
        "valid_before": "2020-01-29T19:45:26Z"
      },
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/transactions/c1cb850f413e4038c4120bd9badc07bb8ef85a46649a4d5c9c16e578a2d30589"
          },
          "account": {
            "href": "https://horizon.stellar.org/accounts/GBVFTZL5HIPT4PFQVTZVIWR77V7LWYCXU4CLYWWHHOEXB64XPG5LDMTU"
          },
          "ledger": {
            "href": "https://horizon.stellar.org/ledgers/27984467"
          },
          "operations": {
            "href": "https://horizon.stellar.org/transactions/c1cb850f413e4038c4120bd9badc07bb8ef85a46649a4d5c9c16e578a2d30589/operations{?cursor,limit,order}",
            "templated": true
          },
          "effects": {
            "href": "https://horizon.stellar.org/transactions/c1cb850f413e4038c4120bd9badc07bb8ef85a46649a4d5c9c16e578a2d30589/effects{?cursor,limit,order}",
            "templated": true
          },
          "precedes": {
            "href": "https://horizon.stellar.org/transactions?order=asc\u0026cursor=120192370561220608"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/transactions?order=desc\u0026cursor=120192370561220608"
          }
        },
        "id": "c1cb850f413e4038c4120bd9badc07bb8ef85a46649a4d5c9c16e578a2d30589",
        "paging_token": "120192370561220608",
        "successful": true,
        "hash": "c1cb850f413e4038c4120bd9badc07bb8ef85a46649a4d5c9c16e578a2d30589",
        "ledger": 27984467,
        "created_at": "2020-01-29T19:44:36Z",
        "source_account": "GBVFTZL5HIPT4PFQVTZVIWR77V7LWYCXU4CLYWWHHOEXB64XPG5LDMTU",
        "source_account_sequence": "94658837230911491",
        "fee_paid": 100,
        "fee_charged": 100,
        "max_fee": 100,
        "operation_count": 1,
        "envelope_xdr": "AAAAAGpZ5X06Hz48sKzzVFo//X67YFenBLxaxzuJcPuXebqxAAAAZAFQS7YAAAADAAAAAQAAAAAAAAAAAAAAAF4x4PoAAAAAAAAAAQAAAAAAAAABAAAAADDlrXRGScHlgQ6yFRg0DlaHYp65V238wX6rkewBbcVuAAAAAAAAAAB3NZQAAAAAAAAAAAGXebqxAAAAQMzdIubro9XQUTkhf0YbDBNM5tqC/zS7fGb0BLFq+QxXT7VAS7dDMno9A2f1df4nnyeHqVl+CuKcpwwwS04JSgE=",
        "result_xdr": "AAAAAAAAAGQAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAA=",
        "result_meta_xdr": "AAAAAQAAAAIAAAADAasCUwAAAAAAAAAAalnlfTofPjywrPNUWj/9frtgV6cEvFrHO4lw+5d5urEAAAACy9oNVAFQS7YAAAACAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAABAasCUwAAAAAAAAAAalnlfTofPjywrPNUWj/9frtgV6cEvFrHO4lw+5d5urEAAAACy9oNVAFQS7YAAAADAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAABAAAAAMBqwJNAAAAAAAAAAAw5a10RknB5YEOshUYNA5Wh2KeuVdt/MF+q5HsAW3FbgAAAAABMS0AAasCTQAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAEBqwJTAAAAAAAAAAAw5a10RknB5YEOshUYNA5Wh2KeuVdt/MF+q5HsAW3FbgAAAAB4ZsEAAasCTQAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAMBqwJTAAAAAAAAAABqWeV9Oh8+PLCs81RaP/1+u2BXpwS8Wsc7iXD7l3m6sQAAAALL2g1UAVBLtgAAAAMAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAEBqwJTAAAAAAAAAABqWeV9Oh8+PLCs81RaP/1+u2BXpwS8Wsc7iXD7l3m6sQAAAAJUpHlUAVBLtgAAAAMAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA==",
        "fee_meta_xdr": "AAAAAgAAAAMBqwJNAAAAAAAAAABqWeV9Oh8+PLCs81RaP/1+u2BXpwS8Wsc7iXD7l3m6sQAAAALL2g24AVBLtgAAAAIAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAEBqwJTAAAAAAAAAABqWeV9Oh8+PLCs81RaP/1+u2BXpwS8Wsc7iXD7l3m6sQAAAALL2g1UAVBLtgAAAAIAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA==",
        "memo_type": "none",
        "signatures": [
          "zN0i5uuj1dBROSF/RhsME0zm2oL/NLt8ZvQEsWr5DFdPtUBLt0Myej0DZ/V1/iefJ4epWX4K4pynDDBLTglKAQ=="
        ],
        "valid_after": "1970-01-01T00:00:00Z",
        "valid_before": "2020-01-29T19:46:02Z"
      }
    ]
  }
}
JavaScript Streaming Example
JavaScript
var StellarSdk = require('stellar-sdk')
var server = new StellarSdk.Server('https://horizon.stellar.org')

var callback = function(resp) {
  console.log(resp)
}

var es = server
.transactions()
.forAccount('GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA')
.cursor('now')
.stream({onmessage: callback})

Retrieve an Account's Operations

This endpoint represents successful operations for a given account and can be used in streaming mode.

Streaming mode allows you to listen for new operations for this account as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known operation unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream operations created since your request time.

GET/accounts/:account_id/operations?cursor={paging_token}&order={asc,desc}&limit={1-200}&include_failed{true,false}&join={transactions}
  • ARGUMENTREQUIRED

    DESCRIPTION

  • account_idrequired

    This account’s public key encoded in a base32 string representation.

  • cursoroptional

    A number that points to a specific location in a collection of responses and is pulled from the paging_token value of a record.

  • orderoptional

    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.

  • limitoptional

    The total 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.

  • include_failedoptional

    Set to true to include failed operations in results. Options include true and false.

  • joinoptional

    Set to transactions to include the transactions which created each of the operations in the response.

Example Request
curl "https://horizon.stellar.org/accounts/GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA/operations?limit=3"
Example Response
{
  "_links": {
    "self": {
      "href": "https://horizon.stellar.org/accounts/GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA/operations?cursor=\u0026limit=3\u0026order=asc"
    },
    "next": {
      "href": "https://horizon.stellar.org/accounts/GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA/operations?cursor=120192452165550081\u0026limit=3\u0026order=asc"
    },
    "prev": {
      "href": "https://horizon.stellar.org/accounts/GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA/operations?cursor=120192344791343105\u0026limit=3\u0026order=desc"
    }
  },
  "_embedded": {
    "records": [
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/operations/120192344791343105"
          },
          "transaction": {
            "href": "https://horizon.stellar.org/transactions/ef0fe04ac3c7de7228ca2598886059868ad05c224a041e8b2d9ee2a8a9dd6894"
          },
          "effects": {
            "href": "https://horizon.stellar.org/operations/120192344791343105/effects"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=120192344791343105"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=120192344791343105"
          }
        },
        "id": "120192344791343105",
        "paging_token": "120192344791343105",
        "transaction_successful": true,
        "source_account": "GBVFTZL5HIPT4PFQVTZVIWR77V7LWYCXU4CLYWWHHOEXB64XPG5LDMTU",
        "type": "create_account",
        "type_i": 0,
        "created_at": "2020-01-29T19:43:59Z",
        "transaction_hash": "ef0fe04ac3c7de7228ca2598886059868ad05c224a041e8b2d9ee2a8a9dd6894",
        "starting_balance": "2.0000000",
        "funder": "GBVFTZL5HIPT4PFQVTZVIWR77V7LWYCXU4CLYWWHHOEXB64XPG5LDMTU",
        "account": "GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA"
      },
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/operations/120192370561220609"
          },
          "transaction": {
            "href": "https://horizon.stellar.org/transactions/c1cb850f413e4038c4120bd9badc07bb8ef85a46649a4d5c9c16e578a2d30589"
          },
          "effects": {
            "href": "https://horizon.stellar.org/operations/120192370561220609/effects"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=120192370561220609"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=120192370561220609"
          }
        },
        "id": "120192370561220609",
        "paging_token": "120192370561220609",
        "transaction_successful": true,
        "source_account": "GBVFTZL5HIPT4PFQVTZVIWR77V7LWYCXU4CLYWWHHOEXB64XPG5LDMTU",
        "type": "payment",
        "type_i": 1,
        "created_at": "2020-01-29T19:44:36Z",
        "transaction_hash": "c1cb850f413e4038c4120bd9badc07bb8ef85a46649a4d5c9c16e578a2d30589",
        "asset_type": "native",
        "from": "GBVFTZL5HIPT4PFQVTZVIWR77V7LWYCXU4CLYWWHHOEXB64XPG5LDMTU",
        "to": "GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA",
        "amount": "200.0000000"
      },
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/operations/120192452165550081"
          },
          "transaction": {
            "href": "https://horizon.stellar.org/transactions/0e6bc30f2b2f50ca0ecedef5a527309c74964e7daa6018976cd2c686c5df4be3"
          },
          "effects": {
            "href": "https://horizon.stellar.org/operations/120192452165550081/effects"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=120192452165550081"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=120192452165550081"
          }
        },
        "id": "120192452165550081",
        "paging_token": "120192452165550081",
        "transaction_successful": true,
        "source_account": "GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA",
        "type": "change_trust",
        "type_i": 6,
        "created_at": "2020-01-29T19:46:20Z",
        "transaction_hash": "0e6bc30f2b2f50ca0ecedef5a527309c74964e7daa6018976cd2c686c5df4be3",
        "asset_type": "credit_alphanum4",
        "asset_code": "USD",
        "asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX",
        "limit": "922337203685.4775807",
        "trustee": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX",
        "trustor": "GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA"
      }
    ]
  }
}
JavaScript Streaming Example
JavaScript
var StellarSdk = require('stellar-sdk')
var server = new StellarSdk.Server('https://horizon.stellar.org')

var callback = function(resp) {
  console.log(resp)
}

var es = server
.operations()
.forAccount('GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA')
.cursor('now')
.stream({onmessage: callback})

Retrieve an Account's Payments

This 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 this account as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known payment unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream payments created since your request time.

GET/accounts/:account_id/payments?cursor={paging_token}&order={asc,desc}&limit={1-200}&include_failed{true,false}&join={transactions}
  • ARGUMENTREQUIRED

    DESCRIPTION

  • account_idrequired

    This account’s public key encoded in a base32 string representation.

  • cursoroptional

    A number that points to a specific location in a collection of responses and is pulled from the paging_token value of a record.

  • orderoptional

    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.

  • limitoptional

    The total 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.

  • include_failedoptional

    Set to true to include failed operations in results. Options include true and false.

  • joinoptional

    Set to transactions to include the transactions which created each of the operations in the response.

Example Request
curl "https://horizon.stellar.org/accounts/GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE/payments?order=desc"
Example Response
{
  "_links": {
    "self": {
      "href": "https://horizon.stellar.org/accounts/GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE/payments?cursor=\u0026limit=10\u0026order=desc"
    },
    "next": {
      "href": "https://horizon.stellar.org/accounts/GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE/payments?cursor=110694007436259329\u0026limit=10\u0026order=desc"
    },
    "prev": {
      "href": "https://horizon.stellar.org/accounts/GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE/payments?cursor=119400713599217665\u0026limit=10\u0026order=asc"
    }
  },
  "_embedded": {
    "records": [
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/operations/119400713599217665"
          },
          "transaction": {
            "href": "https://horizon.stellar.org/transactions/b9d7c534b5fa168570a5bffe0f2089de150d00bf8cbd19ec93e897c565958f3f"
          },
          "effects": {
            "href": "https://horizon.stellar.org/operations/119400713599217665/effects"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=119400713599217665"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=119400713599217665"
          }
        },
        "id": "119400713599217665",
        "paging_token": "119400713599217665",
        "transaction_successful": true,
        "source_account": "GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE",
        "type": "payment",
        "type_i": 1,
        "created_at": "2020-01-17T20:32:38Z",
        "transaction_hash": "b9d7c534b5fa168570a5bffe0f2089de150d00bf8cbd19ec93e897c565958f3f",
        "asset_type": "credit_alphanum4",
        "asset_code": "USD",
        "asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX",
        "from": "GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE",
        "to": "GASWJWFRYE55KC7MGANZMMRBK5NPXT3HMPDQ6SEXZN6ZPWYXVVYBFRTE",
        "amount": "84.9410878"
      },
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/operations/117356420835532801"
          },
          "transaction": {
            "href": "https://horizon.stellar.org/transactions/c25dd84798076ee8ea126c78407d61c7e8f3efdf8739274f56b07a7029500b00"
          },
          "effects": {
            "href": "https://horizon.stellar.org/operations/117356420835532801/effects"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=117356420835532801"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=117356420835532801"
          }
        },
        "id": "117356420835532801",
        "paging_token": "117356420835532801",
        "transaction_successful": true,
        "source_account": "GDV4KECLSZLKRVH4ZTWVAS4I3W2LPAPV66ADFFUZKGIVOTK6GMKGJT53",
        "type": "payment",
        "type_i": 1,
        "created_at": "2019-12-18T08:23:35Z",
        "transaction_hash": "c25dd84798076ee8ea126c78407d61c7e8f3efdf8739274f56b07a7029500b00",
        "asset_type": "native",
        "from": "GDV4KECLSZLKRVH4ZTWVAS4I3W2LPAPV66ADFFUZKGIVOTK6GMKGJT53",
        "to": "GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE",
        "amount": "355.3887598"
      },
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/operations/115354197276323841"
          },
          "transaction": {
            "href": "https://horizon.stellar.org/transactions/c09d4cee993d60d73c80f036666966738a26b8f3b25d7275b93fd995505b5e5b"
          },
          "effects": {
            "href": "https://horizon.stellar.org/operations/115354197276323841/effects"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=115354197276323841"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=115354197276323841"
          }
        },
        "id": "115354197276323841",
        "paging_token": "115354197276323841",
        "transaction_successful": true,
        "source_account": "GDV4KECLSZLKRVH4ZTWVAS4I3W2LPAPV66ADFFUZKGIVOTK6GMKGJT53",
        "type": "payment",
        "type_i": 1,
        "created_at": "2019-11-18T19:59:40Z",
        "transaction_hash": "c09d4cee993d60d73c80f036666966738a26b8f3b25d7275b93fd995505b5e5b",
        "asset_type": "native",
        "from": "GDV4KECLSZLKRVH4ZTWVAS4I3W2LPAPV66ADFFUZKGIVOTK6GMKGJT53",
        "to": "GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE",
        "amount": "688.4065454"
      },
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/operations/110694007436259330"
          },
          "transaction": {
            "href": "https://horizon.stellar.org/transactions/26c996aa6afb299b6761f2335277196715160ade6aa001a755116448b145d3a7"
          },
          "effects": {
            "href": "https://horizon.stellar.org/operations/110694007436259330/effects"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=110694007436259330"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=110694007436259330"
          }
        },
        "id": "110694007436259330",
        "paging_token": "110694007436259330",
        "transaction_successful": true,
        "source_account": "GB44UMO65PK5NWMRP4S2OSZA5BD4ACOW5KQ6TWLLO2MP7S7N5MJ2MJVI",
        "type": "account_merge",
        "type_i": 8,
        "created_at": "2019-09-11T13:16:44Z",
        "transaction_hash": "26c996aa6afb299b6761f2335277196715160ade6aa001a755116448b145d3a7",
        "account": "GB44UMO65PK5NWMRP4S2OSZA5BD4ACOW5KQ6TWLLO2MP7S7N5MJ2MJVI",
        "into": "GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE"
      },
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/operations/110694007436259329"
          },
          "transaction": {
            "href": "https://horizon.stellar.org/transactions/26c996aa6afb299b6761f2335277196715160ade6aa001a755116448b145d3a7"
          },
          "effects": {
            "href": "https://horizon.stellar.org/operations/110694007436259329/effects"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=110694007436259329"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=110694007436259329"
          }
        },
        "id": "110694007436259329",
        "paging_token": "110694007436259329",
        "transaction_successful": true,
        "source_account": "GB44UMO65PK5NWMRP4S2OSZA5BD4ACOW5KQ6TWLLO2MP7S7N5MJ2MJVI",
        "type": "create_account",
        "type_i": 0,
        "created_at": "2019-09-11T13:16:44Z",
        "transaction_hash": "26c996aa6afb299b6761f2335277196715160ade6aa001a755116448b145d3a7",
        "starting_balance": "1.0000000",
        "funder": "GB44UMO65PK5NWMRP4S2OSZA5BD4ACOW5KQ6TWLLO2MP7S7N5MJ2MJVI",
        "account": "GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE"
      }
    ]
  }
}
JavaScript Streaming Example
JavaScript
var StellarSdk = require('stellar-sdk')
var server = new StellarSdk.Server('https://horizon.stellar.org')

var callback = function(resp) {
  console.log(resp)
}

var es = server
.payments()
.forAccount('GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE')
.cursor('now')
.stream({onmessage: callback})

Retrieve an Account's Effects

This 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 account as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known effect unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream effects created since your request time.

GET/accounts/:account_id/effects?cursor={paging_token}&order={asc,desc}&limit={1-200}
  • ARGUMENTREQUIRED

    DESCRIPTION

  • account_idrequired

    This account’s public key encoded in a base32 string representation.

  • cursoroptional

    A number that points to a specific location in a collection of responses and is pulled from the paging_token value of a record.

  • orderoptional

    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.

  • limitoptional

    The total 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.

Example Request
curl "https://horizon.stellar.org/accounts/GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE/effects?order=desc&limit=4"
Example Response
{
  "_links": {
    "self": {
      "href": "https://horizon.stellar.org/accounts/GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE/effects?cursor=\u0026limit=4\u0026order=desc"
    },
    "next": {
      "href": "https://horizon.stellar.org/accounts/GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE/effects?cursor=119399833130811393-1\u0026limit=4\u0026order=desc"
    },
    "prev": {
      "href": "https://horizon.stellar.org/accounts/GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE/effects?cursor=119400713599217665-2\u0026limit=4\u0026order=asc"
    }
  },
  "_embedded": {
    "records": [
      {
        "_links": {
          "operation": {
            "href": "https://horizon.stellar.org/operations/119400713599217665"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=119400713599217665-2"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=119400713599217665-2"
          }
        },
        "id": "0119400713599217665-0000000002",
        "paging_token": "119400713599217665-2",
        "account": "GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE",
        "type": "account_debited",
        "type_i": 3,
        "created_at": "2020-01-17T20:32:38Z",
        "asset_type": "credit_alphanum4",
        "asset_code": "USD",
        "asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX",
        "amount": "84.9410878"
      },
      {
        "_links": {
          "operation": {
            "href": "https://horizon.stellar.org/operations/119399833130811394"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=119399833130811394-3"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=119399833130811394-3"
          }
        },
        "id": "0119399833130811394-0000000003",
        "paging_token": "119399833130811394-3",
        "account": "GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE",
        "type": "trade",
        "type_i": 33,
        "created_at": "2020-01-17T20:13:22Z",
        "seller": "GBDVKE33GVVMBXX73OHIBRP6RAHKHHW2P4PQVV6UNOKQCOXU7GNUM4QI",
        "offer_id": 147618811,
        "sold_amount": "854.9537682",
        "sold_asset_type": "native",
        "bought_amount": "52.0920258",
        "bought_asset_type": "credit_alphanum4",
        "bought_asset_code": "USD",
        "bought_asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX"
      },
      {
        "_links": {
          "operation": {
            "href": "https://horizon.stellar.org/operations/119399833130811394"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=119399833130811394-1"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=119399833130811394-1"
          }
        },
        "id": "0119399833130811394-0000000001",
        "paging_token": "119399833130811394-1",
        "account": "GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE",
        "type": "trade",
        "type_i": 33,
        "created_at": "2020-01-17T20:13:22Z",
        "seller": "GCM4PT6XDZBWOOENDS6FOU22GJQLJPV2GC7VRVII4TFGZBA3ZXNM55SV",
        "offer_id": 147625249,
        "sold_amount": "539.0320108",
        "sold_asset_type": "native",
        "bought_amount": "32.8490620",
        "bought_asset_type": "credit_alphanum4",
        "bought_asset_code": "USD",
        "bought_asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX"
      },
      {
        "_links": {
          "operation": {
            "href": "https://horizon.stellar.org/operations/119399833130811393"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=119399833130811393-1"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=119399833130811393-1"
          }
        },
        "id": "0119399833130811393-0000000001",
        "paging_token": "119399833130811393-1",
        "account": "GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE",
        "type": "trustline_created",
        "type_i": 20,
        "created_at": "2020-01-17T20:13:22Z",
        "asset_type": "credit_alphanum4",
        "asset_code": "USD",
        "asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX",
        "limit": "922337203685.4775000"
      }
    ]
  }
}
JavaScript Streaming Example
JavaScript
var StellarSdk = require('stellar-sdk')
var server = new StellarSdk.Server('https://horizon.stellar.org')

var callback = function(resp) {
  console.log(resp)
}

var es = server
.effects()
.forAccount('GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE')
.cursor('now')
.stream({onmessage: callback})

Retrieve an Account's Offers

This 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 for this account as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known offer unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream offers created since your request time.

GET/accounts/:account_id/offers?cursor={paging_token}&order={asc,desc}&limit={1-200}
  • ARGUMENTREQUIRED

    DESCRIPTION

  • account_idrequired

    This account’s public key encoded in a base32 string representation.

  • cursoroptional

    A number that points to a specific location in a collection of responses and is pulled from the paging_token value of a record.

  • orderoptional

    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.

  • limitoptional

    The total 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.

Example Request
curl "https://horizon.stellar.org/accounts/GD3CJYUTZAY6JQF4CEI6Z7VW5O6VNGKZTBYUECTOJPEDTB7I2HZSPI2K/offers"
Example Response
{
  "_links": {
    "self": {
      "href": "https://horizon.stellar.org/accounts/GD3CJYUTZAY6JQF4CEI6Z7VW5O6VNGKZTBYUECTOJPEDTB7I2HZSPI2K/offers?cursor=\u0026limit=10\u0026order=asc"
    },
    "next": {
      "href": "https://horizon.stellar.org/accounts/GD3CJYUTZAY6JQF4CEI6Z7VW5O6VNGKZTBYUECTOJPEDTB7I2HZSPI2K/offers?cursor=164943216\u0026limit=10\u0026order=asc"
    },
    "prev": {
      "href": "https://horizon.stellar.org/accounts/GD3CJYUTZAY6JQF4CEI6Z7VW5O6VNGKZTBYUECTOJPEDTB7I2HZSPI2K/offers?cursor=164555927\u0026limit=10\u0026order=desc"
    }
  },
  "_embedded": {
    "records": [
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/offers/164555927"
          },
          "offer_maker": {
            "href": "https://horizon.stellar.org/accounts/GD3CJYUTZAY6JQF4CEI6Z7VW5O6VNGKZTBYUECTOJPEDTB7I2HZSPI2K"
          }
        },
        "id": 164555927,
        "paging_token": "164555927",
        "seller": "GD3CJYUTZAY6JQF4CEI6Z7VW5O6VNGKZTBYUECTOJPEDTB7I2HZSPI2K",
        "selling": {
          "asset_type": "native"
        },
        "buying": {
          "asset_type": "credit_alphanum4",
          "asset_code": "BB1",
          "asset_issuer": "GD5J6HLF5666X4AZLTFTXLY46J5SW7EXRKBLEYPJP33S33MXZGV6CWFN"
        },
        "amount": "214.9999939",
        "price_r": {
          "n": 10000000,
          "d": 86000001
        },
        "price": "0.1162791",
        "last_modified_ledger": 28383147,
        "last_modified_time": "2020-02-24T22:58:38Z"
      },
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/offers/164943216"
          },
          "offer_maker": {
            "href": "https://horizon.stellar.org/accounts/GD3CJYUTZAY6JQF4CEI6Z7VW5O6VNGKZTBYUECTOJPEDTB7I2HZSPI2K"
          }
        },
        "id": 164943216,
        "paging_token": "164943216",
        "seller": "GD3CJYUTZAY6JQF4CEI6Z7VW5O6VNGKZTBYUECTOJPEDTB7I2HZSPI2K",
        "selling": {
          "asset_type": "credit_alphanum4",
          "asset_code": "BB1",
          "asset_issuer": "GD5J6HLF5666X4AZLTFTXLY46J5SW7EXRKBLEYPJP33S33MXZGV6CWFN"
        },
        "buying": {
          "asset_type": "native"
        },
        "amount": "24.9999990",
        "price_r": {
          "n": 32224991,
          "d": 2500000
        },
        "price": "12.8899964",
        "last_modified_ledger": 28394149,
        "last_modified_time": "2020-02-25T15:49:57Z"
      }
    ]
  }
}
JavaScript Streaming Example
JavaScript
var StellarSdk = require('stellar-sdk')
var server = new StellarSdk.Server('https://horizon.stellar.org')

var callback = function(resp) {
  console.log(resp)
}

var es = server
.offers()
.forAccount('GD3CJYUTZAY6JQF4CEI6Z7VW5O6VNGKZTBYUECTOJPEDTB7I2HZSPI2K')
.cursor('now')
.stream({onmessage: callback})

Retrieve an Account's Trades

This 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 they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known trade unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream trades created since your request time.

GET/accounts/:account_id/trades?cursor={paging_token}&order={asc,desc}&limit={1-200}
  • ARGUMENTREQUIRED

    DESCRIPTION

  • account_idrequired

    This account’s public key encoded in a base32 string representation.

  • cursoroptional

    A number that points to a specific location in a collection of responses and is pulled from the paging_token value of a record.

  • orderoptional

    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.

  • limitoptional

    The total 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.

Example Request
curl "https://horizon.stellar.org/accounts/GD3CJYUTZAY6JQF4CEI6Z7VW5O6VNGKZTBYUECTOJPEDTB7I2HZSPI2K/trades?limit=3"
Example Response
{
  "_links": {
    "self": {
      "href": "https://horizon.stellar.org/accounts/GD3CJYUTZAY6JQF4CEI6Z7VW5O6VNGKZTBYUECTOJPEDTB7I2HZSPI2K/trades?cursor=\u0026limit=3\u0026order=asc"
    },
    "next": {
      "href": "https://horizon.stellar.org/accounts/GD3CJYUTZAY6JQF4CEI6Z7VW5O6VNGKZTBYUECTOJPEDTB7I2HZSPI2K/trades?cursor=107449584845914113-0\u0026limit=3\u0026order=asc"
    },
    "prev": {
      "href": "https://horizon.stellar.org/accounts/GD3CJYUTZAY6JQF4CEI6Z7VW5O6VNGKZTBYUECTOJPEDTB7I2HZSPI2K/trades?cursor=107449468881756161-0\u0026limit=3\u0026order=desc"
    }
  },
  "_embedded": {
    "records": [
      {
        "_links": {
          "self": {
            "href": ""
          },
          "base": {
            "href": "https://horizon.stellar.org/accounts/GCO7OW5P2PP7WDN6YUDXUUOPAR4ZHJSDDCZTIAQRTRZHKQWV45WUPBWX"
          },
          "counter": {
            "href": "https://horizon.stellar.org/accounts/GD3CJYUTZAY6JQF4CEI6Z7VW5O6VNGKZTBYUECTOJPEDTB7I2HZSPI2K"
          },
          "operation": {
            "href": "https://horizon.stellar.org/operations/107449468881756161"
          }
        },
        "id": "107449468881756161-0",
        "paging_token": "107449468881756161-0",
        "ledger_close_time": "2019-07-26T09:17:02Z",
        "offer_id": "104078276",
        "base_offer_id": "104078276",
        "base_account": "GCO7OW5P2PP7WDN6YUDXUUOPAR4ZHJSDDCZTIAQRTRZHKQWV45WUPBWX",
        "base_amount": "4433.2000000",
        "base_asset_type": "native",
        "counter_offer_id": "4719135487309144065",
        "counter_account": "GD3CJYUTZAY6JQF4CEI6Z7VW5O6VNGKZTBYUECTOJPEDTB7I2HZSPI2K",
        "counter_amount": "443.3200000",
        "counter_asset_type": "credit_alphanum4",
        "counter_asset_code": "BB1",
        "counter_asset_issuer": "GD5J6HLF5666X4AZLTFTXLY46J5SW7EXRKBLEYPJP33S33MXZGV6CWFN",
        "base_is_seller": true,
        "price": {
          "n": 1,
          "d": 10
        }
      },
      {
        "_links": {
          "self": {
            "href": ""
          },
          "base": {
            "href": "https://horizon.stellar.org/accounts/GCQDOTIILRG634IRWAODTUS6H6Q7VUUNKZINBDJOXGJFR7YZ57FGYV7B"
          },
          "counter": {
            "href": "https://horizon.stellar.org/accounts/GD3CJYUTZAY6JQF4CEI6Z7VW5O6VNGKZTBYUECTOJPEDTB7I2HZSPI2K"
          },
          "operation": {
            "href": "https://horizon.stellar.org/operations/107449486061649921"
          }
        },
        "id": "107449486061649921-0",
        "paging_token": "107449486061649921-0",
        "ledger_close_time": "2019-07-26T09:17:25Z",
        "offer_id": "104273938",
        "base_offer_id": "104273938",
        "base_account": "GCQDOTIILRG634IRWAODTUS6H6Q7VUUNKZINBDJOXGJFR7YZ57FGYV7B",
        "base_amount": "10.0000000",
        "base_asset_type": "native",
        "counter_offer_id": "4719135504489037825",
        "counter_account": "GD3CJYUTZAY6JQF4CEI6Z7VW5O6VNGKZTBYUECTOJPEDTB7I2HZSPI2K",
        "counter_amount": "1.0000000",
        "counter_asset_type": "credit_alphanum4",
        "counter_asset_code": "BB1",
        "counter_asset_issuer": "GD5J6HLF5666X4AZLTFTXLY46J5SW7EXRKBLEYPJP33S33MXZGV6CWFN",
        "base_is_seller": true,
        "price": {
          "n": 1,
          "d": 10
        }
      },
      {
        "_links": {
          "self": {
            "href": ""
          },
          "base": {
            "href": "https://horizon.stellar.org/accounts/GAMU5TQFUMDGVKYQPPDCD2MKKUUWELSQAEKNNU4RFQCWFSRBPJA2MAGQ"
          },
          "counter": {
            "href": "https://horizon.stellar.org/accounts/GD3CJYUTZAY6JQF4CEI6Z7VW5O6VNGKZTBYUECTOJPEDTB7I2HZSPI2K"
          },
          "operation": {
            "href": "https://horizon.stellar.org/operations/107449584845914113"
          }
        },
        "id": "107449584845914113-0",
        "paging_token": "107449584845914113-0",
        "ledger_close_time": "2019-07-26T09:19:30Z",
        "offer_id": "104299223",
        "base_offer_id": "104299223",
        "base_account": "GAMU5TQFUMDGVKYQPPDCD2MKKUUWELSQAEKNNU4RFQCWFSRBPJA2MAGQ",
        "base_amount": "748.5338945",
        "base_asset_type": "native",
        "counter_offer_id": "104299548",
        "counter_account": "GD3CJYUTZAY6JQF4CEI6Z7VW5O6VNGKZTBYUECTOJPEDTB7I2HZSPI2K",
        "counter_amount": "74.8533887",
        "counter_asset_type": "credit_alphanum4",
        "counter_asset_code": "BB1",
        "counter_asset_issuer": "GD5J6HLF5666X4AZLTFTXLY46J5SW7EXRKBLEYPJP33S33MXZGV6CWFN",
        "base_is_seller": true,
        "price": {
          "n": 10000000,
          "d": 100000001
        }
      }
    ]
  }
}
JavaScript Streaming Example
JavaScript
var StellarSdk = require('stellar-sdk')
var server = new StellarSdk.Server('https://horizon.stellar.org')

var callback = function(resp) {
  console.log(resp)
}

var es = server
.trades()
.forAccount('GD3CJYUTZAY6JQF4CEI6Z7VW5O6VNGKZTBYUECTOJPEDTB7I2HZSPI2K')
.cursor('now')
.stream({onmessage: callback})

Retrieve an Account's Data

This endpoint represents a single data for a given account.

GET/accounts/:account_id/data/:key
  • ARGUMENTREQUIRED

    DESCRIPTION

  • account_idrequired

    This account’s public key encoded in a base32 string representation.

  • keyrequired

    The key name for this data.

Example Request
curl "https://horizon.stellar.org/accounts/GCAXBKU3AKYJPLQ6PEJ6L47KOATCYCBJ2NFRGAK7FUUA2DCEUC265SU2/data/config.memo_required"
Example Response
{
  "value": "MQ=="
}

Offers

Offers are statements about how much of an asset an account wants to buy or sell.

Learn more about offers.


The Offer Object

When Horizon returns information about an offer, it uses the following format:

  • ATTRIBUTEDATA TYPE

    DESCRIPTION

  • idstring

    A unique identifier for this offer.

  • paging_tokennumber

    A cursor value for use in pagination.

  • sellerstring

    The account ID of the account making this offer.

  • sellingasset code

    The asset this offer wants to sell.

  • buyingasset code

    The asset this offer wants to buy.

  • amountstring

    The amount of selling that the account making this offer is willing to sell.

  • price_robject

    A precise representation of the buy and sell price of the assets on offer.

  • pricestring

    How many units of buying it takes to get 1 unit of selling. A number representing the decimal form of price_r.

  • last_modified_ledgerinteger

    The sequence number of the last ledger in which this offer was modified.

  • last_modified_timestring

    An ISO 8601 formatted string of last modification time.

Example
{
  "_links": {
    "self": {
      "href": "https://horizon.stellar.org/offers/165561423"
    },
    "offer_maker": {
      "href": "https://horizon.stellar.org/accounts/GCK4WSNF3F6ZNCMK6BU77ZCZ3NMF3JGU2U3ZAPKXYBKYYCJA72FDBY7K"
    }
  },
  "id": 165561423,
  "paging_token": "165561423",
  "seller": "GCK4WSNF3F6ZNCMK6BU77ZCZ3NMF3JGU2U3ZAPKXYBKYYCJA72FDBY7K",
  "selling": {
    "asset_type": "credit_alphanum4",
    "asset_code": "NGNT",
    "asset_issuer": "GAWODAROMJ33V5YDFY3NPYTHVYQG7MJXVJ2ND3AOGIHYRWINES6ACCPD"
  },
  "buying": {
    "asset_type": "native"
  },
  "amount": "18421.4486092",
  "price_r": {
    "n": 45112058,
    "d": 941460545
  },
  "price": "0.0479171",
  "last_modified_ledger": 28411995,
  "last_modified_time": "2020-02-26T19:29:16Z"
}

Retrieve an Offer

The single offer endpoint provides information on a specific offer.

GET/offers/:offer_id
  • ARGUMENTREQUIRED

    DESCRIPTION

  • offer_idrequired

    A unique identifier for this offer.

Example Request
curl "https://horizon.stellar.org/offers/165563085"
Example Response
{
  "_links": {
    "self": {
      "href": "https://horizon.stellar.org/offers/165563085"
    },
    "offer_maker": {
      "href": "https://horizon.stellar.org/accounts/GCM4PT6XDZBWOOENDS6FOU22GJQLJPV2GC7VRVII4TFGZBA3ZXNM55SV"
    }
  },
  "id": 165563085,
  "paging_token": "165563085",
  "seller": "GCM4PT6XDZBWOOENDS6FOU22GJQLJPV2GC7VRVII4TFGZBA3ZXNM55SV",
  "selling": {
    "asset_type": "credit_alphanum4",
    "asset_code": "USD",
    "asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX"
  },
  "buying": {
    "asset_type": "native"
  },
  "amount": "26.1075388",
  "price_r": {
    "n": 1449156725,
    "d": 84642346
  },
  "price": "17.1209423",
  "last_modified_ledger": 28412042,
  "last_modified_time": null
}

List All Offers

This 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 Stellar ledger. If called in streaming mode, Horizon will start at the earliest known offer unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream offers created since your request time.

When filtering by buying or selling arguments, you must use a combination of selling_asset_type, selling_asset_issuer, and selling_asset_code for the selling asset, or a combination of buying_asset_type, buying_asset_issuer, and buying_asset_code for the buying asset.

GET/offers?seller={:account_id}&selling_asset_type={native,credit_alphanum4,credit_alphanum12}&selling_asset_issuer={:account_id}&selling_asset_code{:asset_code}&buying_asset_type={native,credit_alphanum4,credit_alphanum12}&buying_asset_issuer={:account_id}&buying_asset_code{:asset_code}&cursor={paging_token}&order={asc,desc}&limit={1-200}&include_failed{true,false}
  • ARGUMENTREQUIRED

    DESCRIPTION

  • selleroptional

    The account ID of the offer creator.

  • selling_asset_typeoptional

    The type for the selling asset. Either native, credit_alphanum4, or credit_alphanum12.

  • selling_asset_issueroptional

    The Stellar address of the selling asset’s issuer.

  • selling_asset_codeoptional

    The code for the selling asset.

  • buying_asset_typeoptional

    The type for the buying asset. Either native, credit_alphanum4, or credit_alphanum12.

  • buying_asset_issueroptional

    The Stellar address of the buying asset’s issuer.

  • buying_asset_codeoptional

    The code for the buying asset.

  • cursoroptional

    A number that points to a specific location in a collection of responses and is pulled from the paging_token value of a record.

  • orderoptional

    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.

  • limitoptional

    The total 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.

Example Request
curl "https://horizon.stellar.org/offers?selling_asset_type=credit_alphanum4&selling_asset_issuer=GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX&selling_asset_code=USD&limit=3"
Example Response
{
  "_links": {
    "self": {
      "href": "https://horizon.stellar.org/offers?cursor=\u0026limit=3\u0026order=asc\u0026selling_asset_code=USD\u0026selling_asset_issuer=GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX\u0026selling_asset_type=credit_alphanum4"
    },
    "next": {
      "href": "https://horizon.stellar.org/offers?cursor=88345152\u0026limit=3\u0026order=asc\u0026selling_asset_code=USD\u0026selling_asset_issuer=GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX\u0026selling_asset_type=credit_alphanum4"
    },
    "prev": {
      "href": "https://horizon.stellar.org/offers?cursor=71673427\u0026limit=3\u0026order=desc\u0026selling_asset_code=USD\u0026selling_asset_issuer=GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX\u0026selling_asset_type=credit_alphanum4"
    }
  },
  "_embedded": {
    "records": [
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/offers/71673427"
          },
          "offer_maker": {
            "href": "https://horizon.stellar.org/accounts/GBJPWEIFX6KO4H52BF3QJDYRCLXB2P3Z3QTKWUGFOOFH5MSRZV4WLRZ7"
          }
        },
        "id": 71673427,
        "paging_token": "71673427",
        "seller": "GBJPWEIFX6KO4H52BF3QJDYRCLXB2P3Z3QTKWUGFOOFH5MSRZV4WLRZ7",
        "selling": {
          "asset_type": "credit_alphanum4",
          "asset_code": "USD",
          "asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX"
        },
        "buying": {
          "asset_type": "credit_alphanum4",
          "asset_code": "BTC",
          "asset_issuer": "GAUTUYY2THLF7SGITDFMXJVYH3LHDSMGEAKSBU267M2K7A3W543CKUEF"
        },
        "amount": "25.6545775",
        "price_r": {
          "n": 289696073,
          "d": 25654776
        },
        "price": "11.2920913",
        "last_modified_ledger": 26981646,
        "last_modified_time": "2019-11-26T13:42:10Z"
      },
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/offers/88328208"
          },
          "offer_maker": {
            "href": "https://horizon.stellar.org/accounts/GBSYMLHG5TGQ4O3NSPIO4DSCS4AC6YRJOQWQC3EW7O257RAUHI5SA45R"
          }
        },
        "id": 88328208,
        "paging_token": "88328208",
        "seller": "GBSYMLHG5TGQ4O3NSPIO4DSCS4AC6YRJOQWQC3EW7O257RAUHI5SA45R",
        "selling": {
          "asset_type": "credit_alphanum4",
          "asset_code": "USD",
          "asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX"
        },
        "buying": {
          "asset_type": "credit_alphanum4",
          "asset_code": "BTC",
          "asset_issuer": "GBVOL67TMUQBGL4TZYNMY3ZQ5WGQYFPFD5VJRWXR72VA33VFNL225PL5"
        },
        "amount": "2.4664893",
        "price_r": {
          "n": 500,
          "d": 1233
        },
        "price": "0.4055150",
        "last_modified_ledger": 23886660,
        "last_modified_time": "2019-05-17T00:33:16Z"
      },
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/offers/88345152"
          },
          "offer_maker": {
            "href": "https://horizon.stellar.org/accounts/GACTQP5TAWIXF2LV4GWGJWIUNHKDWZ2ITCFDP37FIGOFPR3ORMQRR63U"
          }
        },
        "id": 88345152,
        "paging_token": "88345152",
        "seller": "GACTQP5TAWIXF2LV4GWGJWIUNHKDWZ2ITCFDP37FIGOFPR3ORMQRR63U",
        "selling": {
          "asset_type": "credit_alphanum4",
          "asset_code": "USD",
          "asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX"
        },
        "buying": {
          "asset_type": "credit_alphanum4",
          "asset_code": "USD",
          "asset_issuer": "GBUYUAI75XXWDZEKLY66CFYKQPET5JR4EENXZBUZ3YXZ7DS56Z4OKOFU"
        },
        "amount": "10.0000000",
        "price_r": {
          "n": 11,
          "d": 10
        },
        "price": "1.1000000",
        "last_modified_ledger": 23887778,
        "last_modified_time": "2019-05-17T02:19:19Z"
      }
    ]
  }
}
JavaScript Streaming Example
JavaScript
var StellarSdk = require('stellar-sdk')
var server = new StellarSdk.Server('https://horizon.stellar.org')

var callback = function(resp) {
  console.log(resp)
}

var es = server
.offers()
.selling(new StellarSdk.Asset('USD', 'GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX'))
.cursor('now')
.stream({onmessage: callback})

Trades

When an offer is fully or partially fulfilled, a trade happens. Trades can also be caused by successful path payments, because path payments involve fulfilling offers.

A trade occurs between two parties—base and counter. Which is which is either arbitrary or determined by the calling query.

Learn more about trades.

Endpoints

The Trade Object

When Horizon returns information about a trade, it uses the following format:

  • ATTRIBUTEDATA TYPE

    DESCRIPTION

  • idstring

    A unique identifier for this trade.

  • paging_tokennumber

    A cursor value for use in pagination.

  • ledger_close_timestring

    An ISO 8601 formatted string of when the ledger with this trade was closed.

  • offer_idstring

    The sell offer ID. DECPRECATED

  • base_accountstring

    The account ID of the base party for this trade.

  • base_offer_idstring

    The base offer ID. If this offer was immediately and fully consumed, this will be a synethic ID.

  • base_amountstring

    The amount of the base asset that was moved from base_account to counter_account.

  • base_asset_typestring

    The type for the base asset. Either native, credit_alphanum4, or credit_alphanum12.

  • base_asset_codestring

    The code for the base asset.

  • base_asset_issuerstring

    The Stellar address of the base asset’s issuer.

  • counter_offer_idstring

    The counter offer ID. If this offer was immediately and fully consumed, this will be a synethic ID.

  • counter_amountstring

    The amount of the counter asset that was moved from counter_account to base_account.

  • counter_asset_typestring

    The type for the counter asset. Either native, credit_alphanum4, or credit_alphanum12.

  • counter_asset_codestring

    The code for the counter asset.

  • counter_asset_issuerstring

    The Stellar address of the counter asset’s issuer.

  • priceobject

    An object of a number numerator and number denominator that represents the original offer price. To derive the price, divide n by d.

  • base_is_sellerboolean

    Indicates with party is the seller.

Example
{
  "_links": {
    "self": {
      "href": ""
    },
    "base": {
      "href": "https://horizon.stellar.org/accounts/GA23DVJUJVXUQ45SKQMZR7KH2ZOOBFWGWSEXHCT7VVKP2TYIMCQTQGNQ"
    },
    "counter": {
      "href": "https://horizon.stellar.org/accounts/GAFGG7CRFRCJLBHGI5L4IZD4QYR4GDX5NKB46CE4KZMNBILBTP3L4M75"
    },
    "operation": {
      "href": "https://horizon.stellar.org/operations/100089067462524929"
    }
  },
  "id": "100089067462524929-0",
  "paging_token": "100089067462524929-0",
  "ledger_close_time": "2019-04-07T11:30:03Z",
  "offer_id": "79502917",
  "base_offer_id": "4711775085889912833",
  "base_account": "GA23DVJUJVXUQ45SKQMZR7KH2ZOOBFWGWSEXHCT7VVKP2TYIMCQTQGNQ",
  "base_amount": "99.9999996",
  "base_asset_type": "native",
  "counter_offer_id": "79502917",
  "counter_account": "GAFGG7CRFRCJLBHGI5L4IZD4QYR4GDX5NKB46CE4KZMNBILBTP3L4M75",
  "counter_amount": "11.4722884",
  "counter_asset_type": "credit_alphanum4",
  "counter_asset_code": "EURT",
  "counter_asset_issuer": "GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S",
  "base_is_seller": false,
  "price": {
    "n": 10000000,
    "d": 87166567
  }
}

List All Trades

This 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. If called in streaming mode, Horizon will start at the earliest known trade unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream trades created since your request time.

When filtering for a specific orderbook, you must use use all six of these arguments: base_asset_type, base_asset_issuer, base_asset_code, counter_asset_type, counter_asset_issuer, and counter_asset_code. If the base or counter asset is XLM, you only need to indicate the asset type as native and do not need to designate the code or the issuer.

GET/trades?offer_id={:offer_id}&base_asset_type={native,credit_alphanum4,credit_alphanum12}&base_asset_issuer={:account_id}&base_asset_code{:asset_code}&counter_asset_type={native,credit_alphanum4,credit_alphanum12}&counter_asset_issuer={:account_id}&counter_asset_code{:asset_code}&cursor={paging_token}&order={asc,desc}&limit={1-200}&include_failed{true,false}
  • ARGUMENTREQUIRED

    DESCRIPTION

  • offer_idoptional

    The offer ID. Used to filter for trades originating from a specific offer.

  • base_asset_typeoptional

    The type for the base asset. Either native, credit_alphanum4, or credit_alphanum12.

  • base_asset_issueroptional

    The Stellar address of the base asset’s issuer.

  • base_asset_codeoptional

    The code for the base asset.

  • counter_asset_typeoptional

    The type for the counter asset. Either native, credit_alphanum4, or credit_alphanum12.

  • counter_asset_issueroptional

    The Stellar address of the counter asset’s issuer.

  • counter_asset_codeoptional

    The code for the counter asset.

  • cursoroptional

    A number that points to a specific location in a collection of responses and is pulled from the paging_token value of a record.

  • orderoptional

    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.

  • limitoptional

    The total 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.

Example Request
curl "https://horizon.stellar.org/trades?base_asset_type=credit_alphanum4&base_asset_issuer=GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX&base_asset_code=USD&counter_asset_type=native&limit=3"
Example Response
{
  "_links": {
    "self": {
      "href": "https://horizon.stellar.org/trades?base_asset_code=USD\u0026base_asset_issuer=GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX\u0026base_asset_type=credit_alphanum4\u0026counter_asset_type=native\u0026cursor=\u0026limit=3\u0026order=asc"
    },
    "next": {
      "href": "https://horizon.stellar.org/trades?base_asset_code=USD\u0026base_asset_issuer=GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX\u0026base_asset_type=credit_alphanum4\u0026counter_asset_type=native\u0026cursor=83056000260648961-0\u0026limit=3\u0026order=asc"
    },
    "prev": {
      "href": "https://horizon.stellar.org/trades?base_asset_code=USD\u0026base_asset_issuer=GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX\u0026base_asset_type=credit_alphanum4\u0026counter_asset_type=native\u0026cursor=82854686553571330-0\u0026limit=3\u0026order=desc"
    }
  },
  "_embedded": {
    "records": [
      {
        "_links": {
          "self": {
            "href": ""
          },
          "base": {
            "href": "https://horizon.stellar.org/accounts/GD47M25MLSCSYP4SIVNQXVQ4KWNLVGXS4S2AXPTYEJK6OY4VALJWK4BS"
          },
          "counter": {
            "href": "https://horizon.stellar.org/accounts/GBCHK52UXADCQCO7FBA5VBYPGCJFXHCNAVJTMUEKOCCNKJH5F35UZU5T"
          },
          "operation": {
            "href": "https://horizon.stellar.org/operations/82854686553571330"
          }
        },
        "id": "82854686553571330-0",
        "paging_token": "82854686553571330-0",
        "ledger_close_time": "2018-08-05T00:55:34Z",
        "offer_id": "23074703",
        "base_offer_id": "23074703",
        "base_account": "GD47M25MLSCSYP4SIVNQXVQ4KWNLVGXS4S2AXPTYEJK6OY4VALJWK4BS",
        "base_amount": "22.9174941",
        "base_asset_type": "credit_alphanum4",
        "base_asset_code": "USD",
        "base_asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX",
        "counter_offer_id": "4694540704980959234",
        "counter_account": "GBCHK52UXADCQCO7FBA5VBYPGCJFXHCNAVJTMUEKOCCNKJH5F35UZU5T",
        "counter_amount": "97.9999800",
        "counter_asset_type": "native",
        "base_is_seller": true,
        "price": {
          "n": 106905209,
          "d": 25000000
        }
      },
      {
        "_links": {
          "self": {
            "href": ""
          },
          "base": {
            "href": "https://horizon.stellar.org/accounts/GD47M25MLSCSYP4SIVNQXVQ4KWNLVGXS4S2AXPTYEJK6OY4VALJWK4BS"
          },
          "counter": {
            "href": "https://horizon.stellar.org/accounts/GDURV3I6U5OTUV75WWAG2HWZTQHNMCR3NR2P5GPKDCIS2AEWCFSOLVFU"
          },
          "operation": {
            "href": "https://horizon.stellar.org/operations/83005225157287937"
          }
        },
        "id": "83005225157287937-0",
        "paging_token": "83005225157287937-0",
        "ledger_close_time": "2018-08-07T02:01:53Z",
        "offer_id": "23400441",
        "base_offer_id": "23400441",
        "base_account": "GD47M25MLSCSYP4SIVNQXVQ4KWNLVGXS4S2AXPTYEJK6OY4VALJWK4BS",
        "base_amount": "1.0000000",
        "base_asset_type": "credit_alphanum4",
        "base_asset_code": "USD",
        "base_asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX",
        "counter_offer_id": "4694691243584675841",
        "counter_account": "GDURV3I6U5OTUV75WWAG2HWZTQHNMCR3NR2P5GPKDCIS2AEWCFSOLVFU",
        "counter_amount": "4.3080953",
        "counter_asset_type": "native",
        "base_is_seller": true,
        "price": {
          "n": 430809521,
          "d": 100000000
        }
      },
      {
        "_links": {
          "self": {
            "href": ""
          },
          "base": {
            "href": "https://horizon.stellar.org/accounts/GD47M25MLSCSYP4SIVNQXVQ4KWNLVGXS4S2AXPTYEJK6OY4VALJWK4BS"
          },
          "counter": {
            "href": "https://horizon.stellar.org/accounts/GBNDB4UHLDRBLR35JNU4ADYG3J5WA4LJZOPBXMNHZKTKSL37BDX4UBQY"
          },
          "operation": {
            "href": "https://horizon.stellar.org/operations/83056000260648961"
          }
        },
        "id": "83056000260648961-0",
        "paging_token": "83056000260648961-0",
        "ledger_close_time": "2018-08-07T18:27:33Z",
        "offer_id": "23400441",
        "base_offer_id": "23400441",
        "base_account": "GD47M25MLSCSYP4SIVNQXVQ4KWNLVGXS4S2AXPTYEJK6OY4VALJWK4BS",
        "base_amount": "1.0000000",
        "base_asset_type": "credit_alphanum4",
        "base_asset_code": "USD",
        "base_asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX",
        "counter_offer_id": "4694742018688036865",
        "counter_account": "GBNDB4UHLDRBLR35JNU4ADYG3J5WA4LJZOPBXMNHZKTKSL37BDX4UBQY",
        "counter_amount": "4.3080953",
        "counter_asset_type": "native",
        "base_is_seller": true,
        "price": {
          "n": 430809521,
          "d": 100000000
        }
      }
    ]
  }
}
JavaScript Streaming Example
JavaScript
var StellarSdk = require('stellar-sdk')
var server = new StellarSdk.Server('https://horizon.stellar.org')

var tradesHandler = function(resp) {
  console.log(resp)
}

var es = server
.trades()
.forAssetPair(
  new StellarSdk.Asset('USD', 'GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX'),
  new StellarSdk.Asset.native(),
)
.cursor('now')
.stream({onmessage: tradesHandler})

Assets

Assets are representations of value issued on the Stellar network. An asset consists of a type, code, and issuer.

Learn more about assets.

Endpoints

The Asset Object

When Horizon returns information about an asset, it uses the following format:

  • ATTRIBUTEDATA TYPE

    DESCRIPTION

  • asset_typestring

    This asset’s type. Either credit_alphanum4 or credit_alphanum12.

  • asset_codestring

    This asset’s code

  • asset_issuerstring

    The Stellar address of this asset’s issuer.

  • amountnumber

    The number of units issued for this asset.

  • num_accountsnumber

    The numnber of accounts that have issued a trustline to this asset. If the auth_required flag for this asset’s issuer is set to true, this number only includes the accounts who have both set up a trustline to the asset and have been authorized to hold the asset.

  • flagsobject

    Flags denote the enabling/disabling of certain asset issuer privileges.

  • paging_tokennumber

    A cursor value for use in pagination.

Example
{
  "_links": {
    "self": {
      "href": "https://horizon.stellar.org/assets?asset_code=USD\u0026asset_issuer=GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX\u0026cursor=\u0026limit=10\u0026order=asc"
    },
    "next": {
      "href": "https://horizon.stellar.org/assets?asset_code=USD\u0026asset_issuer=GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX\u0026cursor=USD_GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX_credit_alphanum4\u0026limit=10\u0026order=asc"
    },
    "prev": {
      "href": "https://horizon.stellar.org/assets?asset_code=USD\u0026asset_issuer=GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX\u0026cursor=USD_GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX_credit_alphanum4\u0026limit=10\u0026order=desc"
    }
  },
  "_embedded": {
    "records": [
      {
        "_links": {
          "toml": {
            "href": "https://www.anchorusd.com/.well-known/stellar.toml"
          }
        },
        "asset_type": "credit_alphanum4",
        "asset_code": "USD",
        "asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX",
        "paging_token": "USD_GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX_credit_alphanum4",
        "amount": "1347404.4083346",
        "num_accounts": 9390,
        "flags": {
          "auth_required": false,
          "auth_revocable": false,
          "auth_immutable": false
        }
      }
    ]
  }
}

List All Assets

This endpoint lists all assets.

GET/assets?asset_code{:asset_code}&asset_issuer={:account_id}&cursor={paging_token}&order={asc,desc}&limit={1-200}&include_failed{true,false}
  • ARGUMENTREQUIRED

    DESCRIPTION

  • asset_codeoptional

    The code of the asset you would like to filter by.

  • asset_issueroptional

    The Stellar address of the issuer for the asset you would like to filter by.

  • cursoroptional

    A number that points to a specific location in a collection of responses and is pulled from the paging_token value of a record.

  • orderoptional

    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.

  • limitoptional

    The total 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.

Example Request
curl "https://horizon.stellar.org/assets?asset_code=CNY&limit=3"
Example Response
{
  "_links": {
    "self": {
      "href": "https://horizon.stellar.org/assets?asset_code=CNY\u0026cursor=\u0026limit=3\u0026order=asc"
    },
    "next": {
      "href": "https://horizon.stellar.org/assets?asset_code=CNY\u0026cursor=CNY_GATEMHCCKCY67ZUCKTROYN24ZYT5GK4EQZ65JJLDHKHRUZI3EUEKMTCH_credit_alphanum4\u0026limit=3\u0026order=asc"
    },
    "prev": {
      "href": "https://horizon.stellar.org/assets?asset_code=CNY\u0026cursor=CNY_GAOT23KBW2HL6HVZFPNFLLT5VGIKGTLGR3AFDHYSRIWS4QKBYRPUW4N3_credit_alphanum4\u0026limit=3\u0026order=desc"
    }
  },
  "_embedded": {
    "records": [
      {
        "_links": {
          "toml": {
            "href": "https://stellar.chenyuzhifu.com/.well-known/stellar.toml"
          }
        },
        "asset_type": "credit_alphanum4",
        "asset_code": "CNY",
        "asset_issuer": "GAOT23KBW2HL6HVZFPNFLLT5VGIKGTLGR3AFDHYSRIWS4QKBYRPUW4N3",
        "paging_token": "CNY_GAOT23KBW2HL6HVZFPNFLLT5VGIKGTLGR3AFDHYSRIWS4QKBYRPUW4N3_credit_alphanum4",
        "amount": "997268.0000000",
        "num_accounts": 23,
        "flags": {
          "auth_required": false,
          "auth_revocable": false,
          "auth_immutable": false
        }
      },
      {
        "_links": {
          "toml": {
            "href": "https://ripplefox.com/.well-known/stellar.toml"
          }
        },
        "asset_type": "credit_alphanum4",
        "asset_code": "CNY",
        "asset_issuer": "GAREELUB43IRHWEASCFBLKHURCGMHE5IF6XSE7EXDLACYHGRHM43RFOX",
        "paging_token": "CNY_GAREELUB43IRHWEASCFBLKHURCGMHE5IF6XSE7EXDLACYHGRHM43RFOX_credit_alphanum4",
        "amount": "18318343.2623217",
        "num_accounts": 5514,
        "flags": {
          "auth_required": false,
          "auth_revocable": false,
          "auth_immutable": false
        }
      },
      {
        "_links": {
          "toml": {
            "href": "https://naobtc.com/.well-known/stellar.toml"
          }
        },
        "asset_type": "credit_alphanum4",
        "asset_code": "CNY",
        "asset_issuer": "GATEMHCCKCY67ZUCKTROYN24ZYT5GK4EQZ65JJLDHKHRUZI3EUEKMTCH",
        "paging_token": "CNY_GATEMHCCKCY67ZUCKTROYN24ZYT5GK4EQZ65JJLDHKHRUZI3EUEKMTCH_credit_alphanum4",
        "amount": "0.0000000",
        "num_accounts": 1,
        "flags": {
          "auth_required": false,
          "auth_revocable": false,
          "auth_immutable": false
        }
      }
    ]
  }
}
JavaScript Streaming Example
JavaScript
var StellarSdk = require('stellar-sdk')
var server = new StellarSdk.Server('https://horizon.stellar.org')

var callback = function(resp) {
  console.log(resp)
}

var es = server
.assets()
.forCode('CNY')
.cursor('now')
.stream({onmessage: callback})

Aggregations

Endpoints that aggregate data about the ledger.


Order Books

An order book is a collections of offers for a specific pair of assets.

Learn more about order books.

Endpoints

The Order Book Object

When Horizon returns information about an order book, it uses the following format:

  • ATTRIBUTEDATA TYPE

    DESCRIPTION

  • bidsobject

    The prices and amounts for the buyside of the asset pair.

  • asksobject

    The prices and amounts for the sellside of the asset pair.

  • baseobject

    Details about the base asset.

  • counterobject

    Details about the counter asset.

Example
{
  "bids": [
    {
      "price_r": {
        "n": 6014600,
        "d": 102275119
      },
      "price": "0.0588080",
      "amount": "0.1722469"
    },
    {
      "price_r": {
        "n": 1250000,
        "d": 21831117
      },
      "price": "0.0572577",
      "amount": "0.2991796"
    }
  ],
  "asks": [
    {
      "price_r": {
        "n": 118163,
        "d": 2000000
      },
      "price": "0.0590815",
      "amount": "8057.2710223"
    },
    {
      "price_r": {
        "n": 60627,
        "d": 1000000
      },
      "price": "0.0606270",
      "amount": "10000.0000000"
    }
  ],
  "base": {
    "asset_type": "native"
  },
  "counter": {
    "asset_type": "credit_alphanum4",
    "asset_code": "USD",
    "asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX"
  }
}

Retrieve an Order Book

The 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 all six of these arguments: base_asset_type, base_asset_issuer, base_asset_code, counter_asset_type, counter_asset_issuer, and counter_asset_code. If the base or counter asset is XLM, you only need to indicate the asset type as native and do not need to designate the code or the issuer.

GET/order_book?selling_asset_type={native,credit_alphanum4,credit_alphanum12}&selling_asset_issuer={:account_id}&selling_asset_code{:asset_code}&buying_asset_type={native,credit_alphanum4,credit_alphanum12}&buying_asset_issuer={:account_id}&buying_asset_code{:asset_code}&limit={1-200}
  • ARGUMENTREQUIRED

    DESCRIPTION

  • selling_asset_typerequired

    The type for the asset being sold (base asset). Either native, credit_alphanum4, or credit_alphanum12.

  • selling_asset_issueroptional

    The Stellar address of the issuer of the asset being sold (base asset). Required if the selling_asset_type is not native.

  • selling_asset_codeoptional

    The code for the asset being sold (base asset). Required if the selling_asset_type is not native.

  • buying_asset_typerequired

    The type for the asset being bought (counter asset). Either native, credit_alphanum4, or credit_alphanum12.

  • buying_asset_issueroptional

    The Stellar address of the issuer of the asset being bought (counter asset). Required if the buying_asset_type is not native.

  • buying_asset_codeoptional

    The code for the asset being bought (counter asset). Required if the buying_asset_type is not native.

  • limitoptional

    The total 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 20 for order books.

Example Request
curl "https://horizon.stellar.org/order_book?selling_asset_type=native&buying_asset_type=credit_alphanum4&buying_asset_code=BB1&buying_asset_issuer=GD5J6HLF5666X4AZLTFTXLY46J5SW7EXRKBLEYPJP33S33MXZGV6CWFN&limit=4"
Example Response
{
  "bids": [
    {
      "price_r": {
        "n": 10000000,
        "d": 139999999
      },
      "price": "0.0714286",
      "amount": "24.9999990"
    },
    {
      "price_r": {
        "n": 1,
        "d": 14
      },
      "price": "0.0714286",
      "amount": "188.0000000"
    },
    {
      "price_r": {
        "n": 1,
        "d": 15
      },
      "price": "0.0666667",
      "amount": "230.3200000"
    },
    {
      "price_r": {
        "n": 1,
        "d": 16
      },
      "price": "0.0625000",
      "amount": "50.0000000"
    }
  ],
  "asks": [
    {
      "price_r": {
        "n": 5000000,
        "d": 62500001
      },
      "price": "0.0800000",
      "amount": "4.9400001"
    },
    {
      "price_r": {
        "n": 10000000,
        "d": 125000001
      },
      "price": "0.0800000",
      "amount": "2516.5154327"
    },
    {
      "price_r": {
        "n": 2,
        "d": 25
      },
      "price": "0.0800000",
      "amount": "3125.0000000"
    },
    {
      "price_r": {
        "n": 4,
        "d": 49
      },
      "price": "0.0816327",
      "amount": "4593.7500000"
    }
  ],
  "base": {
    "asset_type": "native"
  },
  "counter": {
    "asset_type": "credit_alphanum4",
    "asset_code": "BB1",
    "asset_issuer": "GD5J6HLF5666X4AZLTFTXLY46J5SW7EXRKBLEYPJP33S33MXZGV6CWFN"
  }
}
JavaScript Streaming Example
JavaScript
var StellarSdk = require('stellar-sdk')
var server = new StellarSdk.Server('https://horizon.stellar.org')

var callback = function(resp) {
  console.log(resp)
}

var es = server
.orderbook(
  new StellarSdk.Asset.native(),
  new StellarSdk.Asset('BB1', 'GD5J6HLF5666X4AZLTFTXLY46J5SW7EXRKBLEYPJP33S33MXZGV6CWFN'),
)
.cursor('now')
.stream({onmessage: callback})

Paths

Paths provide information about potential path payments. A path can be used to populate the necessary fields for a path payment operation.

Learn more about path payments.


The Path Object

When Horizon returns information about a path, it uses the following format:

  • ATTRIBUTEDATA TYPE

    DESCRIPTION

  • source_asset_typestring

    The type for the source asset. Either native, credit_alphanum4, or credit_alphanum12.

  • source_asset_codestring

    The code for the source asset.

  • source_asset_issuerstring

    The Stellar address of the source asset’s issuer.

  • source_amountstring

    An estimated cost for making a payment of destination_amount on this path. Suitable for use in the sendMax field of a path payment operation.

  • destination_asset_typestring

    The type for the destination asset. Either native, credit_alphanum4, or credit_alphanum12.

  • destination_asset_codestring

    The code for the destination asset.

  • destination_asset_issuerstring

    The Stellar address of the destination asset’s issuer.

  • destination_amountstring

    The destination amount specified in the search that found this path.

  • patharray of objects

    The intermediary assets that this path hops through.

Example
{
  "_embedded": {
    "records": [
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "USD",
        "source_asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX",
        "source_amount": "4.1900246",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "BB1",
        "destination_asset_issuer": "GD5J6HLF5666X4AZLTFTXLY46J5SW7EXRKBLEYPJP33S33MXZGV6CWFN",
        "destination_amount": "5.0000000",
        "path": [
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "NGNT",
            "asset_issuer": "GAWODAROMJ33V5YDFY3NPYTHVYQG7MJXVJ2ND3AOGIHYRWINES6ACCPD"
          },
          {
            "asset_type": "native"
          }
        ]
      },
      {
        "source_asset_type": "native",
        "source_amount": "162.0291692",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "BB1",
        "destination_asset_issuer": "GD5J6HLF5666X4AZLTFTXLY46J5SW7EXRKBLEYPJP33S33MXZGV6CWFN",
        "destination_amount": "5.0000000",
        "path": [
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "EURT",
            "asset_issuer": "GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S"
          }
        ]
      },
      {
        "source_asset_type": "native",
        "source_amount": "162.3284659",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "BB1",
        "destination_asset_issuer": "GD5J6HLF5666X4AZLTFTXLY46J5SW7EXRKBLEYPJP33S33MXZGV6CWFN",
        "destination_amount": "5.0000000",
        "path": [
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "USD",
            "asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX"
          },
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "EURT",
            "asset_issuer": "GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S"
          }
        ]
      },
      {
        "source_asset_type": "native",
        "source_amount": "367.4324508",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "BB1",
        "destination_asset_issuer": "GD5J6HLF5666X4AZLTFTXLY46J5SW7EXRKBLEYPJP33S33MXZGV6CWFN",
        "destination_amount": "5.0000000",
        "path": [
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "BTC",
            "asset_issuer": "GAUTUYY2THLF7SGITDFMXJVYH3LHDSMGEAKSBU267M2K7A3W543CKUEF"
          }
        ]
      }
    ]
  }
}

List Strict Receive Payment Paths

The 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 asset amount stays constant, and the type and amount of an asset sent varies based on offers in the order books.

For this search, Horizon loads a list of assets available to the sender (based on source_account or source_assets) and displays the possible paths from the different source assets to the destination asset. Only paths that satisfy the destination_amount are returned.

GET/paths/strict-receive?source_account={:account_id}&source_assets={:asset_list}&destination_asset_type={native,credit_alphanum4,credit_alphanum12}&destination_asset_code={:asset_code}&destination_asset_issuer={:account_id}&destination_amount={:amount}
  • ARGUMENTREQUIRED

    DESCRIPTION

  • source_accountoptional

    The Stellar address of the sender. Any returned path must start with an asset that the sender holds. Using either source_account or source_assets as an argument is required for strict receive path payments.

  • source_assetsoptional

    A comma-separated list of assets available to the sender. Any returned path must start with an asset in this list. Each asset is formatted as CODE:ISSUER_ACCOUNT. For example: USD:GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX. Using either source_account or source_assets as an argument is required for strict receive path payments.

  • destination_asset_typerequired

    The type for the destination asset. Either native, credit_alphanum4, or credit_alphanum12.

  • destination_asset_issueroptional

    The Stellar address of the issuer of the destination asset. Required if the destination_asset_type is not native.

  • destination_asset_codeoptional

    The code for the destination asset. Required if the destination_asset_type is not native.

  • destination_amountrequired

    The amount of the destination asset that should be received.

Example Request
curl "https://horizon.stellar.org/paths/strict-receive?source_assets=CNY:GAREELUB43IRHWEASCFBLKHURCGMHE5IF6XSE7EXDLACYHGRHM43RFOX&destination_asset_type=credit_alphanum4&destination_asset_code=BB1&destination_asset_issuer=GD5J6HLF5666X4AZLTFTXLY46J5SW7EXRKBLEYPJP33S33MXZGV6CWFN&destination_amount=5"
Example Response
{
  "_embedded": {
    "records": [
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "CNY",
        "source_asset_issuer": "GAREELUB43IRHWEASCFBLKHURCGMHE5IF6XSE7EXDLACYHGRHM43RFOX",
        "source_amount": "28.9871131",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "BB1",
        "destination_asset_issuer": "GD5J6HLF5666X4AZLTFTXLY46J5SW7EXRKBLEYPJP33S33MXZGV6CWFN",
        "destination_amount": "5.0000000",
        "path": [
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "XCN",
            "asset_issuer": "GCNY5OXYSY4FKHOPT2SPOQZAOEIGXB5LBYW3HVU3OWSTQITS65M5RCNY"
          },
          {
            "asset_type": "native"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "CNY",
        "source_asset_issuer": "GAREELUB43IRHWEASCFBLKHURCGMHE5IF6XSE7EXDLACYHGRHM43RFOX",
        "source_amount": "29.0722784",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "BB1",
        "destination_asset_issuer": "GD5J6HLF5666X4AZLTFTXLY46J5SW7EXRKBLEYPJP33S33MXZGV6CWFN",
        "destination_amount": "5.0000000",
        "path": [
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "ULT",
            "asset_issuer": "GC76RMFNNXBFDSJRBXCABWLHXDK4ITVQSMI56DC2ZJVC3YOLLPCKKULT"
          },
          {
            "asset_type": "native"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "CNY",
        "source_asset_issuer": "GAREELUB43IRHWEASCFBLKHURCGMHE5IF6XSE7EXDLACYHGRHM43RFOX",
        "source_amount": "29.4000002",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "BB1",
        "destination_asset_issuer": "GD5J6HLF5666X4AZLTFTXLY46J5SW7EXRKBLEYPJP33S33MXZGV6CWFN",
        "destination_amount": "5.0000000",
        "path": [
          {
            "asset_type": "native"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "CNY",
        "source_asset_issuer": "GAREELUB43IRHWEASCFBLKHURCGMHE5IF6XSE7EXDLACYHGRHM43RFOX",
        "source_amount": "31.8955888",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "BB1",
        "destination_asset_issuer": "GD5J6HLF5666X4AZLTFTXLY46J5SW7EXRKBLEYPJP33S33MXZGV6CWFN",
        "destination_amount": "5.0000000",
        "path": [
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "USD",
            "asset_issuer": "GBUYUAI75XXWDZEKLY66CFYKQPET5JR4EENXZBUZ3YXZ7DS56Z4OKOFU"
          },
          {
            "asset_type": "native"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "CNY",
        "source_asset_issuer": "GAREELUB43IRHWEASCFBLKHURCGMHE5IF6XSE7EXDLACYHGRHM43RFOX",
        "source_amount": "34.7086084",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "BB1",
        "destination_asset_issuer": "GD5J6HLF5666X4AZLTFTXLY46J5SW7EXRKBLEYPJP33S33MXZGV6CWFN",
        "destination_amount": "5.0000000",
        "path": [
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "USD",
            "asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX"
          },
          {
            "asset_type": "native"
          }
        ]
      }
    ]
  }
}
JavaScript Streaming Example
JavaScript
var StellarSdk = require('stellar-sdk')
var server = new StellarSdk.Server('https://horizon.stellar.org')

var callback = function(resp) {
  console.log(resp)
}

var es = server
.strictReceivePaths(
  [
    new StellarSdk.Asset('CNY', 'GAREELUB43IRHWEASCFBLKHURCGMHE5IF6XSE7EXDLACYHGRHM43RFOX')
  ],
  new StellarSdk.Asset('BB1', 'GD5J6HLF5666X4AZLTFTXLY46J5SW7EXRKBLEYPJP33S33MXZGV6CWFN'),
  '5',
)
.cursor('now')
.stream({onmessage: callback})

List Strict Send Payment Paths

The strict receive 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 constant, and the type and amount of an asset received varies based on offers in the order books.

For this search, Horizon loads a list of assets that the recipient can recieve (based on destination_account or destination_assets) and displays the possible paths from the different source assets to the destination asset. Only paths that satisfy the source_amount are returned.

GET/paths/strict-send?source_asset_type={native,credit_alphanum4,credit_alphanum12}&source_asset_code={:asset_code}&source_asset_issuer={:account_id}&source_amount={:amount}&destination_account={:account_id}&destination_assets={:asset_list}
  • ARGUMENTREQUIRED

    DESCRIPTION

  • source_asset_typerequired

    The type for the source asset. Either native, credit_alphanum4, or credit_alphanum12.

  • source_asset_issueroptional

    The Stellar address of the issuer of the source asset. Required if the source_asset_type is not native.

  • source_asset_codeoptional

    The code for the source asset. Required if the source_asset_type is not native.

  • source_amountrequired

    The amount of the source asset that should be sent.

  • destination_accountoptional

    The Stellar address of the reciever. Any returned path must end with an asset that the recipient can receive. Using either source_account or source_assets as an argument is required for strict send path payments.

  • destination_assetsoptional

    A comma-separated list of assets that the recipient can receive. Any returned path must end with an asset in this list. Each asset is formatted as CODE:ISSUER_ACCOUNT. For example: USD:GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX. Using either source_account or source_assets as an argument is required for strict send path payments.

Example Request
curl "https://horizon.stellar.org/paths/strict-send?source_asset_type=credit_alphanum4&source_asset_code=BRL&source_asset_issuer=GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP&source_amount=400&destination_account=GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA"
Example Response
{
  "_embedded": {
    "records": [
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "BB1",
        "destination_asset_issuer": "GD5J6HLF5666X4AZLTFTXLY46J5SW7EXRKBLEYPJP33S33MXZGV6CWFN",
        "destination_amount": "87.6373649",
        "path": [
          {
            "asset_type": "native"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "BB1",
        "destination_asset_issuer": "GD5J6HLF5666X4AZLTFTXLY46J5SW7EXRKBLEYPJP33S33MXZGV6CWFN",
        "destination_amount": "36.0841597",
        "path": [
          {
            "asset_type": "native"
          },
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "EURT",
            "asset_issuer": "GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "BB1",
        "destination_asset_issuer": "GD5J6HLF5666X4AZLTFTXLY46J5SW7EXRKBLEYPJP33S33MXZGV6CWFN",
        "destination_amount": "16.2264000",
        "path": [
          {
            "asset_type": "native"
          },
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "BTC",
            "asset_issuer": "GBVOL67TMUQBGL4TZYNMY3ZQ5WGQYFPFD5VJRWXR72VA33VFNL225PL5"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "BB1",
        "destination_asset_issuer": "GD5J6HLF5666X4AZLTFTXLY46J5SW7EXRKBLEYPJP33S33MXZGV6CWFN",
        "destination_amount": "13.9424750",
        "path": [
          {
            "asset_type": "native"
          },
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "USD",
            "asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "CNY",
        "destination_asset_issuer": "GAREELUB43IRHWEASCFBLKHURCGMHE5IF6XSE7EXDLACYHGRHM43RFOX",
        "destination_amount": "499.8384123",
        "path": [
          {
            "asset_type": "native"
          },
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "ULT",
            "asset_issuer": "GC76RMFNNXBFDSJRBXCABWLHXDK4ITVQSMI56DC2ZJVC3YOLLPCKKULT"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "CNY",
        "destination_asset_issuer": "GAREELUB43IRHWEASCFBLKHURCGMHE5IF6XSE7EXDLACYHGRHM43RFOX",
        "destination_amount": "498.1069097",
        "path": [
          {
            "asset_type": "native"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "CNY",
        "destination_asset_issuer": "GAREELUB43IRHWEASCFBLKHURCGMHE5IF6XSE7EXDLACYHGRHM43RFOX",
        "destination_amount": "494.5886542",
        "path": [
          {
            "asset_type": "native"
          },
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "XCN",
            "asset_issuer": "GCNY5OXYSY4FKHOPT2SPOQZAOEIGXB5LBYW3HVU3OWSTQITS65M5RCNY"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "CNY",
        "destination_asset_issuer": "GAREELUB43IRHWEASCFBLKHURCGMHE5IF6XSE7EXDLACYHGRHM43RFOX",
        "destination_amount": "490.0780598",
        "path": [
          {
            "asset_type": "native"
          },
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "USD",
            "asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "CNY",
        "destination_asset_issuer": "GAREELUB43IRHWEASCFBLKHURCGMHE5IF6XSE7EXDLACYHGRHM43RFOX",
        "destination_amount": "280.2909824",
        "path": [
          {
            "asset_type": "native"
          },
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "USD",
            "asset_issuer": "GBUYUAI75XXWDZEKLY66CFYKQPET5JR4EENXZBUZ3YXZ7DS56Z4OKOFU"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "EURT",
        "destination_asset_issuer": "GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S",
        "destination_amount": "63.1883029",
        "path": [
          {
            "asset_type": "native"
          },
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "USD",
            "asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "EURT",
        "destination_asset_issuer": "GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S",
        "destination_amount": "63.1472796",
        "path": [
          {
            "asset_type": "native"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "EURT",
        "destination_asset_issuer": "GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S",
        "destination_amount": "62.9386895",
        "path": [
          {
            "asset_type": "native"
          },
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "NGNT",
            "asset_issuer": "GAWODAROMJ33V5YDFY3NPYTHVYQG7MJXVJ2ND3AOGIHYRWINES6ACCPD"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "EURT",
        "destination_asset_issuer": "GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S",
        "destination_amount": "6.7649849",
        "path": [
          {
            "asset_type": "native"
          },
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "WSD",
            "asset_issuer": "GDSVWEA7XV6M5XNLODVTPCGMAJTNBLZBXOFNQD3BNPNYALEYBNT6CE2V"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "EURT",
        "destination_asset_issuer": "GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S",
        "destination_amount": "0.0498106",
        "path": [
          {
            "asset_type": "native"
          },
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "CNY",
            "asset_issuer": "GAREELUB43IRHWEASCFBLKHURCGMHE5IF6XSE7EXDLACYHGRHM43RFOX"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "NGNT",
        "destination_asset_issuer": "GAWODAROMJ33V5YDFY3NPYTHVYQG7MJXVJ2ND3AOGIHYRWINES6ACCPD",
        "destination_amount": "25155.3452034",
        "path": [
          {
            "asset_type": "native"
          },
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "USD",
            "asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "NGNT",
        "destination_asset_issuer": "GAWODAROMJ33V5YDFY3NPYTHVYQG7MJXVJ2ND3AOGIHYRWINES6ACCPD",
        "destination_amount": "25146.7108397",
        "path": [
          {
            "asset_type": "native"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "NGNT",
        "destination_asset_issuer": "GAWODAROMJ33V5YDFY3NPYTHVYQG7MJXVJ2ND3AOGIHYRWINES6ACCPD",
        "destination_amount": "24986.8616583",
        "path": [
          {
            "asset_type": "native"
          },
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "BTC",
            "asset_issuer": "GAUTUYY2THLF7SGITDFMXJVYH3LHDSMGEAKSBU267M2K7A3W543CKUEF"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "NGNT",
        "destination_asset_issuer": "GAWODAROMJ33V5YDFY3NPYTHVYQG7MJXVJ2ND3AOGIHYRWINES6ACCPD",
        "destination_amount": "24948.9784843",
        "path": [
          {
            "asset_type": "native"
          },
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "XCN",
            "asset_issuer": "GCNY5OXYSY4FKHOPT2SPOQZAOEIGXB5LBYW3HVU3OWSTQITS65M5RCNY"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "NGNT",
        "destination_asset_issuer": "GAWODAROMJ33V5YDFY3NPYTHVYQG7MJXVJ2ND3AOGIHYRWINES6ACCPD",
        "destination_amount": "24930.7854717",
        "path": [
          {
            "asset_type": "native"
          },
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "EURT",
            "asset_issuer": "GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "USD",
        "destination_asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX",
        "destination_amount": "69.7123752",
        "path": [
          {
            "asset_type": "native"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "USD",
        "destination_asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX",
        "destination_amount": "68.9785993",
        "path": [
          {
            "asset_type": "native"
          },
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "EURT",
            "asset_issuer": "GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "USD",
        "destination_asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX",
        "destination_amount": "68.6731854",
        "path": [
          {
            "asset_type": "native"
          },
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "NGNT",
            "asset_issuer": "GAWODAROMJ33V5YDFY3NPYTHVYQG7MJXVJ2ND3AOGIHYRWINES6ACCPD"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "USD",
        "destination_asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX",
        "destination_amount": "63.5394120",
        "path": [
          {
            "asset_type": "native"
          },
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "USD",
            "asset_issuer": "GBUYUAI75XXWDZEKLY66CFYKQPET5JR4EENXZBUZ3YXZ7DS56Z4OKOFU"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "USD",
        "destination_asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX",
        "destination_amount": "39.6691360",
        "path": [
          {
            "asset_type": "native"
          },
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "HEX",
            "asset_issuer": "GCGBSZ3DSSH6PRHCOD4JXFNNZXCTKBDFRT4JR2HIAC6FQZU4YK7GPHEX"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "native",
        "destination_amount": "1226.9231099",
        "path": []
      }
    ]
  }
}
JavaScript Streaming Example
JavaScript
var StellarSdk = require('stellar-sdk')
var server = new StellarSdk.Server('https://horizon.stellar.org')

var callback = function(resp) {
  console.log(resp)
}

var es = server
.strictSendPaths(
  new StellarSdk.Asset('BRL', 'GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP'),
  '400',
  'GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA',
)
.cursor('now')
.stream({onmessage: callback})

Trade Aggregations

A trade aggregation represents aggregated statistics on an asset pair (base and counter) for a specific time period. Trade aggregations are useful to developers of trading clients and provide historical trade data.


The Trade Aggregation Object

When Horizon returns information about a trade aggregation, it uses the following format:

  • ATTRIBUTEDATA TYPE

    DESCRIPTION

  • timestampestring

    Start time for this trade aggregation. Represented as milliseconds since epoch.

  • trade_countinteger

    Total number of trades aggregated.

  • base_volumestring

    Total volume of base asset.

  • counter_volumestring

    Total volume of counter asset.

  • avgstring

    Weighted average price of counter asset in terms of base asset.

  • highstring

    The highest price for this time period.

  • high_robject

    The highest price for this time period as a rational number.

  • lowstring

    The lowest price for this time period.

  • low_robject

    The lowest price for this time period as a rational number.

  • openstring

    The price as seen on first trade aggregated.

  • open_robject

    The price as seen on first trade aggregated as a rational number.

  • closestring

    The price as seen on last trade aggregated.

  • close_robject

    The price as seen on last trade aggregated as a rational number.

Example
{
  "_links": {
    "self": {
      "href": "https://horizon.stellar.org/trade_aggregations?base_asset_type=native\u0026counter_asset_code=NGNT\u0026counter_asset_issuer=GAWODAROMJ33V5YDFY3NPYTHVYQG7MJXVJ2ND3AOGIHYRWINES6ACCPD\u0026counter_asset_type=credit_alphanum4\u0026limit=200\u0026order=asc\u0026resolution=3600000\u0026start_time=1582156800000\u0026end_time=1582178400000"
    },
    "next": {
      "href": "https://horizon.stellar.org/trade_aggregations?base_asset_type=native\u0026counter_asset_code=NGNT\u0026counter_asset_issuer=GAWODAROMJ33V5YDFY3NPYTHVYQG7MJXVJ2ND3AOGIHYRWINES6ACCPD\u0026counter_asset_type=credit_alphanum4\u0026end_time=1582178400000\u0026limit=200\u0026order=asc\u0026resolution=3600000\u0026start_time=1582178400000"
    },
    "prev": {
      "href": ""
    }
  },
  "_embedded": {
    "records": [
      {
        "timestamp": 1582156800000,
        "trade_count": 9,
        "base_volume": "3487.4699458",
        "counter_volume": "88675.3982178",
        "avg": "25.4268566",
        "high": "25.7603393",
        "high_r": {
          "N": 257603393,
          "D": 10000000
        },
        "low": "25.3804530",
        "low_r": {
          "N": 25380453,
          "D": 1000000
        },
        "open": "25.3990186",
        "open_r": {
          "N": 2500000,
          "D": 98429
        },
        "close": "25.7090558",
        "close_r": {
          "N": 1250000,
          "D": 48621
        }
      },
      {
        "timestamp": 1582160400000,
        "trade_count": 1,
        "base_volume": "0.1058787",
        "counter_volume": "2.7155348",
        "avg": "25.6476024",
        "high": "25.6476019",
        "high_r": {
          "N": 100000,
          "D": 3899
        },
        "low": "25.6476019",
        "low_r": {
          "N": 100000,
          "D": 3899
        },
        "open": "25.6476019",
        "open_r": {
          "N": 100000,
          "D": 3899
        },
        "close": "25.6476019",
        "close_r": {
          "N": 100000,
          "D": 3899
        }
      },
      {
        "timestamp": 1582164000000,
        "trade_count": 15,
        "base_volume": "3992.1321821",
        "counter_volume": "99702.0620798",
        "avg": "24.9746395",
        "high": "25.6764460",
        "high_r": {
          "N": 5000000,
          "D": 194731
        },
        "low": "24.9291379",
        "low_r": {
          "N": 249291379,
          "D": 10000000
        },
        "open": "25.6764460",
        "open_r": {
          "N": 5000000,
          "D": 194731
        },
        "close": "25.0055050",
        "close_r": {
          "N": 5001101,
          "D": 200000
        }
      },
      {
        "timestamp": 1582167600000,
        "trade_count": 4,
        "base_volume": "278.4950271",
        "counter_volume": "7047.6740325",
        "avg": "25.3062832",
        "high": "25.3844475",
        "high_r": {
          "N": 5000000,
          "D": 196971
        },
        "low": "25.2923181",
        "low_r": {
          "N": 252923181,
          "D": 10000000
        },
        "open": "25.2923181",
        "open_r": {
          "N": 252923181,
          "D": 10000000
        },
        "close": "25.3844475",
        "close_r": {
          "N": 5000000,
          "D": 196971
        }
      },
      {
        "timestamp": 1582174800000,
        "trade_count": 1,
        "base_volume": "9.9379734",
        "counter_volume": "252.7685174",
        "avg": "25.4346140",
        "high": "25.4346140",
        "high_r": {
          "N": 254346140,
          "D": 10000000
        },
        "low": "25.4346140",
        "low_r": {
          "N": 254346140,
          "D": 10000000
        },
        "open": "25.4346140",
        "open_r": {
          "N": 254346140,
          "D": 10000000
        },
        "close": "25.4346140",
        "close_r": {
          "N": 254346140,
          "D": 10000000
        }
      }
    ]
  }
}

List Trade Aggregations

This 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, for a given asset pair (base, counter) over each of these segments.

The duration of the segments is specified with the resolution parameter. The start and end of the time range are given by startTime and endTime respectively, which are both rounded to the nearest multiple of resolution since epoch.

The individual segments are also aligned with multiples of resolution since epoch. If you want to change this alignment, the segments can be offset by specifying the offset parameter.

GET/trade_aggregations?start_time={:start_time}&end_time={:end_time}&resolution={:resolution}&offset={:offset}&base_asset_type={native,credit_alphanum4,credit_alphanum12}&base_asset_issuer={:account_id}&base_asset_code{:asset_code}&counter_asset_type={native,credit_alphanum4,credit_alphanum12}&counter_asset_issuer={:account_id}&counter_asset_code{:asset_code}&order={asc,desc}&limit={1-200}
  • ARGUMENTREQUIRED

    DESCRIPTION

  • start_timelong

    The lower time boundary represented as milliseconds since epoch.

  • end_timelong

    The upper time boundary represented as milliseconds since epoch.

  • resolutionlong

    The segment duration represented as milliseconds. Supported values are 1 minute (60000), 5 minutes (300000), 15 minutes (900000), 1 hour (3600000), 1 day (86400000) and 1 week (604800000).

  • offsetlong

    Segments can be offset using this parameter. Expressed in milliseconds. Can only be used if the resolution is greater than 1 hour. Value must be in whole hours, less than the provided resolution, and less than 24 hours.

  • base_asset_typerequired

    The type for the base asset. Either native, credit_alphanum4, or credit_alphanum12.

  • base_asset_issueroptional

    The Stellar address of the base asset’s issuer. Required if the base_asset_type is not native.

  • base_asset_codeoptional

    The code for the base asset. Required if the base_asset_type is not native.

  • counter_asset_typerequired

    The type for the counter asset. Either native, credit_alphanum4, or credit_alphanum12.

  • counter_asset_issueroptional

    The Stellar address of the counter asset’s issuer. Required if the counter_asset_type is not native.

  • counter_asset_codeoptional

    The code for the counter asset. Required if the counter_asset_type is not native.

  • orderoptional

    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.

  • limitoptional

    The total 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.

Example Request
curl "https://horizon.stellar.org/trade_aggregations?base_asset_type=native&counter_asset_code=EURT&counter_asset_issuer=GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S&counter_asset_type=credit_alphanum4&resolution=3600000&start_time=1582156800000&end_time=1582178400000"
Example Response
{
  "_links": {
    "self": {
      "href": "https://horizon.stellar.org/trade_aggregations?base_asset_type=native\u0026counter_asset_code=EURT\u0026counter_asset_issuer=GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S\u0026counter_asset_type=credit_alphanum4\u0026resolution=3600000\u0026start_time=1582156800000\u0026end_time=1582178400001"
    },
    "next": {
      "href": "https://horizon.stellar.org/trade_aggregations?base_asset_type=native\u0026counter_asset_code=EURT\u0026counter_asset_issuer=GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S\u0026counter_asset_type=credit_alphanum4\u0026end_time=1582178400001\u0026resolution=3600000\u0026start_time=1582171200000"
    },
    "prev": {
      "href": ""
    }
  },
  "_embedded": {
    "records": [
      {
        "timestamp": 1582164000000,
        "trade_count": 3,
        "base_volume": "399.3873200",
        "counter_volume": "25.5368082",
        "avg": "0.0639400",
        "high": "0.0652169",
        "high_r": {
          "N": 652169,
          "D": 10000000
        },
        "low": "0.0638338",
        "low_r": {
          "N": 8107550,
          "D": 127010393
        },
        "open": "0.0652169",
        "open_r": {
          "N": 652169,
          "D": 10000000
        },
        "close": "0.0638338",
        "close_r": {
          "N": 8107550,
          "D": 127010393
        }
      },
      {
        "timestamp": 1582167600000,
        "trade_count": 1,
        "base_volume": "149.8415320",
        "counter_volume": "9.7149804",
        "avg": "0.0648350",
        "high": "0.0648350",
        "high_r": {
          "N": 5000000,
          "D": 77118803
        },
        "low": "0.0648350",
        "low_r": {
          "N": 5000000,
          "D": 77118803
        },
        "open": "0.0648350",
        "open_r": {
          "N": 5000000,
          "D": 77118803
        },
        "close": "0.0648350",
        "close_r": {
          "N": 5000000,
          "D": 77118803
        }
      }
    ]
  }
}
JavaScript Streaming Example
JavaScript
var StellarSdk = require('stellar-sdk')
var server = new StellarSdk.Server('https://horizon.stellar.org')

var callback = function(resp) {
  console.log(resp)
}

var base = new StellarSdk.Asset.native()
var counter = new StellarSdk.Asset("EURT", "GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S")
var startTime = 1582156800000
var endTime = 1582178400000
var resolution = 3600000
var offset = 0

var es = server
.tradeAggregation(
  base,
  counter,
  startTime,
  endTime,
  resolution,
  offset,
)
.cursor('now')
.stream({onmessage: callback})

Fee Stats

Fee stats are used to predict what fee to set for a transaction before submitting it to the network.

Endpoints

The Fee Stats Object

When Horizon returns fee stats, it uses the format below.

Note: The fee_charged represents the actual fee paid for the transaction, while max_fee represents the maximum bid the transaction creator was willing to pay for the transaction.

  • ATTRIBUTEDATA TYPE

    DESCRIPTION

  • last_ledgerstring

    The last ledger’s sequence number.

  • last_ledger_base_feestring

    The base fee as defined in the last ledger.

  • ledger_capacity_usagestring

    The average capacity usage over the last 5 ledgers (0 is no usage, 1.0 is completely full ledgers).

  • fee_chargedobject

    Information about the fee charged for transactions in the last 5 ledgers.

  • max_feeobject

    Information about max fee bid for transactions over the last 5 ledgers.

Example
{
  "last_ledger": "28444678",
  "last_ledger_base_fee": "100",
  "ledger_capacity_usage": "0.2",
  "min_accepted_fee": "100",
  "mode_accepted_fee": "100",
  "p10_accepted_fee": "100",
  "p20_accepted_fee": "100",
  "p30_accepted_fee": "100",
  "p40_accepted_fee": "100",
  "p50_accepted_fee": "100",
  "p60_accepted_fee": "100",
  "p70_accepted_fee": "100",
  "p80_accepted_fee": "100",
  "p90_accepted_fee": "100",
  "p95_accepted_fee": "100",
  "p99_accepted_fee": "10000",
  "fee_charged": {
    "max": "100",
    "min": "100",
    "mode": "100",
    "p10": "100",
    "p20": "100",
    "p30": "100",
    "p40": "100",
    "p50": "100",
    "p60": "100",
    "p70": "100",
    "p80": "100",
    "p90": "100",
    "p95": "100",
    "p99": "100"
  },
  "max_fee": {
    "max": "16000",
    "min": "100",
    "mode": "100",
    "p10": "100",
    "p20": "100",
    "p30": "100",
    "p40": "100",
    "p50": "100",
    "p60": "100",
    "p70": "100",
    "p80": "100",
    "p90": "100",
    "p95": "100",
    "p99": "10000"
  }
}

Retrieve Fee Stats

The fee stats endpoint provides information about per-operation fee stats over the last 5 ledgers.

GET/fee_stats
Example Request
curl "https://horizon.stellar.org/fee_stats"
Example Response
{
  "last_ledger": "28444696",
  "last_ledger_base_fee": "100",
  "ledger_capacity_usage": "0.19",
  "min_accepted_fee": "100",
  "mode_accepted_fee": "100",
  "p10_accepted_fee": "100",
  "p20_accepted_fee": "100",
  "p30_accepted_fee": "100",
  "p40_accepted_fee": "100",
  "p50_accepted_fee": "100",
  "p60_accepted_fee": "100",
  "p70_accepted_fee": "100",
  "p80_accepted_fee": "100",
  "p90_accepted_fee": "100",
  "p95_accepted_fee": "100",
  "p99_accepted_fee": "120",
  "fee_charged": {
    "max": "100",
    "min": "100",
    "mode": "100",
    "p10": "100",
    "p20": "100",
    "p30": "100",
    "p40": "100",
    "p50": "100",
    "p60": "100",
    "p70": "100",
    "p80": "100",
    "p90": "100",
    "p95": "100",
    "p99": "100"
  },
  "max_fee": {
    "max": "16000",
    "min": "100",
    "mode": "100",
    "p10": "100",
    "p20": "100",
    "p30": "100",
    "p40": "100",
    "p50": "100",
    "p60": "100",
    "p70": "100",
    "p80": "100",
    "p90": "100",
    "p95": "100",
    "p99": "120"
  }
}

Errors

After processing a request, Horizon returns a success or error response to the client. A success response will return a Status Code of 200, and an error response will return a Status Code in the range of 4XX - 5XX along with additional information about why the request could not complete successfully.

There are two categories of errors: HTTP Status Codes and Result Codes. Result Codes only follow a Transaction Failed (400) HTTP Status Code.

Error Categories
HTTP Status CodesErrors that occur at the Horizon Server level.
Result CodesErrors that occur at the Stellar Core level.

Error Response

When any error occurs, Horizon responds with a JSON document with the below attributes.

  • ATTRIBUTEDATA TYPE

    DESCRIPTION

  • typeURL

    The type of Status Code returned.

  • titlestring

    A short title describing the Status Code, which can be used to look up more information about a error.

  • statusnumber

    A short title describing the Status Code, which can be used to look up more information about a error.

  • detailstring

    A short title describing the Status Code, which can be used to look up more information about a error.

  • extrasarray

    If the Status Code is Transaction Failed, this extras field displays the Result Code returned by Stellar Core describing why the transaction failed.

Example
{
  "type": "https://stellar.org/horizon-errors/transaction_failed",
  "title": "Transaction Failed",
  "status": 400,
  "detail": "The transaction failed when submitted to the stellar network. The `extras.result_codes` field on this response contains further details.  Descriptions of each code can be found at: https://www.stellar.org/developers/learn/concepts/list-of-operations.html",
  "extras": {
    "envelope_xdr": "AAAAANPRjCD1iCti3hovsrrz6aSAjmp263grVr6+mI3SQSkcAAAAZAAPRLgAAAADAAAAAAAAAAAAAAABAAAAAQAAAACuSL9OciKkFztj4d3zuadl20HHObu+7qJenBxHPrMayQAAAAUAAAABAAAAANPRjCD1iCti3hovsrrz6aSAjmp263grVr6+mI3SQSkcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAtJBKRwAAABA1N0iqDAgqS6+3RIZGoNB9OXrY3wd/nLruXYi+eiTt4jn94fLVLwAw6jJCaK+qxStwO7c4kP6u5k0RPbuYC55CT6zGskAAABAiUGCNCS4pGlfcRmi82kbralzcFlTQAFzLyfUrYGn3RtQ4p/7TUwAqIanVoWGfEqzIJo64ZT+mYtJ72BfI+FiDg==",
    "result_codes": {
      "transaction": "tx_failed",
      "operations": ["op_no_source_account"]
    },
    "result_xdr": "AAAAAAAAAGT/////AAAAAf////4AAAAA"
  }
}

HTTP Status Codes

Some errors only occur at the Horizon level and are not thrown in Stellar Core. These are usually issues with how the transaction was formed or a conflict between the transaction’s composition and how the Horizon server is setup.

Stellar uses conventional HTTP response codes to indicate the success or failure of an API request. In general:

  • Codes in the 2xx range indicate success.
  • Codes in the 4xx range indicate an error that failed given the information provided
  • Codes in the 5xx range indicate an error with the Horizon server.

There are two types of Status Codes: Standard Status Codes and Horizon-Specific Status Codes.

HTTP Status Code Types
Standard Status CodesGeneric HTTP responses.
Horizon-Specific Status CodesErrors that are unique to Horizon.

Standard Status Codes

These responses are Internet protocol codes that describe basic issues with a submitted transaction.

  • STATUS CODEVALUE

    DESCRIPTION

  • OK200

    The request has succeeded.

  • Bad Request400

    The request as invalid in some way.

  • Not Found404

    The requested resource does not exist.

  • Not Implemented404

    The request does not have an acceptable response content-type.

  • Not Acceptable406

    The request does not have an acceptable response content-type.

  • Internal Server Error500

    Something went wrong on the Horizon server’s end.

Example Response for a “Bad Request” Status Code
{
  "type": "https://stellar.org/horizon-errors/bad_request",
  "title": "Bad Request",
  "status": 400,
  "detail": "The request you sent was invalid in some way",
  "extras": {
    "invalid_field": "limit",
    "reason": "unparseable value"
  }
}

Horizon-Specific Status Codes

These responses are specific to how a Horizon server is set up and how transactions should be formed.

  • STATUS CODEVALUE

    DESCRIPTION

  • Transaction Failed400

    The transaction_failed error occurs when a client submits a transaction that was well-formed but was not included in the ledger due to some other failure. For example, a transaction may fail if: 1) the source account for transaction cannot pay the minimum fee, 2) the sequence number is incorrect, or 3) one of the contained operations has failed such as a payment operation that overdraws on the paying account. In almost every case, this error indicates that the transaction submitted in the initial request will never succeed. There is one exception: a transaction that fails with the tx_bad_seq result code (as expressed in the result_code field of the error) may become valid in the future if the sequence number it used was too high.

  • Transaction Malformed400

    When you submit a malformed transaction to Horizon, Horizon will return a transaction_malformed error. There are many ways in which a transaction could be malformed, including: 1) you submitted an empty string, 2) your base64-encoded string is invalid, 3) your XDR structure is invalid, or 4) you have leftover bytes in your XDR structure.

  • Before History404

    A horizon server may be configured to only keep a portion of the stellar network’s history stored within its database. This error will be returned when a client requests a piece of information (such as a page of transactions or a single operation) that the server can positively identify as falling outside the range of recorded history.

  • Stale History404

    A horizon server may be configured to reject historical requests when the history is known to be further out of date than the configured threshold. In such cases, this error is returned. To resolve this error (provided you are the horizon instance’s operator) please ensure that the ingestion system is running correctly and importing new ledgers.

  • Timeout406

    If you are encountering this error it means that either: 1) Horizon has not received a confirmation from the Stellar Core server that the transaction you are trying to submit to the network was included in a ledger in a timely manner, or 2) Horizon has not sent a response to a reverse-proxy before a specified amount of time has elapsed. The former case may happen because there was no room for your transaction for 3 consecutive ledgers. This is because Stellar Core removes each submitted transaction from a queue. To solve this you can: 1) keep resubmitting the same transaction (with the same sequence number) and wait until it finally is added to a new ledger, or 2) increase the fee in order to prioritize the transaction.

Example Response for a 'Transaction Malformed' Status Code
{
  "type": "https://stellar.org/horizon-errors/transaction_malformed",
  "title": "Transaction Malformed",
  "status": 400,
  "detail": "Horizon could not decode the transaction envelope in this request. A transaction should be an XDR TransactionEnvelope struct encoded using base64.  The envelope read from this request is echoed in the `extras.envelope_xdr` field of this response for your convenience.",
  "extras": {
    "envelope_xdr": "BBBBBPORy3CoX6ox2ilbeiVjBA5WlpCSZRcjZ7VE9Wf4QVk7AAAAZAAAQz0AAAACAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAA85HLcKhfqjHaKVt6JWMEDlaWkJJlFyNntUT1Z/hBWTsAAAAAAAAAAAL68IAAAAAAAAAAARN17BEAAABAA9Ad7OKc7y60NT/JuobaHOfmuq8KbZqcV6G/es94u9yT84fi0aI7tJsFMOyy8cZ4meY3Nn908OU+KfRWV40UCw=="
  }
}

Result Codes

Result Codes describe why a transaction or operation failed in Stellar Core and are communicated in the “extras” field of a Horizon response when the “Transaction Failed” Status Code is returned.

In the “extras” field, the errors returned are referred to as “Result Codes” and are Horizon’s abstraction of “Stellar Protocol Codes”, which are more specific codes available in the XDR. Result Codes are Horizon’s way of normalizing Stellar Protocol Codes.

There are three types of Result Codes: Transaction Result Codes, Operation Result Codes, and Operation-Specific Result Codes.

Result Code Types
Transaction Result CodesGeneric errors about transaction failures.
Operation Result CodesGeneric errors about operation failures.
Operation-Specific Result CodesErrors specific to each operation type.

Transaction Result Codes

These are Result Codes that communicate success (200) or failure (400) at the transaction level: bad sequence numbers, insufficient balances, insufficient fees, etc.

  • RESULT CODESTELLAR PROTOCOL CODE

    DESCRIPTION

  • tx_successtxSUCCESS

    The transaction succeeded.

  • tx_failedtxFAILED

    One of the operations failed (none were applied).

  • tx_too_earlytxTOO_EARLY

    The ledger closeTime was before the minTime.

  • tx_too_latetxTOO_LATE

    The ledger closeTime was after the maxTime.

Example Response for a 'tx_bad_seq' Result Code
{
  "type": "https://stellar.org/horizon-errors/transaction_failed",
  "title": "Transaction Failed",
  "status": 400,
  "detail": "The transaction failed when submitted to the stellar network. The `extras.result_codes` field on this response contains further details.  Descriptions of each code can be found at: https://www.stellar.org/developers/learn/concepts/list-of-operations.html",
  "extras": {
    "envelope_xdr": "AAAAANPRjCD1iCti3hovsrrz6aSAjmp263grVr6+mI3SQSkcAAAAZAAPRLgAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAArki/TnIipBc7Y+Hd87mnZdtBxzm7vu6iXpwcRz6zGskAAAAAAAAAAAAHoSAAAAAAAAAAAdJBKRwAAABANWeKuRYFmBm1lrMQqMvhbSouwL270SnxcTtv1XI4Y+uVe4yw4Jq7/43EoxwLbRh/pC3V4WfOZRzDqwsTyEztAA==",
    "result_codes": {
      "transaction": "tx_bad_seq"
    },
    "result_xdr": "AAAAAAAAAAD////7AAAAAA=="
  }
}

Operation-Specific Result Codes

These are Result Codes that communicate success (200) or failure (400) responses that are specific to each operation type.

Each of Stellar’s operations have unique causes of failure, and these result codes will help you diagnose and address the origins of issues.


Create Account Result Codes

These are result codes that communicate success (200) or failure (400) specific to the Create Account operation, which often fails because the new account does not meet the minimum reserve.

Learn more about the Create Account operation.

  • RESULT CODESTELLAR PROTOCOL CODE

    DESCRIPTION

  • OpSuccessCREATE_ACCOUNT_SUCCESS

    The inner object result is valid and the operation was a success.

  • OpMalformedCREATE_ACCOUNT_MALFORMED

    There are too few valid signatures, or the transaction was submitted to the wrong network.

  • OpUnderfundedCREATE_ACCOUNT_UNDERFUNDED

    The source account was not found.

  • OpLowReserveCREATE_ACCOUNT_LOW_RESERVE

    The operation is not supported at this time.

Example Response for an “op_low_reserve” Result Code
{
  "type": "https://stellar.org/horizon-errors/transaction_failed",
  "title": "Transaction Failed",
  "status": 400,
  "detail": "The transaction failed when submitted to the stellar network. The `extras.result_codes` field on this response contains further details.  Descriptions of each code can be found at: https://www.stellar.org/developers/learn/concepts/list-of-operations.html",
  "extras": {
    "envelope_xdr": "AAAAANPRjCD1iCti3hovsrrz6aSAjmp263grVr6+mI3SQSkcAAAAyAAPRLgAAAABAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAArki/TnIipBc7Y+Hd87mnZdtBxzm7vu6iXpwcRz6zGskAAAAAATEtAAAAAAAAAAAAAAAAAIGSJ37hgqXXrIqnus4A7142mjj3+9Vlg3alUICjxuBUAAAAAAAAdTAAAAAAAAAAAdJBKRwAAABAou657z1OKvjF8d2QSKKGJEQZUeHvqK+Vdciz478h5KAr/M7fUxxafUqZFkBgx8WcxrsiMZ03ygloZi3NaQm3Cg==",
    "result_codes": {
      "transaction": "tx_failed",
      "operations": ["op_success", "op_low_reserve"]
    },
    "result_xdr": "AAAAAAAAAMj/////AAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAA/////QAAAAA="
  }
}

Payment Result Codes

These are result codes that communicate success (200) or failure (400) specific to the Payment operation, which often fails because the receiving account does not trust the issuer of the asset being sent.

Learn more about the Payment operation.

  • RESULT CODESTELLAR PROTOCOL CODE

    DESCRIPTION

  • OpSuccessPAYMENT_SUCCESS

    The account was created.

  • OpMalformedPAYMENT_MALFORMED

    The destination was invalid.

  • OpUnderfundedPAYMENT_UNDERFUNDED

    There were not enough funds in the source account.

  • OpLowReservePAYMENT_LOW_RESERVE

    The source account did not have the necessary trustline.

Example Response for an “op_underfunded” Result Code
{
  "type": "https://stellar.org/horizon-errors/transaction_failed",
  "title": "Transaction Failed",
  "status": 400,
  "detail": "The transaction failed when submitted to the stellar network. The `extras.result_codes` field on this response contains further details.  Descriptions of each code can be found at: https://www.stellar.org/developers/learn/concepts/list-of-operations.html",
  "extras": {
    "envelope_xdr": "AAAAANPRjCD1iCti3hovsrrz6aSAjmp263grVr6+mI3SQSkcAAAAZAAPRLgAAAACAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAArki/TnIipBc7Y+Hd87mnZdtBxzm7vu6iXpwcRz6zGskAAAB0alKIAAAAAAAAAAAB0kEpHAAAAECoD+aG3RAfxFEW2b5VcARoxVc+ovimyQOQzQbLc7Y613j/x2H92aGwQzfPWjZyWBqQpoEjooAKmyAFANP74UAC",
    "result_codes": {
      "transaction": "tx_failed",
      "operations": ["op_underfunded"]
    },
    "result_xdr": "AAAAAAAAAGT/////AAAAAQAAAAAAAAAA/////gAAAAA="
  }
}

Operation Result Codes

These are Result Codes that communicate success (200) or failure (400) at the operation level: no source account, too many subentries, etc.

  • RESULT CODESTELLAR PROTOCOL CODE

    DESCRIPTION

  • op_inneropINNER

    The inner object result is valid and the operation was a success.

  • op_bad_authopBAD_AUTH

    There are too few valid signatures, or the transaction was submitted to the wrong network.

  • op_no_source_accountopNO_ACCOUNT

    The source account was not found.

  • op_not_supportedopNOT_SUPPORTED

    The operation is not supported at this time.

Example Response for an 'op_no_source_account' Result Code
{
  "type": "https://stellar.org/horizon-errors/transaction_failed",
  "title": "Transaction Failed",
  "status": 400,
  "detail": "The transaction failed when submitted to the stellar network. The `extras.result_codes` field on this response contains further details.  Descriptions of each code can be found at: https://www.stellar.org/developers/learn/concepts/list-of-operations.html",
  "extras": {
    "envelope_xdr": "AAAAANPRjCD1iCti3hovsrrz6aSAjmp263grVr6+mI3SQSkcAAAAZAAPRLgAAAADAAAAAAAAAAAAAAABAAAAAQAAAACuSL9OciKkFztj4d3zuadl20HHObu+7qJenBxHPrMayQAAAAUAAAABAAAAANPRjCD1iCti3hovsrrz6aSAjmp263grVr6+mI3SQSkcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAtJBKRwAAABA1N0iqDAgqS6+3RIZGoNB9OXrY3wd/nLruXYi+eiTt4jn94fLVLwAw6jJCaK+qxStwO7c4kP6u5k0RPbuYC55CT6zGskAAABAiUGCNCS4pGlfcRmi82kbralzcFlTQAFzLyfUrYGn3RtQ4p/7TUwAqIanVoWGfEqzIJo64ZT+mYtJ72BfI+FiDg==",
    "result_codes": {
      "transaction": "tx_failed",
      "operations": ["op_no_source_account"]
    },
    "result_xdr": "AAAAAAAAAGT/////AAAAAf////4AAAAA"
  }
}