Cointime

Download App
iOS & Android

🛠️ Guide: How to Develop Web3 dApps on Sei Network Using NFTScan NFT API

Validated Project

Gravity is a Layer-1 blockchain designed for massive adoption and the multi-chain future. Its approach abstracts away the technical complexities of multi-chain interoperability, integrating cutting-edge technologies like zero-knowledge proofs, advanced consensus mechanisms, and a re-staking-driven architecture to ensure high performance, enhanced security, and cost-effectiveness. Adopting a cross-chain settlement protocol, it aims to leverage its high performance and fast finality chain capabilities fully.

According to data from NFTScan, as of August 27th, a total of 18,633 NFT assets have been issued on the Gravity Network, with 32 NFT Collections and 18,700 interaction records generated, involving 17,630 unique wallet addresses.

👉 Gravity NFTScan: https://gravity.nftscan.com/

Creating an NFTScan Developer Account

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

Sign Up - NFT API | NFTScan Developer Platform developer.nftscan.com

After logging in, find your unique API KEY on the Dashboard, and copy it. Access the API documentation, and enter your API KEY in the appropriate field. Following the guidance in the documentation, 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 record historical usage data. Moreover, NFTScan provides each registered developer with 1M CU of API call service to request all NFT API interfaces, and the CU never expires, until it’s used up!

Check Gravity NFT API Documentation

After successfully registering a developer account and obtaining an API Key, you need to review the NFTScan API documentation. The API documentation includes all available API endpoints, parameters, and detailed information on how to construct requests and handle responses. Please read the API documentation carefully and ensure you understand how to use the API to obtain the data you need. The NFTScan API service is dedicated to helping developers improve their experience in obtaining NFT data analysis.

Currently, NFTScan has the largest and most comprehensive NFT Collection database, supporting full NFT data from 25 blockchains, including Ethereum, Solana, BNBChain, Bitcoin, Mint, and more. The NFT data covered is comprehensive and diverse, providing a complete set of interfaces to obtain information on ERC721, ERC1155, ERC404, ERC6551 assets, as well as transactions, projects, and market statistics. It now supports over 60 public interfaces for EVM-compatible chains, as well as a batch of interfaces with the same model for Solana, Aptos, Bitcoin, and TON, largely meeting developers’ needs for indexing various types of NFT data.

Gravity NFT API Models

The main models include the following three API models, including an overall introduction and explanation of some core fields in the APIs, to help developers understand how to obtain data and utilize this information to serve the Dapp services they are building.

Assets API: “Assets” is the most critical data field in NFTs, used to uniquely identify and describe digital assets. Developers can gain a comprehensive understanding by extracting the “Assets” data of NFTs on Gravity blockchain and building relevant applications. The “Assets” object provides a unique identifier for digital assets and data throughout their entire lifecycle, providing a foundation for developers to understand and apply NFTs.

Transactions API: The transaction model represents the complete transaction data of an NFT asset on the blockchain, providing developers with the complete lifecycle transaction information of the NFT. This includes the NFT’s mint, transfer, sale, and other transaction activities, allowing developers to gain a deep understanding of the flow and evolution of the NFT asset within the Gravity ecosystem. NFTScan continuously aggregates information from various blockchain networks’ NFT transaction marketplaces and related transaction contracts. Currently, NFTScan has indexed data for tracking and understanding NFT market dynamics, which also helps developers build NFT-based applications and tools.

Collections API: NFTScan obtains off-chain data related to NFT Collections, such as descriptions, social media, and other basic information. NFTScan acquires this information through the APIs provided by the most popular NFT marketplaces across various blockchain networks. Additionally, the current floor price information is based on the centralized data of order information from NFT marketplaces, which is also accessible via APIs.

  • Get NFTs by account (Retrieve NFTs by wallet address)
  • Get all NFTs by account (Retrieve all NFTs owned by a wallet address, grouped by 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 use paged queries to retrieve all NFTs owned by that account address)
  • Get minted NFTs by account (Retrieve the Minted NFTs of the wallet address)
  • Get NFTs by contract (Retrieve NFTs by contract address, sorted by token_id in ascending order)
  • Get single NFT (Retrieve a single NFT)
  • Get multiple NFTs (Retrieve NFTs from multiple contract addresses simultaneously)
  • Search NFTs (This interface returns a list of NFT assets by applying search filters 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 NFT contract addresses with attributes. 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 an account address, grouped by contract address)

