Calculating the value of your users’ NFT portfolios just got a lot easier with SimpleHash’s API. SimpleHash offers an easy-to-use REST API that allows you to get the latest sale prices of individual NFTs across different marketplaces, as well as the floor price for any given NFT collection. In this tutorial, we’ll show you how to make requests to the SimpleHash API to calculate the value of user portfolios.
Before we get started, you’ll need to sign up for a SimpleHash API key. You can do this by visiting the SimpleHash developer portal. This takes less than 2 minutes, and once you have your API key, you’re ready to start making requests.
If you’re building a wallet-related application, SimpleHash provides two main API endpoints that make this easy. These both assume you have access to the public wallet addresses of your users.
Regardless of the endpoint you use, you’ll still be able to calculate the real-time value of your users’ portfolios using the data provided in the responses.
If using NFTs by Wallet(s), in the responses, you’ll receive a set of NFT model objects representing the individual NFTs held by the queried-for addresses. These objects will contain both last_sale and collection sub-objects, the latter of which includes floor prices.
If using Collections by Wallet(s), you’ll receive a truncated version of the collection object that also includes floor prices.
What is a last_sale? On the SimpleHash platform, we include full sale data for transactions across multiple chains and NFT marketplaces. The last_sale is the most recent sale for a given NFT. Historical sales can be obtained by querying the SimpleHash “Sales & Transfer by…” series of endpoints.
What is a floor price? An NFT collection floor price is the lowest price at which a collection of NFTs is expected to sell. It is based on the individual sale prices of each NFT in the collection and is used as a reference point for determining the overall value of the collection. The floor price is often calculated using market data and trends, as well as the rarity and demand for the specific NFTs in the collection. On the SimpleHash platform, we provide real-time data on floor prices across multiple different chains and NFT marketplaces.
Depending on your use case, you now have different options for calculating the user’s portfolio value.
Most other SimpleHash API endpoints in addition to the two mentioned above also include the collection bodies, including the floor prices as needed for other use cases.
In addition, for real-time updates, developers can subscribe to the collection floor_price_update event using the SimpleHash webhook platform – which can be used to keep portfolio values as up to date as possible.
In this guide, we learned multiple approaches for calculating the portfolio of a user’s NFTs in the wallet(s), using the most recent sale data, and floor prices of NFT collections. Calculating the value of your users’ NFT portfolios is now as simple as querying a few endpoints. If you have any trouble following this guide, or with obtaining this kind of data, please feel free to reach out at email@example.com, or to jump into our community telegram group.
SimpleHash provides access to all NFT data across 18 chains. We power NFTs for leading web3 players like Phantom and Rainbow. Using our API and webhooks, developers can get real-time metadata, media, transaction history, sale data, floor prices and ownership insights in just a few lines of code.SimpleHash is backed by leading industry players, such as Y Combinator, OpenSea Ventures, and Coinbase Ventures.
Learn how to integrate NFTs into your Web3 application using the SimpleHash API. We'll cover the core steps for accessing and utilizing NFT data from multiple blockchains and marketplaces through a single interface.