Links

UTXO Indexer GraphQL API

UTXO Indexer's schema

BTC
BCH
LTC
DOGE
type BitcoinChain {
name: String!
balances(address: String!): [Balance!]!
unspentTxs(address: String!): [UnspentTransactionOutput!]!
transactions(address: String!, dateRange: OptDateRange! = {from: null, to: null}, blockRange: OptBlockRange! = {from: null, to: null}, pagination: CursorPagination! = {first: 99, after: null, last: null, before: null}): UTXOTransactionConnection!
status: Status!
}
type BitcoincashChain {
name: String!
balances(address: String!): [Balance!]!
unspentTxs(address: String!): [UnspentTransactionOutput!]!
transactions(address: String!, dateRange: OptDateRange! = {from: null, to: null}, blockRange: OptBlockRange! = {from: null, to: null}, pagination: CursorPagination! = {first: 99, after: null, last: null, before: null}): UTXOTransactionConnection!
status: Status!
}
type LitecoinChain {
name: String!
balances(address: String!): [Balance!]!
unspentTxs(address: String!): [UnspentTransactionOutput!]!
transactions(address: String!, dateRange: OptDateRange! = {from: null, to: null}, blockRange: OptBlockRange! = {from: null, to: null}, pagination: CursorPagination! = {first: 99, after: null, last: null, before: null}): UTXOTransactionConnection!
status: Status!
}
type DogeChain {
name: String!
balances(address: String!): [Balance!]!
unspentTxs(address: String!): [UnspentTransactionOutput!]!
transactions(address: String!, dateRange: OptDateRange! = {from: null, to: null}, blockRange: OptBlockRange! = {from: null, to: null}, pagination: CursorPagination! = {first: 99, after: null, last: null, before: null}): UTXOTransactionConnection!
status: Status!
}

Querring the GraphQL endpoints:

Balance of an address ( LTC example )

Query
Variables
Response
query Balances($address: String!) {
litecoin {
balances(address: $address) {
amount {
value
scalingFactor
}
address
asset {
symbol
name
image
id
contract
chain
price {
yearPriceChange
weekPriceChange
sparkline
scalingFactor
monthPriceChange
marketCapRank
fdv
dayPriceChange
dailyLow
dailyHigh
amount
allTimeLow
allTimeHigh
}
}
}
}
}
{
"address": "ltc1qzvcgmntglcuv4smv3lzj6k8szcvsrmvk0phrr9wfq8w493r096ssm2fgsw",
}
{
"data": {
"litecoin": {
"balances": [
{
"amount": {
"value": "278059977131260",
"scalingFactor": 8
},
"address": "ltc1qzvcgmntglcuv4smv3lzj6k8szcvsrmvk0phrr9wfq8w493r096ssm2fgsw",
"asset": {
"symbol": "LTC",
"name": "Litecoin",
"image": "https://assets.coingecko.com/coins/images/2/thumb_2x/litecoin.png?1547033580",
"id": "3acf799d-2365-4c27-b896-c0e9160dde5f",
"contract": null,
"chain": "Litecoin",
"price": {
"yearPriceChange": "-35.01351564777615",
"weekPriceChange": "-27.256684114389117",
"sparkline": [
89.04570867409497,
89.07053878859269,
89.01349293973153,
89.03043307422833,
89.04785867805877,
89.04318639002585,
89.06262804965297,
88.95322905149588,
89.24017872718922,
89.3439876130906,
89.45831536146463,
89.4221534014032,
90.38022541209216,
89.81660859518401,
90.08795522020044,
89.8281551568806,
89.63789654538512,
90.01171110686049,
90.6053023814084,
90.52480167645864,
90.3869711173334,
90.35151658082,
90.2556533246924,
90.3846808192588,
90.11003626824872,
90.24134253545384,
90.12475831016714,
89.78520281498922,
90.25799278542898,
89.94130760078725,
89.78142019660031,
90.00826821993331,
90.2545660562926,
90.06681571115743,
89.83200112505857,
89.86488664942567,
89.64435674220061,
89.59873359155685,
88.8892929082225,
88.45273557917822,
88.21622353291303,
88.65201188115795,
89.2920078043364,
89.69473133813419,
91.52495015197586,
90.22029370933446,
90.78390812844094,
91.19049661867376,
90.87832239004663,
90.84181192311203,
90.82863054407778,
90.4863805604232,
90.7189095197722,
90.82009579799856,
90.88346652962174,
91.20336995453356,
91.07445623466648,
90.75537295831133,
90.6549048354731,
90.53492870312792,
90.4878415327746,
90.3624155618086,
90.26163897390444,
90.42042593248514,
90.1017179949389,
90.1723812235045,
89.98197629869014,
90.25787084477652,
89.48215719259174,
89.12819302868681,
89.02937267623284,
88.82638736797033,
88.66364477474036,
88.47580995504093,
88.13542386380897,
88.2955119134572,
88.07209262544318,
88.10915665249128,
88.02186810849227,
87.59765635047302,
87.29472242359773,
88.02529613440342,
88.02869863256288,
88.68431855806514,
88.58912125965347,
88.54941013968948,
88.5344377739136,
88.03875870450565,
87.53442942499473,
87.57936663743202,
87.67309399621223,
87.39954018421331,
88.18791379435599,
88.52368220090162,
88.10733398997756,
87.8440050776425,
88.01978306283723,
88.2642220907432,
88.33656011943802,
88.27295486574043,
87.74815845354173,
86.43952059751743,
86.12847797296064,
85.93535496220599,
85.79971087994616,
85.52918849663592,
85.7864290207962,
86.16098069283267,
85.67869739111293,
86.50841131031606,
86.27933756387598,
86.43812003908792,
85.46379952135001,
85.70118404833906,
85.6269614559319,
86.36179736748228,
86.22727458864718,
85.68265634416296,
85.61389490291478,
85.66458819213837,
85.80594510863196,
84.78109586810196,
84.98076333104055,
84.94738066224731,
84.89963346329095,
85.27781169024999,
85.38657773712758,
85.33955444780734,
84.94305919158228,
84.58084495640976,
83.32310898158087,
84.60453716433275,
83.97066475193908,
83.6561353690368,
83.20721616206363,
83.49018205127584,
83.88188308016876,
83.36618007988169,
82.37208862048175,
82.83407972046909,
82.80741899582122,
82.57996411997517,
83.06266243106109,
83.29472051549985,
83.34184531718763,
83.20564523360143,
83.11924314558148,
82.82987367481059,
82.91502681143339,
82.89438742472302,
83.2570393397749,
83.7340164190082,
83.68423576678069,
84.43886147454998,
84.36112763249709,
83.97779044472209,
83.35099460913769,
83.0609167523237,
81.67407563569338,
81.14737785860204,
76.03966127080163,
76.29737204133083,
75.9868457035788,
76.71820367435646,
75.45426561106979,
75.3600251433753,
75.15656821435083,
75.57999380362038,
74.8250458714289
],
"scalingFactor": 0,
"monthPriceChange": "-31.36974533948421",
"marketCapRank": "16",
"fdv": "5843117073",
"dayPriceChange": "-17.139634894564935",
"dailyLow": "69.27",
"dailyHigh": "84.8",
"amount": "69.31",
"allTimeLow": "1.15",
"allTimeHigh": "410.26"
}
}
}
]
}
}
}

