How to use the NFTScan NFT API to develop Web3 applications on the Arbitrum network

Arbitrum is Ethereum’s Layer 2 expansion solution, providing a solution to the high gas fees and network congestion problems faced by Ethereum. As Layer 1, the Ethereum base layer is limited by the fact that it can only verify 15 transactions per second, which limits the scalability of Ethereum given the current huge demand for Ethereum. Arbitrum uses Rollup scaling technology, which is designed to solve the congestion and high cost problems of Ethereum and improve the scaling and efficiency of the blockchain. It contains two independent mainnets based on different technologies, Arbitrum One and Arbitrum Nova. This article will introduce how to use the NFTScan NFT API to develop Web3 applications on the Arbitrum One network.

According to NFTScan data, as of November 7, a total of 19,793,811 NFT assets, 29,340 NFT Collections, 56,925,931 transaction records, 3,732,089 interacted wallet addresses, and a total transaction volume of 33,280.45 ETH have been issued on the Arbitrum network.

NFTScan option:

In addition to currently 15 EVM-compatible chains, NFTScan also supports 4 other non-EVM blockchains: Bitcoin, Aptos, Solana, and TON.

How to access NFTScan NFT API

Create NFTScan developer account

Before you start using the NFTScan API, you first need to visit the developer website and create an account. Go to the NFTScan official website and click the NFTScan API “Sign Up” button to register.

After logging in, find your own unique API KAY on the Dashboard and copy it. Visit the API documentation and enter your API KEY into the corresponding location in the API documentation. According to the guidance of the documentation, you can start using the API service. In the API documentation, developers can find a variety of interface modes to choose from and choose the most appropriate interface according to their needs.

In the Dashboard, developers can also view statistics on their own API usage to help record historical usage data. Not only that, NFTScan also provides each registered developer with an API call service of 1M CU, which can be used to request all NFT API interfaces, and the CU will never expire until it is used up!

View the Arbitrum API documentation

After successfully registering a developer account to obtain the API Key, you need to view the NFTScan API documentation. The API documentation contains all API endpoints and parameters that can be used, as well as details on how to construct requests and handle responses. Please read the API documentation carefully and make sure you understand how to use the API to get the data you need. The NFTScan API service is dedicated to helping developers improve the experience of obtaining NFT data analysis.

NFTScan currently has the largest and most comprehensive NFT Collection library on the entire network, supporting Ethereum, Solana, BNBChain, Bitcoin, TON, Polygon, zkSync, Aptos, Linea, Base, Avalanche, Arbitrum, Optimism, Scroll, Fantom, Moonbeam, PlatON, Cronos , Gnosis 19 blockchain full NFT data, covering a wide range of NFT data, providing a complete set of interfaces to obtain ERC721 and ERC1155 assets as well as transaction, project, market statistics and other information, currently supports more than 60 EVM-specific The public interface of the compatible chain, as well as a batch of interfaces of the same model for Solana, Aptos, Bitcoin, and TON, largely meet the needs of developers for indexing multiple types of NFT data.

Arbitrage NFT API model

It mainly includes the following three model interfaces, including an overall introduction and description of some core API fields, so that developers can know how to obtain data and use this information to serve the Dapp service they are building.

Assets API: "Assets" is the most critical data field in NFT, used to uniquely identify and describe digital assets. Developers can gain a comprehensive understanding and build related applications by extracting NFT "Assets" data on the Arbitrum blockchain. The "Assets" object provides the unique identification of digital assets and data throughout its life cycle, providing a basis for developers to understand and apply NFT.

Transactions API:The transaction model represents the full transaction data of an NFT asset on the blockchain, providing developers with the complete life cycle transaction information of the NFT. Including NFT mint, transfer, sale, and other transaction activities, providing developers with the opportunity to gain in-depth understanding of the flow and evolution of NFT assets in the Arbitrum ecosystem. NFTScan continuously aggregates NFT trading markets and related trading contract information from various blockchain networks. Currently, NFTScan has been included to track and understand the dynamics of the NFT market. It also helps developers build NFT-based applications and tools.

Collections API:NFTScan obtains off-chain data such as descriptions, social media and other basic information related to NFT Collections. NFTScan obtains this information through APIs provided by the most mainstream NFT markets in various blockchain networks. In addition, the current floor price information is centralized data based on the order information of the NFT market, which is also available through the API.

