How To Access Stellar API

Learn how to access Stellar API.

Step 1: To access the available Stellar methods, use the following native access endpoint:

  • Network: Stellar Mainnet
  • Request Type: GET / POST
https://svc.blockdaemon.com/stellar/mainnet/native

Step 2: You should authorize your request. Learn more: Authentication Guide

Step 3: Specify a Stellar method at the end of the query:

https://svc.blockdaemon.com/stellar/mainnet/native/YOUR_METHOD

Step 4: For POST requests, specify the data required by the method in the request body.

Example Request

Here is a cURL example for using ledgers to list all ledgers in Stellar Mainnet:

curl -X GET \
https://svc.blockdaemon.com/stellar/mainnet/native/ledgers \
-H 'Authorization: Bearer YOUR_API_KEY'

The following is a typical response you will get:

{
    "_links": {
        "self": {
            "href": "https://ubiquity-fullnode-2-mainnet.stellar.bdnodes.net/ledgers?cursor=&limit=10&order=asc"
        },
        "next": {
            "href": "https://ubiquity-fullnode-2-mainnet.stellar.bdnodes.net/ledgers?cursor=47244640256&limit=10&order=asc"
        },
        "prev": {
            "href": "https://ubiquity-fullnode-2-mainnet.stellar.bdnodes.net/ledgers?cursor=8589934592&limit=10&order=desc"
        }
    },
    "_embedded": {
        "records": [
            {
                "_links": {
                    "self": {
                        "href": "https://ubiquity-fullnode-2-mainnet.stellar.bdnodes.net/ledgers/2"
                    },
                    "transactions": {
                        "href": "https://ubiquity-fullnode-2-mainnet.stellar.bdnodes.net/ledgers/2/transactions{?cursor,limit,order}",
                        "templated": true
                    },
                    "operations": {
                        "href": "https://ubiquity-fullnode-2-mainnet.stellar.bdnodes.net/ledgers/2/operations{?cursor,limit,order}",
                        "templated": true
                    },
                    "payments": {
                        "href": "https://ubiquity-fullnode-2-mainnet.stellar.bdnodes.net/ledgers/2/payments{?cursor,limit,order}",
                        "templated": true
                    },
                    "effects": {
                        "href": "https://ubiquity-fullnode-2-mainnet.stellar.bdnodes.net/ledgers/2/effects{?cursor,limit,order}",
                        "templated": true
                    }
                },
                "id": "fe0f6bea5f341344fdb5bc6fc4ad719dd63071d9203e9a1e7f17c68ea1ecebde",
                "paging_token": "8589934592",
                "hash": "fe0f6bea5f341344fdb5bc6fc4ad719dd63071d9203e9a1e7f17c68ea1ecebde",
                "prev_hash": "39c2a3cd4141b2853e70d84601faa44744660334b48f3228e0309342e3f4eb48",
                "sequence": 2,
                "successful_transaction_count": 0,
                "failed_transaction_count": 0,
                "operation_count": 0,
                "tx_set_operation_count": 0,
                "closed_at": "2015-09-30T16:46:54Z",
                "total_coins": "100000000000.0000000",
                "fee_pool": "0.0000000",
                "base_fee_in_stroops": 100,
                "base_reserve_in_stroops": 100000000,
                "max_tx_set_size": 500,
                "protocol_version": 1,
                "header_xdr": "AAAAATnCo81BQbKFPnDYRgH6pEdEZgM0tI8yKOAwk0Lj9OtIzUjr/foF3Zu1Snl7gIUXUGqhoUJG2tzUKbNoPAsFhpEAAAAAVgwR/gAAAAIAAAAIAAAAAQAAAAEAAAAIAAAAAwAAAfQAAAAA3z9hmASpL9tAVxktxD3XSOp3itxSvEmM6AUkwBS4ERmR2QgH0N3bkOnEnemuBV73KfTL2fMONrNcU1pXRKIkMgAAAAIN4Lazp2QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZAX14QAAAAH0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
            },
            { ...more items... }
        ]
    }
}