Transactions - last two TXs ( BTC example )

Query
Variables
Response
query Transactions($address: String!, $pagination: CursorPagination!) {
bitcoin {
transactions(address: $address, pagination: $pagination) {
pageInfo {
startCursor
hasPreviousPage
hasNextPage
endCursor
}
edges {
node {
timestamp
status
outputs {
amount {
scalingFactor
value
}
address
}
inputs {
amount {
scalingFactor
value
}
address
}
hash
fee {
value
scalingFactor
}
blockNumber
blockIndex
}
}
}
}
}
{
"address": "bc1qgdjqv0av3q56jvd82tkdjpy7gdp9ut8tlqmgrpmv24sq90ecnvqqjwvw97",
"pagination": {
"last": 2
},
}
{
"data": {
"bitcoin": {
"transactions": {
"pageInfo": {
"startCursor": "v1-613110-2168",
"hasPreviousPage": true,
"hasNextPage": false,
"endCursor": "v1-590368-663"
},
"edges": [
{
"node": {
"timestamp": "2020-01-16T15:23:27+00:00",
"status": "Confirmed",
"outputs": [
{
"amount": {
"scalingFactor": 8,
"value": "12340000"
},
"address": "bc1qgdjqv0av3q56jvd82tkdjpy7gdp9ut8tlqmgrpmv24sq90ecnvqqjwvw97"
},
{
"amount": {
"scalingFactor": 8,
"value": "2088530607"
},
"address": "bc1q2e3hz5anrugr2pnjnnyj0ffthzcknhl3vme5ze"
}
],
"inputs": [
{
"amount": {
"scalingFactor": 8,
"value": "2100874089"
},
"address": "1Kr6QSydW9bFQG1mXiPNNu6WpJGmUa9i1g"
}
],
"hash": "bd6fc6ed165a8c5ccdd6e7655c438ec658f8dbc37c777e62a67c70ca7d082191",
"fee": {
"value": "3482",
"scalingFactor": 8
},
"blockNumber": 613110,
"blockIndex": 2168
}
},
{
"node": {
"timestamp": "2019-08-16T10:00:29+00:00",
"status": "Confirmed",
"outputs": [
{
"amount": {
"scalingFactor": 8,
"value": "66857144010"
},
"address": "bc1q8ttee65cymskqugwuqw372gk4evrlz098ker60"
},
{
"amount": {
"scalingFactor": 8,
"value": "1000000"
},
"address": "bc1qgdjqv0av3q56jvd82tkdjpy7gdp9ut8tlqmgrpmv24sq90ecnvqqjwvw97"
}
],
"inputs": [
{
"amount": {
"scalingFactor": 8,
"value": "66858150932"
},
"address": "1Kr6QSydW9bFQG1mXiPNNu6WpJGmUa9i1g"
}
],
"hash": "bceb0c367b0665587f491fde416ce6ff485c1504d1d5d35186a75b8b147f4155",
"fee": {
"value": "6922",
"scalingFactor": 8
},
"blockNumber": 590368,
"blockIndex": 663
}
}
]
}
}
}
}