For example, we use Get NFTs by contract “/v2/assets/{contract_address}” to retrieve NFT details for a contract address, with the contract_address as the path parameter. In this case, we query the Galxe — OAT project.

  • Get transactions by account (This interface returns a list of NFT transactions for a wallet address)
  • Get transactions by contract (This interface returns a list of NFT transactions for an NFT contract address)
  • Get transactions by NFT (This interface returns a list of transactions for a single NFT)
  • Search transactions (This interface returns a list of NFT transactions by applying search filters in the request body)
  • Get transactions by address (This interface returns a list of NFT transactions filtered by transaction parameters)
  • Get transactions by hash (This interface returns transaction records queried by a list of transaction hashes)

For example, we use the Get transactions by contract interface “/v2/transactions/{contract_address}” to retrieve NFT transaction records for a contract address. The query parameters can optionally filter for NFT event types (Mint/Transfer/Sale/Burn), separated by ‘;’.

Similarly, here we retrieve the NFT transaction records for Galxe-OAT. Filtered by the Mint event type, the response data includes all key data for the Items Minted in this NFT Collection, such as transaction hash values, From and To addresses, block information, gas consumed, transaction timestamps, and other basic NFT transaction characteristic information.

  • Get an NFT collection (Query details by the contract address of a Collection, including an overview, Items categorized by description, holder distribution, average price, floor price, and other basic summary information)
  • Search NFT collections (This interface returns a list of Collection information by applying search filters in the request body. Collections are sorted by deployment block number in ascending order)
  • Get NFT collections by account (This interface returns a list of projects owned by a given account address. Collections are sorted by floor price from high to low)
  • Get NFT collections by ranking (This interface returns a list of projects with a given ranking field. Collections are sorted by the given ranking field and direction)

For example, we use the Get an NFT collection “/v2/collections/{contract_address}” to retrieve details for the address 0xcbe29f1a6685a90f68552988898baebb59ea4374, named Galxe-OAT:

  • Collection Statistics (This interface provides an overview of analytical statistics for an NFT Collection)
  • Collection Trade Distribution (This interface mainly provides the trade distribution of a project)
  • Collection Trending Statistics (Returns the Trading statistics ranking of a project)
  • Collection Holding Amount Distribution (This interface can return the holding amount distribution information for an NFT project)
  • Collection Holding Period Distribution (Returns the holding period distribution information for an NFT project)
  • Collection Blue Chip Statistics (Overview of Analytical Statistics for Blue Chip Collections)
  • Collection Blue Chip List (The list of Blue Chip Collections involved in the project, refer to NFTScan Blue Chip Collection)
  • Collection Top Holder (Distribution of the top holders for this Collection)

For example, we use the Collection Statistics “/v2/statistics/collection/{contract_address}” to return the analytical statistics overview for an NFT Collection. You can refer to: https://gravity.nftscan.com/0xcbe29f1a6685a90f68552988898baebb59ea4374

  • Account Overview Statistics (This interface returns overview statistics for an account address, refer to NFTScan Overview)
  • Account Holding Distribution (This interface returns the NFT holding distribution statistics for an account address, refer to NFTScan Portfolio)
  • Account Holding NFT Trending (This interface returns the NFT holding amount (or quantity) statistics for an account address, refer to NFTScan Portfolio)

This series of interfaces is typically used to obtain information related to data analysis and statistics on the NFTScan Gravity network, such as Trade Ranking, Mint Amount, etc. These interfaces allow developers or users to query, analyze, and retrieve statistics related to specific data sets or metrics. They can be used for various purposes, including market analysis, trend tracking, investment decisions, and understanding the nature of specific data.

  • Refresh NFT metadata
  • Refresh NFT metadata by contract

The Refresh Metadata interfaces can help developers or users submit background tasks to refresh metadata. After review, these tasks will refresh the metadata of the submitted specific Item or the entire contract.

  • Get the latest block number (Returns the latest block number reached by NFTScan)
  • Get the latest reorganization block numbers (Returns the latest reorganized block numbers)
  • Get NFT amount by account (Returns the number of ERC721 and ERC1155 NFTs owned by account addresses based on the search list in the request body)
  • Get NFT owners by contract (Returns a list of owners for an ERC721 NFT contract address, with NFTs sorted by token_id in ascending order)
  • Get owners by an NFT (Returns a list of owners for an ERC1155 NFT, sorted by account_address in ascending order)

Developers can use different languages to write code that calls the NFTScan API, such as Python, Java, JavaScript, etc. For example, in Python, you can use the requests library to initiate API requests; in JavaScript, you can use axios; in Java, you can use libraries like OkHttp or Retrofit. When writing the code, developers only need to organize the interface parameters, such as contract addresses, API Keys, etc., and call the corresponding NFTScan API, and they can conveniently obtain standardized JSON format data.

For example, we retrieve the NFT details for the contract address 0xcbe29f1a6685a90f68552988898baebb59ea4374, using the Get NFTs by contract with the path “/v2/assets/{contract_address}”. We send an HTTP GET request to access the NFTScan API, using the requests library in Python, and can construct the request like this:

import requests # Define the contract address and API path contract_address = '0xcbe29f1a6685a90f68552988898baebb59ea4374' api_url = f'https://api.nftscan.com/v2/assets/{contract_address}' # Set up the request headers, including the API key headers = { 'Authorization': 'Bearer your_api_key_here', # Replace with your API key 'Content-Type': 'application/json', } # Make the HTTP GET request response = requests.get(api_url, headers=headers) # Check the response status if response.status_code == 200: # Parse the response data nft_data = response.json() print(nft_data) else: print(f'Request failed with status code: {response.status_code}')

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, Mint 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

Comments

All Comments

Recommended for you

  • Lightchain AI announces testnet launch and completes $15 million in financing

    blockchain project Lightchain AI has announced the official launch of its testnet and has completed a $15 million financing round. The project's main technological innovations include the Proof of Intelligence (PoI) consensus mechanism and the AI Virtual Machine (AIVM). The PoI consensus mechanism is achieved by rewarding nodes to solve AI computing problems, while the AIVM provides developers with a toolkit to build AI applications on the blockchain. The project is currently in the final round of presale, and the funds raised will be used for technology development, infrastructure expansion, and talent recruitment. Lightchain AI plans to launch its mainnet in 2025 and will focus on developing enterprise-level decentralized AI solutions in the future.

  • Over 64.5404 million USD was liquidated in the past hour, mainly due to long orders

    According to data, in the past hour, the total liquidation amount of the entire network reached 64.5404 million US dollars, of which the liquidation amount of long positions was about 63.1007 million US dollars, and the liquidation amount of short positions was about 2.2016 million US dollars.

  • The State Council Tariff Commission: Additional tariffs will be imposed on some imported goods originating from the United States

    The State Council Tariff Commission issued a notice: with the approval of the State Council, tariffs will be imposed on some imported goods originating in the United States from February 10, 2025. A 15% tariff will be imposed on coal and liquefied natural gas, and a 10% tariff will be imposed on crude oil, agricultural machinery, large-displacement cars, and pickups. (Jinshi)

  • Japanese listed company Remixpoint increased its holdings by 30.83 BTC, bringing its total Bitcoin holdings to 509.33

    Japanese listed company Remixpoint announced on February 3 that it had released a "Notice of Additional Purchase of Cryptocurrency" on January 30, 2025, and passed a resolution to purchase a total of 2 billion yen (approximately $12.89 million) worth of cryptocurrency at a board meeting held on the same day. Based on the resolution, the company completed the purchase of the first 500 million yen (approximately $3.22 million) worth of cryptocurrency on January 31, 2025, including the addition of 30.83 BTC, bringing the company's total Bitcoin holdings to 509.33.

  • US spot Ethereum ETF had a net inflow of $83.54 million yesterday

    According to  TraderT monitoring shows that the net inflow of US spot Ethereum ETF was 83.54 million US dollars yesterday.

  • Yesterday, Fidelity Ethereum ETF had a net inflow of $49.7 million, while Bitcoin ETF had a net outflow of $177.6 million

    According to Farside monitoring, yesterday, the net inflow of Fidelity Ethereum ETF (FETH) was $49.7 million, while the net outflow of Bitcoin ETF (FBTC) was $177.6 million.

  • GOAT Gaming, the AI ​​gaming network on Telegram, completes $4 million in strategic financing

    According to official sources, AI game network GOAT Gaming on Telegram announced the completion of a $4 million strategic financing round, led by TON Ventures, Karatage, Amber Group, and Bitscale Capital. This financing round brings the total funding for Mighty Bear Games, the game studio behind the game, to $15 million.

  • Thailand SEC plans to launch tokenized securities trading system

    According to a report from the Bangkok Post on February 3, Jomkwan Kongsakul, Deputy Secretary-General of the Thai Securities and Exchange Commission, stated that token investment is increasingly being taken seriously, and regulatory agencies will allow securities companies to trade digital tokens to leverage their large investor base. Jomkwan Kongsakul said, "The SEC is using technology to improve the efficiency of the capital market by promoting the electronic securities ecosystem," adding, "New regulations will be introduced to promote the issuance of electronic securities and online purchase of bonds," which are medium- to long-term debt instruments that large companies use to borrow money.

  • BTC falls below $96,000

    The market shows that BTC has fallen below $96,000 and is now trading at $95,909.85, with a 24-hour drop of 5.26%. The market is volatile, so please be prepared for risk control.

  • The total market value of AI agent tokens falls below $10 billion

    According to CoinGecko data, the total market value of AI agent token sector is currently reported at 9.68 billion US dollars, with a 24-hour decline of 0.8% and a 24-hour trading volume of 1.231 billion US dollars, as reported by Jinse Finance.