Cover Image for Arbitrum NFT APIs - A Comprehensive Guide to Bitquery's Arbitrum NFT APIs​

Arbitrum NFT APIs - A Comprehensive Guide to Bitquery's Arbitrum NFT APIs​

NFTs

Arbitrum is a layer 2 scaling solution built on Ethereum, specifically designed to alleviate Ethereum's congestion issues by increasing scalability and reducing transaction costs. As a result, compared to the Ethereum mainnet, transactions on Arbitrum are completed more quickly and for less money. Because of its increased scalability, Arbitrum is now a desirable choice for NFT (Non-Fungible Token) projects that want to avoid the high gas costs and network congestion that come with putting NFTs on the Ethereum blockchain. Additionally, Arbitrum makes NFT development and trading activities more productive and economical, which is part of the reason for its growing acceptance in the NFT industry.

To see live Arbitrum’s NFT updates, you can check out our Arbitrum explorer.

Accessing NFT data from Arbitrum is crucial for market analysis, research, and development efforts, enabling stakeholders to gain insights into NFT trends, track ownership, and innovate within the NFT ecosystem. Leveraging Bitquery API simplifies this process, offering a powerful tool for querying blockchain data efficiently and effectively.

Bitquery API is a powerful tool for accessing blockchain data through GraphQL queries which offers comprehensive data retrieval capabilities, allowing users to extract specific information from blockchain networks like Arbitrum.

This article will demonstrate how to effectively utilize the Bitquery API to fetch NFT data from the Arbitrum blockchain.This article will demonstrate how to effectively utilize the Bitquery API to fetch NFT data from the Arbitrum blockchain.This article demonstrates a step-by-step process, providing readers with a clear understanding of accessing and analyzing NFT-related data on Arbitrum through Bitquery API.

Transfers API allows us to get NFT (ERC721) Transfers. In this section, we will write some queries to get data related to Arbitrum NFT.

Total Token Transfer Count by Date

The query retrieves the total count of token transfers by date on the Arbitrum Mainnet, excluding transfers involving fungible currencies. It organizes the data by block date and includes the count of transfers along with the corresponding chain ID.

Open this query in the IDE.

query($network: evm_network,$from: String, $till: String) {
  EVM(dataset: combined network: $network){
    Transfers(
      orderBy: {ascending: Block_Date}
      where: {
        Block: {Date: {since: $from till: $till }}
        Transfer: {Currency: {Fungible: false}}}
    ){
      Block {
        Date
      }
      count
      ChainId
    }
  }
}

Top traded NFT tokens in Arbitrum Mainnet

This query aims to retrieve data on token transfers within the Arbitrum Mainnet. It specifies that the data should be ordered by block date, filtering for transfers involving non-fungible tokens. The query selects the block date, the count of transfers, and the chain ID for analysis.

Open this query in the IDE.

 {
  EVM(dataset: combined, network: arbitrum) {
    DEXTrades(
      orderBy: {descendingByField: "count"}
      limit: {offset: 1, count: 10}
      where: {Block: {Date: {since: "2020-01-10", till: "2024-01-10"}}, Trade: {Buy: {Currency: {Fungible: false}}, Sell: {Currency: {Fungible: true}}}}
    ) {
      Trade {
        Buy {
          Currency {
            Symbol
            SmartContract
          }
          min_price: Price(minimum: Trade_Buy_Price)
          max_rice: Price(maximum: Trade_Buy_Price)
        }
        Sell {
          Currency {
            Symbol
            SmartContract
          }
        }
      }
      buy_amount: sum(of: Trade_Buy_Amount)
      sell_amount: sum(of: Trade_Sell_Amount)
      count
      ChainId
    }
  }
}

Get newly minted NFTs

Numerous NFTs are minted daily; let's aim to retrieve data on newly minted NFTs using our Events API.When an NFT is minted, each smart contract emits Transfer event. Transfer event has 3 field: From, To and Value.

For newly minted NFTs, the From value will be 0x0000000000000000000000000000000000000000.

With all the above details, we can write the query to get newly minted NFTs.

Open this query in the IDE.