Transactions - first two TXs in a particular blockRange ( BTC example )

Query
Variables
Response
query Transactions($address: String!, $pagination: CursorPagination!, $blockRange: OptBlockRange!) {
bitcoin {
transactions(address: $address, pagination: $pagination, blockRange: $blockRange) {
pageInfo {
startCursor
hasPreviousPage
hasNextPage
endCursor
}
edges {
node {
timestamp
status
outputs {
amount {
scalingFactor
value
}
address
}
inputs {
amount {
scalingFactor
value
}
address
}
hash
fee {
value
scalingFactor
}
blockNumber
blockIndex
}
}
}
}
}
{
"address": "bc1qgdjqv0av3q56jvd82tkdjpy7gdp9ut8tlqmgrpmv24sq90ecnvqqjwvw97",
"pagination": {
"last": 2
},
"blockRange": {
"to": 778002,
"from": 777000
},
}
{
"data": {
"bitcoin": {
"transactions": {
"pageInfo": {
"startCursor": "v1-778002-2680",
"hasPreviousPage": false,
"hasNextPage": false,
"endCursor": "v1-778002-2680"
},
"edges": [
{
"node": {
"timestamp": "2023-02-23T19:35:23+00:00",
"status": "Confirmed",
"outputs": [
{
"amount": {
"scalingFactor": 8,
"value": "53040"
},
"address": "bc1qgdjqv0av3q56jvd82tkdjpy7gdp9ut8tlqmgrpmv24sq90ecnvqqjwvw97"
},
{
"amount": {
"scalingFactor": 8,
"value": "6215"
},
"address": "3KoYBuF5C5VU4bMQUv7GHGskyRHY9ehPte"
}
],
"inputs": [
{
"amount": {
"scalingFactor": 8,
"value": "60000"
},
"address": "3HvtPWh9Htjwu1dRn5552kbmCAiQ8431k6"
}
],
"hash": "4e857af06e26317e954671e799914f564c4e72c4f26c896c4ce76254d3a68678",
"fee": {
"value": "745",
"scalingFactor": 8
},
"blockNumber": 778002,
"blockIndex": 2680
}
}
]
}
}
}
}
Attention: due to complexity of using BlockRange & DateRange at the same time its not allowed in this API, because the user should first find the overlapping area for a particular DateRange and BlockRange in order to query it.

Transactions - first two TXs in a particular dateRange ( BTC example )

Query
Variables
Response
query Transactions($address: String!, $pagination: CursorPagination!, $dateRange: OptDateRange!) {
bitcoin {
transactions(address: $address, pagination: $pagination, dateRange: $dateRange) {
pageInfo {
startCursor
hasPreviousPage
hasNextPage
endCursor
}
edges {
node {
timestamp
status
outputs {
amount {
scalingFactor
value
}
address
}
inputs {
amount {
scalingFactor
value
}
address
}
hash
fee {
value
scalingFactor
}
blockNumber
blockIndex
}
}
}
}
}
{
"address": "bc1qgdjqv0av3q56jvd82tkdjpy7gdp9ut8tlqmgrpmv24sq90ecnvqqjwvw97",
"pagination": {
"last": 2
},
"dateRange":{
"from":"2023-02-05T12:31:24.0Z",
"to":"2023-02-08T08:40:24.0Z"
}
}
{
"data": {
"bitcoin": {
"transactions": {
"pageInfo": {
"startCursor": "v1-775525-222",
"hasPreviousPage": false,
"hasNextPage": false,
"endCursor": "v1-775525-222"
},
"edges": [
{
"node": {
"timestamp": "2023-02-08T05:19:25+00:00",
"status": "Confirmed",
"outputs": [
{
"amount": {
"scalingFactor": 8,
"value": "9300"
},
"address": "bc1qgdjqv0av3q56jvd82tkdjpy7gdp9ut8tlqmgrpmv24sq90ecnvqqjwvw97"
},
{
"amount": {
"scalingFactor": 8,
"value": "879086"
},
"address": "bc1qay3u88e5jc72uhnjl4pptuxuww8uun62qqhqwz"
},
{
"amount": {
"scalingFactor": 8,
"value": "1081430"
},
"address": "39nXnaYiVBaLhY1gEyz8UPskjjg7BEnqxp"
},
{
"amount": {
"scalingFactor": 8,
"value": "1141125"
},
"address": "bc1qa8f4m65lrmhur2nlnp7aq72079xeg2wp79d9ju497pq429rh05lqq9nsy4"
},
{
"amount": {
"scalingFactor": 8,
"value": "1328027"
},
"address": "1Nm74Ld3keLGAznBcx2MyWoxFfAUSK4VGx"
}
],
"inputs": [
{
"amount": {
"scalingFactor": 8,
"value": "1100938"
},
"address": "3Pu5x9E2wp9A91Zwkgi9ZhSBwoAbSvbZvE"
},
{
"amount": {
"scalingFactor": 8,
"value": "3349880"
},
"address": "3MdSsg57ydC2SP9ZJKTaF6yVkwpGpX34Ft"
}
],
"hash": "5132c861be699df39262e18a99bc26c386d54ec78d66f7b1d7a14c1ce6f8c2c9",
"fee": {
"value": "11850",
"scalingFactor": 8
},
"blockNumber": 775525,
"blockIndex": 222
}
}
]
}
}
}
}

