Bitquery's Transfer APIs

A blockchain is a peer-to-peer network of computers or servers known as “nodes” that both participate and monitor the transfer of information and assets. Every transfer is recorded on each user’s computer (node), generating a platform of trust based on several identical copies of the ledger. Bitquery’s tools and widgets allow you to query the token transfers for Smart contract chains like Ethereum, Binance, Tron, Matic and Klaytn, Tron, and other Bitcoin Platform Explorers like Bitcoin mainnet and Dogecoin etc. You can use the Bitquery explorer to analyse the transfers taking place on various blockchain networks.

In this article we’ll take a look at some examples to fetch transfer related data from different blockchains one by one.

Ethereum

Ethereum is one of the most prominent blockchain networks today, let’s take a look at a query which fetches details of transfers made from a specific Ethereum address “0x6efdb9ba5539e356b2cdadf70ce45ac396b62755”, giving the sender’s and receiver’s address, annotation, smartcontract type and other details like amount, currency, transaction hash, timestamp etc.

{
  ethereum(network: ethereum) {
    transfers(
      options: {limit: 50, offset: 0}
      external: true
      amount: {gt: 0}
      txFrom: {is: "0x6efdb9ba5539e356b2cdadf70ce45ac396b62755"}
    ) {
      sender {
        address
        annotation
        smartContract {
          contractType
          protocolType
        }
      }
      receiver {
        address
        annotation
        smartContract {
          contractType
          protocolType
        }
      }
      amount
      currency {
        symbol
        address
        name
        decimals
        tokenId
        tokenType
      }
      external
      entityId
      transaction {
        hash
      }
      block {
        timestamp {
          iso8601
        }
      }
    }
  }
}

You can find this query here

All inbound and outbound transfers for Ethereum

You can even get all the inbound and outbound tranfers fir the Ethereum blockchain network using a query similar to the one that follows.Here we’re taking “0x0361175d36846dfcafdf6f579a3de276e0a2ac5d” as the initial address. The inbound and outbound depths have been taken as 1 .

{
  ethereum(network: ethereum) {
    inbound: coinpath(
      initialAddress: {is: "0x0361175d36846dfcafdf6f579a3de276e0a2ac5d"}
      depth: {lteq: 1}
      options: {direction: inbound, asc: "depth", desc: "amount", limitBy: {each: "depth", limit: 10}}
      date: {since: "2021-11-18", till: "2021-12-17"}
    ) {
      sender {
        address
        annotation
        smartContract {
          contractType
          currency {
            symbol
            name
          }
        }
      }
      amount
      currency {
        symbol
      }
      depth
      count
    }
    outbound: coinpath(
      initialAddress: {is: "0x0361175d36846dfcafdf6f579a3de276e0a2ac5d"}
      depth: {lteq: 1}
      options: {asc: "depth", desc: "amount", limitBy: {each: "depth", limit: 10}}
      date: {since: "2021-11-18", till: "2021-12-17"}
    ) {
      receiver {
        address
        annotation
        smartContract {
          contractType
          currency {
            symbol
            name
          }
        }
      }
      amount
      currency {
        symbol
      }
      depth
      count
    }
  }
}

You can get this query here

Binance Smart Chain

Moving on we’ll take a look at the query to get the transfers on the Binance smart chain network (bsc), giving us details like the currency, token Id, symbol, amount and count of unique senders, receivers etc.


{
  binance {
    transfers(options: {desc: "count", asc: "currency.symbol", limit: 10}, date: {since: "2021-07-30", till: null}) {
      currency {
        symbol
        tokenId
      }
      count
      senders: count(uniq: senders)
      receivers: count(uniq: receivers)
      from_date: minimum(of: date)
      till_date: maximum(of: date)
      amount
    }
  }
}

You can get the above query here

Algorand

For the Algorand network, we’ll be considering an aliased query which fetches transfer related information for the address “2QXNQMXZNZLTKBKPLBADOEJ233L4YH4TDETSDNHCPUXNXENS46SHCEXE3A” along with the details related to the rewards.

{
  algorand(network: algorand) {
    token_transfers: transfers(
      date: {since: null, till: null}
      currency: {is: 0}
      options: {limit: 10000, offset: 0, asc: "currency.symbol"}
    ) {
      sum_in: amount(calculate: sum, receiver: {is: "2QXNQMXZNZLTKBKPLBADOEJ233L4YH4TDETSDNHCPUXNXENS46SHCEXE3A"})
      sum_out: amount(calculate: sum, sender: {is: "2QXNQMXZNZLTKBKPLBADOEJ233L4YH4TDETSDNHCPUXNXENS46SHCEXE3A"})
      currency {
        tokenId
        symbol
        name
        address
        tokenType
      }
    }
    algorand_withRewards: address(address: {is: "2QXNQMXZNZLTKBKPLBADOEJ233L4YH4TDETSDNHCPUXNXENS46SHCEXE3A"}) {
      balance
      pendingRewards
      rewards
      status
    }
  }
}

To get the above query, click here.

Tron

