Cover Image for Non-fungible Token APIs (NFT APIs)

Non-fungible Token APIs (NFT APIs)

NFT

From King of Leon launching their music album to Grimes and Lindsay lohan memeing herself on the blockchain, NFTs are making real buzz now. However, we think there is a huge gap when it comes to NFT analytics and building tools to integrate NFT in the broader ecosystem. This article will show you how to access and analyze NFT related data using Bitquery APIs.

Note: We will take CryptoKitties as an example and analyze its CK token ([0x06012c8cf97bead5deae237070f9587f8e7a266d](https://explorer.bitquery.io/ethereum/token/0x06012c8cf97bead5deae237070f9587f8e7a266d)), which is an ERC721 (non-fungible) token standard. Here 1CK token represents 1 kitty on the blockchain. Also, check here and here to see what analytics can be built using our NFT APIs.

Basic NFT Metrics

Let’s get some basic metrics of CK token. For example, how many CK tokens (cryptokitties) exist and transfers, senders, and receivers’ information.

NFT Transfers

Now let’s look at the CK transfers; this will also help us understand Cryptokitties activity on-chain and its popularity.

The above query giving the Cryptokitties’ total transfer on a month-by-month basis; you can see the query result in the visualization below.

As you can see Cryptokitties popularity declined significantly over time.

Transfers

Token Transfers By Date

Transfers

NFT Senders

Let’s dig into people sending Cryptokitties; as you can see, CK unique senders declined over time, and this year on average, ~650 people sent cryptokitties every month.

Unique Senders By Time

You can also check the addresses which sent most of Cryptokitties. Use the following query.

Similarly, you can also check top CryptoKitties receivers using the following query.

{
  ethereum {
    transfers(currency: {is: "0x06012c8cf97bead5deae237070f9587f8e7a266d"}, 
      height: {gt: 0}, amount: {gt: 0}, options: {desc: "amount", limit: 10, offset: 0}) {
      sender {
        address
        annotation
      }
      currency {
        symbol
      }
      amount
      count
      receiver_count: count(uniq: receivers)
      max_amount: maximum(of: amount, get: amount)
      max_date: maximum(of: date)
    }
  }
}

NFT Smart Contract Stats

Using our APIs, you can get smart contract properties and stats for any NFT smart contract. For example, in the case of Cryptokitties, there were more than 10.3 million smart contract calls on Cryptokitties’ contracts, in which ~4.3 million internal and ~6 million calls are external. Besides, Cryptokitties Smart contracts processed more than 7 million transactions by 90,742 unique users. At the time of writing this article Total supply of CK token is 1,996,611.

You can also get historical analytics using our APIs; for example, the following image shows the unique smart contracts callers overtime.

Transfers

Unique Callers By Date

Transfers

NFT Smart Contract Methods

NFT’s are created through smart contracts. Using our APIs, you can understand what smart contract methods are getting called and their analytics. For example, check Cryptokitties smart contract methods. Using this data, you can learn what type of activity is most famous for a specific NFT project. For example, in the case of more than createSaleAuction method was called more than 1million times. This shows Cryptokitties auction feature is popular among its users.

Similarly, you can also get Cryptokitties smart contract events using our APIs.

Distribution of Calls Count by Methods

Transfers

NFT Transactions

Using our APIs, you can get transactions for any NFT asset on Ethereum and other blockchains. You can also learn about the addresses which are spending most Gas fee on a specific NFT. This can be helpful for a marketing campaign targeting top NFT users of your competitors.

For example, the following are the top Gas spender addresses for Cryptokitties.

Transfers

NFT Trades on DEXs

0x DEX protocol allows native on-chain NFT trades; however, as you can see in the following image, there is not much trade activity for CK token.

Transfers

Trades by time

If you want to learn more about NFT DEX trades, you can get the CK DEX trades using the following query. Besides, check more NFT DEX trade data on our blockchain explorer.


{
  ethereum {
    dexTrades(options: {desc: ["block.height", "tradeIndex"], limit: 10, offset: 0}, baseCurrency: {is: "0x06012c8cf97bead5deae237070f9587f8e7a266d"}) {
      block {
        timestamp {
          time(format: "%Y-%m-%d %H:%M:%S")
        }
        height
      }
      tradeIndex
      protocol
      exchange {
        fullName
      }
      smartContract {
        address {
          address
          annotation
        }
      }
      baseAmount
      baseCurrency {
        address
        symbol
      }
      quoteAmount
      quoteCurrency {
        address
        symbol
      }
      transaction {
        hash
      }
    }
  }
}

Conclusion

We believe a lot of use cases of NFT in different sectors, especially in the Gaming industry. However, to integrate into the existing business and projects, we need better data access support, which Bitquery solves through simple GraphQL APIs. If you are building any NFT related project, talk to us on our Telegram channel.

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. Our products are:

  • 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. Read this 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, 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 below, we will keep you updated with the latest in the cryptocurrency world.

Subscribe to our newsletter

Subscribe and never miss any updates related to our APIs, new developments & latest news etc. Our newsletter is sent once a week on Monday.