{
  EVM(dataset: combined, network: arbitrum) {
    Events(
      where: {Log: {Signature: {Name: {is: "Transfer"}}}, Block: {Date: {after: "2023-09-11"}}, Arguments: {startsWith: {Value: {Address: {is: "0x0000000000000000000000000000000000000000"}}}}}
      orderBy: {descending: Block_Time}
      limit: {count: 10}
    ) {
      Arguments {
        Name
        Type
        Value {
          ... on EVM_ABI_Integer_Value_Arg {
            integer
          }
          ... on EVM_ABI_String_Value_Arg {
            string
          }
          ... on EVM_ABI_Address_Value_Arg {
            address
          }
          ... on EVM_ABI_BigInt_Value_Arg {
            bigInteger
          }
          ... on EVM_ABI_Bytes_Value_Arg {
            hex
          }
          ... on EVM_ABI_Boolean_Value_Arg {
            bool
          }
        }
      }
      Block {
        Time
      }
      Log {
        Signature {
          Name
          Signature
          SignatureHash
          SignatureType
        }
        Index
        ExitIndex
        EnterIndex
        LogAfterCallIndex
        Pc
      }
      LogHeader {
        Address
        Data
        Index
      }
      Topics {
        Hash
      }
      Transaction {
        From
        To
        Type
      }
    }
  }
}

This data about newly minted NFTs may help you in analyzing NFT minting trends or from which NFT marketplaces these NFTs are getting minted.

Fetch NFT MarketPlace Data

This query retrieves data on the top DEX trades on the Arbitrum Mainnet, focusing on trades occurring between fungible and non-fungible tokens. It filters transactions by date and selects the top 10 trades ordered by count. Additionally, this query includes details such as the protocol used, unique NFTs traded, unique currencies involved, unique buyers, the count of trades, and the chain ID for analysis.

Open this query in the IDE.

 {
  EVM(dataset: combined, network: arbitrum) {
    DEXTrades(
      orderBy: {descendingByField: "count"}
      limit: {offset: 1, count: 10}
      where: {Block: {Date: {since: "2020-01-12", till:"2024-01-12"}}, Trade: {Buy: {Currency: {Fungible: false}}, Sell: {Currency: {Fungible: true}}}}
    ) {
      Trade {
        Dex {
          ProtocolName
          ProtocolFamily
          ProtocolVersion
        }
      }
      nfts: uniq(of: Trade_Buy_Currency_SmartContract, method: approximate)
      currencies: uniq(of: Trade_Sell_Currency_SmartContract, method: approximate)
      buyers: uniq(of: Trade_Buy_Buyer, method: approximate)
      count
      ChainId
    }
  }
}

Show the Current Trades in the Network

This query fetches DEX trades data from the combined dataset on the Arbitrum network, ordering by block number and limiting results by count. It filters trades based on specific criteria including non-fungible tokens and excludes certain smart contract addresses within a provided date range. Selected details include block time, transaction hash, DEX protocol info, trade details like buy/sell currencies, prices, amounts, sellers, buyers, and associated chain ID.

Open this query in the IDE.

 {
  EVM(network: arbitrum, dataset: combined) {
    DEXTrades(
      orderBy: {descending: Block_Number}
      limit: {count: 10}
      where: {Trade: {Buy: {Currency: {Fungible: false, SmartContract: {not: "0x"}}}, Sell: {Currency: {SmartContract: {not: "0x"}}, Seller: {not: "0x"}}}, Block: {Date: {till: "2024-01-10", since: "2020-01-10"}}}
    ) {
      Block {
        Time
      }
      Transaction {
        Hash
      }
      Trade {
        Dex {
          ProtocolFamily
          ProtocolName
          ProtocolVersion
          SmartContract
        }
        Buy {
          Currency {
            SmartContract
            Symbol
          }
          Price
          Amount
          Seller
          Buyer
          Ids
          URIs
        }
        Sell {
          Amount
          Currency {
            Symbol
            SmartContract
          }
        }
      }
      ChainId
    }
  }
}

DEX Trades by Protocols by Date involving NFTs

This query fetches data on DEX trades from the combined dataset on the specified network. It retrieves information such as the block date, DEX protocol details, trade count, and associated chain ID. The query filters trades by date and ensures that only trades involving non-fungible tokens are included.

Open this query in the IDE

{
  EVM(dataset: combined, network: arbitrum) {
    DEXTrades(
      orderBy: {descending: Block_Date}
      where: {Block: {Date: {since: "2020-01-10", till: "2024-01-10"}}, Trade: {Buy: {Currency: {Fungible: false}}}}
    ) {
      Block {
        Date
      }
      Trade {
        Dex {
          ProtocolFamily
          ProtocolVersion
          ProtocolName
        }
      }
      count
      ChainId
    }
  }
}

Get the Metadata of an NFT on Arbitrum Network

This GraphQL query retrieves transfer NFT information from the "combined" dataset on the Arbitrum network, targeting the most recent transfer with empty filter criteria for currency smart contract address and transfer ID. It fetches details about the currency involved, including its name, decimals, and symbol, as well as the receiver's address for the selected transfer. The query is designed to return only one result, ordered by descending block number, providing concise insight into the latest transfer activity within the specified network.

Open this query in the IDE.

