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

  • SEC and CFTC Update Crypto FAQs: Token Buybacks and Network Upgrades Not Necessarily Securities, CFTC Allows On-Chain Record Keeping

    On September 26, the U.S. Securities and Exchange Commission's Division of Corporation Finance released an updated FAQ on September 25, clarifying that token buybacks, network upgrades, and marketing statements do not automatically make crypto assets securities. SEC staff noted that announcing a buyback plan for an operational crypto network does not, by itself, make the associated tokens investment contracts; however, if the network is not operational and the issuer promotes the buyback as a source of returns for holders, it may be a different case. The FAQ also clarified that services provided once a crypto system is operational, aimed at securing, maintaining, improving, or enhancing the system or its functions, or promoting network effects, do not constitute managerial efforts under the Howey test. Marketing existing uses of the network typically does not create profit expectations, and statements about future functionalities do not either, provided there is no promotion of profit potential. This update reiterates that conclusions will still heavily depend on specific cases and are based on the SEC's interpretative release regarding the applicability of securities laws to crypto assets issued in March this year. On the same day, the Commodity Futures Trading Commission updated its crypto FAQ, allowing futures firms and clearinghouses to invest customer funds in tokenized versions of previously permitted assets, provided they meet investment and custody requirements. CFTC staff also indicated that regulated companies may use blockchain for record keeping but must still be able to provide records if the blockchain or its block explorer is non-operational. These updates come as the CLARITY Act failed to advance in the Senate, with regulators continuing to push forward with the crypto regulatory framework based on existing laws.

  • BTC Surpasses $84,000

    Market data shows that BTC has surpassed $84,000, currently priced at $84,004, with a 24-hour decline of 0.25%. The market is experiencing significant volatility, so please ensure proper risk management.

  • BTC Falls Below $84,000

    Market data shows that BTC has fallen below $84,000, currently priced at $83,988.06, with a 24-hour increase of 0.52%. The market is experiencing significant volatility, so please ensure proper risk management.

  • ETH Falls Below $2700

    Market data shows that ETH has fallen below $2700, currently priced at $2699.7, with a 24-hour increase of 1.95%. The market is experiencing significant volatility, so please ensure proper risk management.

  • BTC Surpasses $85,000

    Market data shows that BTC has surpassed $85,000, currently priced at $85,000.02, with a 24-hour increase of 1.72%. The market is highly volatile, so please ensure proper risk management.

  • ETH Surpasses $2700

    Market data shows that ETH has surpassed $2700, currently priced at $2700.14, with a 24-hour increase of 1.23%. The market is experiencing significant fluctuations, so please ensure proper risk management.

  • Yushu Technology's Wang Xingxing: Key to Breakthrough in Embodied Intelligence Lies in Solving Millimeter-Level Error Issues

    On September 25, the 5th Global Digital Trade Expo was held in Hangzhou, where Wang Xingxing, founder of Yushu Technology, delivered a keynote speech titled "From Machinery to Intelligence - The Evolutionary Theory of Embodied Future." Wang stated that the embodied intelligence industry may soon experience a critical breakthrough similar to that of ChatGPT. He believes that when robots can complete approximately 80% of tasks through voice interaction and embodied intelligence capabilities in about 80% of unfamiliar environments, the industry will enter a critical phase of large-scale application. He pointed out that the ability for robots to understand and execute specific tasks based on voice commands has already made breakthroughs last year, but the industry still faces a core technological bottleneck, namely the precise matching issue between artificial intelligence models and the real physical world. Wang noted that currently, robots still have a few millimeters of error during actual operations, which limits their stability and reliability in complex environments. "In the future, whoever can solve this problem will fundamentally resolve the issues with robots."

  • Swissquote Analyst Warns AI Narrative is a Core Pillar of US Stocks, Potential Break Could Trigger Significant Correction

    On September 25, Ipek Ozkardeskaya, a senior analyst at Swissquote Bank, stated that broad market indices and retirement funds are now deeply tied to the AI wave, with technology stocks accounting for about 40% of the S&P 500 index. She pointed out that the market capitalization weight of just three chip manufacturers makes up over 25% of the MSCI Emerging Markets Index. Ozkardeskaya indicated that AI has become the 'core pillar' of the market, and this pillar 'must not show any cracks.' She believes that, in the short term, the US stock market will continue to be supported by seasonal factors, and the current market uptrend may extend until the end of the year. However, she also warned that the worst-case scenario would be a shake in the investment logic surrounding AI, which could undermine market confidence in the AI narrative, potentially triggering a significant market correction.

  • U.S. Stock Index Futures Turn Positive; Chip Stocks Rally in After-Hours Trading

    On September 25, U.S. stock index futures rose into positive territory, with Nasdaq futures up 0.36%. In after-hours trading, storage and semiconductor stocks saw widespread gains, with AMD, Intel, and SanDisk all rising by 2%.

  • NEAR Partners with Ondo to Launch 20 Tokenized US Stocks and ETFs

    On September 25, according to Cryptonews, NEAR Protocol and Ondo Finance have launched trading for tokenized US stocks and ETFs on near.com, with an initial offering of 20 assets including Nvidia, Tesla, Apple, Microsoft, Amazon, as well as SPY and QQQ. Eligible users can deposit using over 30 supported stablecoins or other crypto assets, with NEAR Intents serving as the cross-chain distribution layer, allowing similar assets to be routed to connected wallets and DeFi protocols in the future. Purchases are settled in USDon, which is backed 1:1 by US dollars in brokerage accounts, and completed via atomic swaps. This product is not available to US persons; the overall Ondo platform has launched over 100 assets, with NEAR initially offering only one-fifth of that.