🎉 Exciting News! NFTScan Officially Launches ERC-6551 NFT API Data Service

NFTScan
NFTScan
Published in
6 min readJun 14, 2024

Recently, the NFTScan team officially launched the ERC-6551 NFT API data service, dedicated to providing concise and efficient NFT data search and query services for NFT developers and users in the Web3 ecosystem. With a streamlined API design, developers can easily access and integrate ERC-6551 standard NFT data, greatly enhancing the efficiency of developing innovative applications based on the new standard.

ERC-6551 Overview

ERC-6551 is a groundbreaking new token standard released by the Future Primitive team on May 23, 2022. It introduces the innovative concept of Token-Bound Accounts (TBA), giving each NFT full Ethereum account functionality, realizing the concept of “NFT as a wallet”. This not only enhances security and permission control but also opens up infinite application possibilities for NFTs, breaking free from the limitations of being merely static assets. It injects new momentum into the long-term development of the NFT ecosystem and is seen as a milestone innovation in the NFT field.

NFTScan’s ERC-6551 NFT API is an interface service designed for ERC-6551 data search and query. It helps developers quickly and accurately access NFT data, significantly improving the efficiency of Web3 application development. The API provides various query functions, including precise retrieval based on parameters such as TBA account address and contract address, ensuring that developers can efficiently handle large amounts of data. It provides developers with an all-in-one NFT data solution, greatly simplifying the process of accessing and processing NFT data and improving development efficiency.

Creating an NFTScan Developer Account

Before using the NFTScan API, you need to visit the developer website and create an account. Visit the NFTScan official website and click on the “Sign Up” button for NFTScan API registration.

https://developer.nftscan.com/user/signup

Sign up

Once logged in, find your unique API KEY on the Dashboard. Visit the API documentation, enter your API KEY in the appropriate place as instructed in the documentation, and you can start using the API service. In the API documentation, developers can find various interface modes to choose from based on their needs.

In the Dashboard, developers can also view statistics on their API usage, helping to track historical usage data. Additionally, NFTScan provides each registered developer with 1M CU of API call services for requesting all NFT API interfaces, and the CU never expires until used up!

View ERC-6551 API Documentation

After successfully registering for a developer account and obtaining an API Key, it is necessary to review the NFTScan API documentation. The API documentation contains all available API endpoints and parameters, as well as detailed information 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 retrieve the data you need. The NFTScan API service is dedicated to helping developers improve their NFT data analysis experience.

NFTScan currently has the largest and most comprehensive NFT Collection library on the entire network, supporting full NFT data for 24 different blockchains including Ethereum, Solana, BNBChain, Bitcoin, and Mint, covering a wide range of NFT data types. It provides a complete set of interfaces to access ERC721, ERC1155, ERC404, and ERC6551 assets, as well as transaction, project, and market statistics. It currently supports over 60 public interfaces for EVM-compatible chains, as well as a batch of similar interfaces for Solana, Aptos, Bitcoin, and TON, meeting the needs of developers to index multiple types of NFT data to a large extent.

ERC-6551 NFT API Series

1. Search TBAs

Endpoint: /v2/erc6551/filters

This API is used to retrieve all ERC-6551 NFT data. (Note: Currently, only Ethereum is supported.)

Clicking Try it reveals a total of 16348 data, including:
“contract”: Contract address
“token_id”: Token ID
“account”: TBA account address

2. Get the NFT by TBA

Endpoint: /v2/erc6551/asset/{account_address}

This endpoint is used to retrieve the NFT data returned by the ERC-6551 Token Binding Account (TBA). Here we retrieve the NFT-related information for the TBA address 0x5416e5dc14caa0950b2a24ede1eb0e97c360bcf5. Click Try it to return the details of the NFT.

3. Get TBAs by the NFT

Endpoint: /v2/erc6551/tbas/{contract_address}/{token_id}

This endpoint retrieves a list of TBA addresses associated with the NFT contract address. Here, we retrieve the TBA account information bound to the NFT contract address 0xd022977a22f9a681df8f3c51ed9ad144bdc5bb38 by selecting token id 0x000000000000000000000000000000000000000000000000000000000000011b. The data is returned as follows:

Building NFT API Requests

Building NFT data requests with NFTScan is very simple and convenient. Developers just need to find the required API endpoint in the documentation and review the endpoint URL, request method, request parameters, and other details. Then, they can choose their preferred programming language according to their needs and quickly integrate the API to obtain the ERC6551 NFT data.

For example, we can use Python to request NFT-related information for the address 0x5416e5dc14caa0950b2a24ede1eb0e97c360bcf5 from TBA by using the API endpoint “/v2/erc6551/asset/{account_address}”. This request can be constructed as follows:

import requests

# Define the request URL and address
base_url = "https://api.nftscan.com/v2/erc6551/asset/"
account_address = "0x5416e5dc14caa0950b2a24ede1eb0e97c360bcf5"
url = f"{base_url}{account_address}"

# Set up the request headers, assuming an API key is required
headers = {
"Authorization": "Bearer YOUR_API_KEY", # Replace with your actual API key
"Content-Type": "application/json"
}

# Send the GET request
response = requests.get(url, headers=headers)

# Check if the request was successful
if response.status_code == 200:
nft_data = response.json() # Parse the JSON response
print(nft_data)
else:
print(f"Request failed, status code: {response.status_code}")
print(response.text)

In this code snippet, you need to:

  • Replace YOUR_API_KEY with your actual API key.
  • Ensure the request URL and headers are set correctly according to the API documentation’s provided endpoint and parameter descriptions.

Summary

The ERC6551 API can help developers easily obtain NFT data related to a specific Token Bound Account (TBA). Through simple API requests, developers can quickly retrieve detailed data, greatly simplifying the data retrieval process, improving development efficiency, and supporting multiple programming languages.

NFTScan is the world’s largest NFT data infrastructure, including a professional NFT explorer and NFT developer platform, supporting the complete amount of NFT data for 20+ blockchains including Ethereum, Solana, BNBChain, Arbitrum, Optimism, and other major networks, providing NFT API for developers on various blockchains.

Official Links:

NFTScan: https://nftscan.com

Developer: https://developer.nftscan.com

Twitter: https://twitter.com/nftscan_com

Discord: https://discord.gg/nftscan

Join the NFTScan Connect Program

--

--