For the Tron network, let’s look at a query which gives the details related to the inbound transfers for the address “TCSqaoB1T52VStbXTdZgaJWc8nE6kAAkXo”.

{
  tron {
    inbound: transfers(
      receiver: {is: "TCSqaoB1T52VStbXTdZgaJWc8nE6kAAkXo"}
      options: {asc: ["block.height", "txHash"], limit: 500, offset: 0}
      time: {till: "2021-12-23T21:19:19Z"}
    ) {
      receiver {
        address
      }
      sender {
        address
      }
      amount
      currency {
        name
        symbol
        decimals
        tokenId
        tokenType
        address
      }
      contractType
      txHash
      block {
        height
        timestamp {
          iso8601
        }
      }
      success
    }
  }
}

You can get the above query here

Matic

Now let’s take a look at the Polygon Matic network. In this query we’re fetching the transfers for the currency “0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270” , sorted in the descending order of their timestamp.

{
  ethereum(network: matic) {
    transfers(
      options: {desc: "block.timestamp.time", limit: 10, offset: 0}
      date: {since: "2022-02-01", till: "2022-03-02T23:59:59"}
      amount: {gt: 0}
      currency: {is: "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270"}
    ) {
      block {
        timestamp {
          time(format: "%Y-%m-%d %H:%M:%S")
        }
        height
      }
      sender {
        address
        annotation
      }
      receiver {
        address
        annotation
      }
      transaction {
        hash
      }
      amount
      currency {
        symbol
      }
      external
    }
  }
}

You can get the above query here.

Klaytn

Moving on to the Klaytn network, we’ll be investigating the transfer related details for the currency “0xc6a2ad8cc6e4a7e08fc37cc5954be07d499e7654”. The query, as you can observe, is on the same lines as that of networks like Matic and Ethereum.

{
  ethereum(network: klaytn) {
    transfers(
      options: {desc: "block.timestamp.time", limit: 10, offset: 10}
      date: {since: "2022-02-01", till: "2022-03-02"}
      amount: {gt: 0}
      currency: {is: "0xc6a2ad8cc6e4a7e08fc37cc5954be07d499e7654"}
    ) {
      block {
        timestamp {
          time(format: "%Y-%m-%d %H:%M:%S")
        }
        height
      }
      sender {
        address
        annotation
      }
      receiver {
        address
        annotation
      }
      transaction {
        hash
      }
      amount
      currency {
        symbol
      }
      external
    }
  }
}

To get the above query, click here.

Avalanche

Bitquery’s APIs support the Avalanche network too, let’s take a look at a query giving information about transfers related to the address “0x0aff5bA727C53aC35B19941a58B99D0560Deeb92”.

{
  ethereum(network: avalanche) {
    transfers(
      options: {desc: "block.timestamp.time", asc: "currency.symbol", limit: 10, offset: 0}
      date: {since: "2022-01-03", till: "2021-02-01T23:59:59"}
      amount: {gt: 0}
      txFrom : {is: "0x0aff5bA727C53aC35B19941a58B99D0560Deeb92"}
    ) {
      block {
        timestamp {
          time(format: "%Y-%m-%d %H:%M:%S")
        }
        height
      }
      address: sender {
        address
        annotation
      }
      currency {
        address
        symbol
      }
      amount
      transaction {
        hash
      }
      external
    }
  }
}

You can get the above query here.

You can observe that the above query is similar to the ones used for networks like Ethereum, Klaytn , Matic etc.

Total transfer count

You can easily get the transfer count for any network as well by tweaking the following query.

{
  ethereum(network: avalanche) {
    transfers {
      count
      
    }
  }
}

Click this link to get the above query.

Conclusion

Bitquery’s Balance API supports various blockchains like Ethereum, Binance smart chain, Avalanche, Tron, Polygon Matic etc. You can easily fetch the transfers taking place on various blockchain networks, transfers made using a particular address or a particular token from a number blockchain networks very conveniently using Bitquery’s transfer API.

Our Other DEX APIs are comprehensive and available for a number of blockchain networks are of great help in case you want to build DEX related tools or fetch data related to the DEXs. Check out our APIs today!!

If you have questions, you can also contact us.

Also Read

About Bitquery

Bitquery is a set of software tools that parse, index, access, search, and use information across blockchain networks in a unified way. We are crossing the ‘chain-chasm’ by delivering set of products that can work across blockchains. Our products include:

Coinpath APIs provide blockchain money flow analysis for more than 24 blockchains. With Coinpath’s APIs, you can monitor blockchain transactions, investigate crypto crimes such as bitcoin money laundering, and create crypto forensics tools. You can refer to this article to get started with Coinpath

Digital Assets API provides index information related to all major cryptocurrencies, coins, and tokens.

DEX API provides real-time deposits and transactions, trades, and other related data on different DEX protocols like Uniswap, SushiSawap, Kyber Network, Airswap, Matching Network, etc.

If you have any questions about our products, ask them on our Telegram channel or email us at hello@bitquery.io . Also, subscribe to our newsletter and stay updated about the latest in the cryptocurrency world.

1 Like