Using the Pagination properly

In the transactions query, user can use the pagination only in the following combinations, other combinations that are not listed in the listing below are not implemented in this API.
  • Using First only.
  • Using First + After ( cursor ).
  • Using Last only.
  • Using Last + Before ( cursor ).

Transactions - last two TXs After a cursor ( BTC example )

Query
Variables
Response
query Transactions($address: String!, $pagination: CursorPagination!) {
bitcoin {
transactions(address: $address, pagination: $pagination) {
pageInfo {
startCursor
hasPreviousPage
hasNextPage
endCursor
}
edges {
node {
timestamp
status
outputs {
amount {
scalingFactor
value
}
address
}
inputs {
amount {
scalingFactor
value
}
address
}
hash
fee {
value
scalingFactor
}
blockNumber
blockIndex
}
cursor
}
}
}
}
{
"address": "bc1qgdjqv0av3q56jvd82tkdjpy7gdp9ut8tlqmgrpmv24sq90ecnvqqjwvw97",
"pagination": {
"first": 10,
"after": "v1-615822-304"
},
}
{
"data": {
"bitcoin": {
"transactions": {
"pageInfo": {
"startCursor": "v1-615822-304",
"hasPreviousPage": false,
"hasNextPage": false,
"endCursor": "v1-590368-663"
},
"edges": [
{
"node": {
"timestamp": "2020-02-03T16:31:15+00:00",
"status": "Confirmed",
"outputs": [
{
"amount": {
"scalingFactor": 8,
"value": "34662253414"
},
"address": "38nvB8P9QXjyLNva8CQ2AiAR35Sq1qaf2a"
},
{
"amount": {
"scalingFactor": 8,
"value": "500000000000"
},
"address": "bc1qgdjqv0av3q56jvd82tkdjpy7gdp9ut8tlqmgrpmv24sq90ecnvqqjwvw97"
}
],
"inputs": [
{
"amount": {
"scalingFactor": 8,
"value": "534662256866"
},
"address": "38nvB8P9QXjyLNva8CQ2AiAR35Sq1qaf2a"
}
],
"hash": "4cdbc1adba58ab093e2983cdaf45cd23ebdfc15382675b605897bd6a0e29d686",
"fee": {
"value": "3452",
"scalingFactor": 8
},
"blockNumber": 615822,
"blockIndex": 304
},
"cursor": "v1-615822-304"
},
{
"node": {
"timestamp": "2020-02-03T15:23:58+00:00",
"status": "Confirmed",
"outputs": [
{
"amount": {
"scalingFactor": 8,
"value": "534662256866"
},
"address": "38nvB8P9QXjyLNva8CQ2AiAR35Sq1qaf2a"
},
{
"amount": {
"scalingFactor": 8,
"value": "2500000000000"
},
"address": "bc1qgdjqv0av3q56jvd82tkdjpy7gdp9ut8tlqmgrpmv24sq90ecnvqqjwvw97"
}
],
"inputs": [
{
"amount": {
"scalingFactor": 8,
"value": "3034662260123"
},
"address": "38nvB8P9QXjyLNva8CQ2AiAR35Sq1qaf2a"
}
],
"hash": "5af3ab96d61b73ce96070006a7733132fdb9fcfc5634e569f3356c7cb3382f39",
"fee": {
"value": "3257",
"scalingFactor": 8
},
"blockNumber"