{
  EVM(dataset: combined, network: arbitrum) {
     Transfers(
      where: {Transfer: {Currency: {SmartContract: {}}, Id: {}}}
      limit: {count: 1, offset: 0}
      orderBy: {descending: Block_Number}
    ) {
      Transfer {
        Currency {
          SmartContract
          Name
          Decimals
          Fungible
          HasURI
          Symbol
        }
        Id
        
        owner: Receiver
      }
    }
  }
}

Get the creator of NFT on Arbitrum Network

The query returns details about the creator (sender) of the contract creation call, whether it was a contract creation, and the transaction hash associated with the call.

Open this query in the IDE.

{
  EVM(dataset: combined, network: arbitrum) {
    Calls(
      limit: {count: 1}
      orderBy: {descending: Block_Time}
      where: {Call: {To: {}, Create: true}}
    ) {
      Call {
        creator: From
        Create
      }
      Transaction {
        Hash
      }
    }
  }
}

Latest Non-Fungible Token Balance Update Lookup

The query filters for non-fungible currencies and retrieves details about the currency involved, the balance update itself (including address, amount, and ID), and information about the block when the update occurred (number and date).

Open this query in the IDE

{
  EVM(dataset: combined, network: arbitrum) {
    BalanceUpdates(
      orderBy: {descending: Block_Time}
      limit: {count: 1}
      where: {BalanceUpdate: {}, Currency: {Fungible: false}}
    ) {
      Currency {
        Name
        SmartContract
      }
      BalanceUpdate {
        Address
        Amount
        Id
      }
      Block {
        Number
        Date
      }
    }
  }
}

Total Buy-Sell of an NFT Token on Blur(Arbitrum Network)

The query aims to provide insights into the trading activity, including the total trade volume, the count of trades, unique buyers and sellers, as well as the number of distinct non-fungible tokens (NFTs) traded. Additionally, it retrieves details about the bought currency, such as its name, symbol, and protocol name.

Open this query in the IDE

{
  EVM(dataset: combined, network: arbitrum) {
    DEXTrades(
      where: {Trade: {Dex: {ProtocolName: {in: "seaport_v1.4"}}, Buy: {Currency: {Fungible: false, SmartContract: {}}}}, Transaction: {To: {}}}
      limit: {count: 10}
    ) {
      tradeVol: sum(of: Trade_Buy_Amount)
      count
      buyer: count(distinct: Trade_Buy_Buyer)
      seller: count(distinct: Trade_Buy_Seller)
      nfts: count(distinct: Trade_Buy_Ids)
      Trade {
        Buy {
          Currency {
            Name
            ProtocolName
            Symbol
            Fungible
            SmartContract
          }
        }
      }
    }
  }
}

Identifying Top NFT Buyers on Blur(Arbitrum Network)

This GraphQL query retrieves trading data from the "seaport_v1.4" protocol on the Arbitrum network, focusing on non-fungible token (NFT) trades where the recipient is specified. It sorts the results by the count of trades in descending order and limits the output to the top 3 trades. The query provides statistics such as the total count of trades, the number of unique transactions, the earliest and latest block dates, the count of distinct NFTs traded, the count of distinct smart contracts involved in trades, and the total amount of money paid. Additionally, it retrieves information about the buyer involved in each trade.

Open this query in the IDE.

{
  EVM(dataset: combined, network: arbitrum) {
    DEXTrades(
      where: {Trade: {Dex: {ProtocolName: {in: "seaport_v1.4"}}, Buy: {Currency: {Fungible: false}}}, Transaction: {To: {}}}
      orderBy: {descendingByField: "count"}
      limit: {count: 3}
    ) {
      count
      uniq_tx: count(distinct: Transaction_Hash)
      Block {
        first_date: Time(minimum: Block_Date)
        last_date: Time(maximum: Block_Date)
      }
      nfts: count(distinct: Trade_Buy_Ids)
      difffernt_nfts: count(distinct: Trade_Buy_Currency_SmartContract)
      total_money_paid: sum(of: Trade_Sell_Amount)
      Trade {
        Buy {
          Buyer
        }
      }
    }
  }
}

Conclusion

Accessing NFT data from the Arbitrum blockchain is crucial for understanding market trends, tracking ownership, and fostering innovation within the NFT ecosystem, empowering stakeholders to make informed decisions.

The article has demonstrated a comprehensive process for utilizing the Bitquery API to efficiently fetch NFT data from the Arbitrum blockchain, offering readers a practical guide to leveraging this powerful tool for blockchain data analysis.

Readers are encouraged to explore further and experiment with the Bitquery API for their own projects or research endeavors, unlocking new insights and opportunities within the rapidly growing blockchain space.

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 sales@bitquery.io. Also, subscribe to our newsletter below, we will keep you updated with the latest in the cryptocurrency world.

This article has been written by guest writer Dheeraj Maske.

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.