Arbitrum NFT API Search

1/Retrieve Assets Series

  • Get NFTs by account (Retrieve NFTs by wallet address)

  • Get all NFTs by account (retrieve all NFTs from the wallet address and group the NFTs according to the contract address. If the total number of NFTs owned by the account address exceeds 2000, the returned NFTs will be limited to less than 2000. In this case, Developers and users can obtain all NFTs owned by the account address by account through paging query requests)

  • Get minted NFTs by account (retrieve minted NFTs of the wallet address)

  • Get NFTs by contract (retrieve NFTs by contract address and sort by token_id in ascending order)

  • Get single NFT

  • Get multiple NFTs (retrieve NFTs of multiple contract addresses at the same time)

  • Search NFTs (This interface returns a list of NFT assets by applying a search filter in the request body. Assets are sorted by nftscan_id in ascending order)

  • Get NFTs by attributes (This interface returns a set of NFTs belonging to the NFT contract address with attributes, and the NFTs are sorted by token_id in ascending order)

  • Get all multi-chain NFTs by account (This interface returns all multi-chain NFTs owned by the account address, and the NFTs are grouped according to the contract address)

Here we use Get minted NFTs by account The interface is

“/v2/account/mint/{account_address}”

to retrieve the detailed information of Minted NFT under a wallet address. The path parameter includes account_address as a choice. The query parameter selection includes NFT assets of erc712/erc1155. Here we are querying  0x02ac25b565c053bc1e7aa2a1499622512af375f1 

All erc721 NFTs Mint under the address.

Click Try it, and the data is returned as follows, which mainly includes the basic information query of the NFT asset contract address, metadata information, rarity score and ranking. Here you can see that a total of 5 erc721 NFTs were returned under the address, which are Vela - Beta Participation NFT# 688. Vela AMA - Official NFT#3667, Vela's Official Launch NFT#181, Camelot staking position NFT#51, Vela x Arbitrum AMA - Official NFT#4320.

2/ Retrieve Transactions Series

  • Get transactions by account (this interface returns the NFT transaction list of the wallet address)

  • Get transactions by contract (This interface returns the NFT transaction list of the NFT contract address)

  • Get transactions by NFT (this interface returns the NFT transaction list of a single NFT)

  • Search transactions (This interface returns a list of NFT transactions by applying a search filter in the request body)

  • Get transactions by to address (This interface returns a list of NFT transactions filtered by transaction parameters)

  • Get transactions by hash (This interface returns transaction records queried based on the transaction hash list)

Here we pass Get transactions by account

"/v2/transactions/account/{account_address}" This interface retrieves the NFT transaction record of a certain wallet address. The query parameter can select the NFT event type of the transaction (Mint/ Transfer/Sale/Burn), use ';' to separate multiple events.

Similarly here we search 

NFT transaction record of 0x02ac25b565c053bc1e7aa2a1499622512af375f1 . According to the event type of Mint, the result response data contains all key data of all NFT Mint under this address, such as transaction hash value, From and To addresses, block information, gas consumption, transaction timestamp and other basic data of NFT transactions. Feature information.

3/ Retrieve Collections series

  • Get an NFT collection (query details based on the contract address of the Collection, including overview and classification of items according to description, basic summary information such as holder distribution, average price, floor price, etc.)

  • Search NFT collections (This interface returns information for a Collection list sorted by deployment block number in ascending order by applying a search filter in the request body)

  • Get NFT collections by account (This interface returns item list information with a given account address, Collection is sorted from high to low by floor price)

  • Get NFT collections by ranking (This interface returns item list information with a given sorting field, Collection is sorted by the given sorting field and the given sorting direction)

Here we use the interface Get NFT collections by account

The search address of "/v2/collections/own/{account_address}" is 

0x02ac25b565c053bc1e7aa2a1499622512af375f1

Details of NFT Collections held:

4/ Collection Statistics: Collection statistical analysis series

  • Collection Statistics (this interface provides analytical statistical overview data of NFT Collection)

  • Collection Trade Distribution (This interface mainly provides project transaction distribution)

  • Collection Trending Statistics (mainly returns the Trading statistics sorting of an item)

  • Collection Holding Amount Distribution (This interface can return the distribution information of NFT project holdings)

  • Collection Holding Period Distribution (data returns NFT project holding period distribution information)

  • Collection Blue Chip Statistics (blue chip project statistical overview data)

  • Collection Blue Chip List (for a list of blue chip projects involved in this project, please refer to NFTScan Blue Chip Collection)

  • Collection Top Holder (the top holder distribution of the Collection)

Here we use the interface Collection Blue Chip Statistics 

"/v2/statistics/blue/chip/{contract_address}" mainly returns blue chip project statistics, please refer to NFTScan Overview:

https://www.nftscan.com/0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d?module=Analytics

5/ Account Statistics Series

  • Account Overview Statistics (This interface returns the overview statistical information of the account address, refer to NFTScan Overview)

  • Account Holding Distribution (This interface returns the NFT holding distribution statistics of the account address, refer to NFTScan Portfolio)

  • Account Holding NFT Trending (This interface returns the NFT holdings or quantity statistics of the account address, refer to NFTScan Portfolio)

6/ Analytic Statistics Series

This series of interfaces are usually used to obtain information related to data analysis and statistics on the NFTScan Arbitrum network, such as Trade Ranking, Mint Amount, etc. These interfaces allow developers or users to query, analyze, and retrieve information related to specific data sets or indicators. Statistical data. It can be used for a variety of purposes, including market analysis, trend tracking, investment decisions, and understanding the nature of specific data.

reference:https://arbitrum.nftscan.com/analytics

7/ Refresh Metadata

  • Refresh NFT metadata

  • Refresh NFT metadata by contract

Interfaces such as Refresh Metadata can help developers or users submit background refresh metadata tasks. After review, the task will refresh the submitted specified Item or the entire contract metadata.

8/ Other

  • Get latest block number (returns the latest block number that NFTScan has reached)

  • Get NFT amount by account (returns the amount of ERC721 and ERC1155 NFT owned by the account address based on the search list in the request body)

  • Get NFT owners by contract (returns the owner list of ERC721 NFT contract address, NFT is sorted by token_id in ascending order)

  • Get owners by an NFT (returns a list of owners of an ERC1155 NFT, sorted by account_address in ascending order)

Construct related NFT API requests

After developers find the required Arbitrum API interface and parameters in NFTScan's API documentation, they can code the API request using the programming language of their choice (e.g., Python, Java, JavaScript, etc.). Here is an example of how to request a wallet address using Python

“0x02ac25b565c053bc1e7aa2a1499622512af375f1”

Detailed information of NFT Collections held, and use the NFT interface

“/v2/collections/own/{account_address}”

import requests
# Define the API endpoint and parametersaccount_address = "0x02ac25b565c053bc1e7aa2a1499622512af375f1"api_url = f"https://arbitrum.nftscan.com/v2/collections/own/{account_address}"headers = {
   
       "Api-Key": "your_api_key_here"  # Replace "your_api_key_here" with your actual API key}
# Make the API requestresponse = requests.get(api_url, headers=headers)
# Check if the request was successfulif response.status_code == 200:    data = response.json()    # Process and work with the data as needed    print(data)else:    print("API request failed with status code:", response.status_code)

This is a basic example of making an API request using Python. Developers can customize the API address, parameters and data processing according to specific requirements, replacing "your_api_key_here" with the actual API key. If developers use other programming languages, the request methods and libraries need to be adapted accordingly.


About NFTScan

NFTScan was founded in early 2021 and is headquartered in Hong Kong. It is the world's leading NFT data infrastructure service provider and currently supports Bitcoin, Ethereum, BNBChain, Polygon, Solana, TON, Arbitrum, Optimism, zkSync, Base, Scroll, Aptos, etc. 19 mainstream blockchain networks. The NFTScan team is committed to providing simple and efficient NFT retrieval services to hundreds of millions of Web3 users, providing safe and stable multi-chain NFT indexing services to the new generation of financial technology companies, and using data to promote the prosperity and development of the NFT ecosystem! Currently, NFTScan is providing multi-chain NFT API data services to 5000+ developers including MetaMask, CMC, Binance NFT, Bybit, KuCoin, HashKey Group, Mask, imToken, Enjin, Coin98, etc.!

おすすめ

転載: blog.csdn.net/NFT_Research/article/details/134271674