How to get NFT floor prices

Floor prices indicate the lowest possible purchase price of an NFT within a given collection, or the lowest possible purchase price for a specific NFT. Mnemonic’s NFT Marketplace API enables you to look up real time floor prices by collection or by NFT.

This is extremely useful information to surface for multiple purposes. For example, you might want to show the current floor price across all marketplaces for a collection to help collectors find and act on deals. Or, you might want to display the real time floor prices for all the collections held by a given user in a portfolio view.

In this tutorial, we’ll explore the methods you can use to get floor prices with Mnemonic’s API, share a few examples, and provide a few tips along the way. This is a beginner-friendly tutorial. You will need a Mnemonic API key to get started.

Let’s jump in!

Look up the floor price of a collection with GetFloorPrice

You can use the GetFloorPrice endpoint to look up the floor price for an entire collection, or for a specific NFT.

This endpoint has only one required parameter, the contract ID (or ENS name) of the collection you’re looking up. However, if you’re researching the floor price of a specific NFT within a collection, you will also need to include the tokenId of the NFT in your query.

Here’s how our query to look up floor prices for BFF’s YOU collection:

curlNode.js
Copy
Copied
curl -L -X GET 'https://ethereum-rest.api.mnemonichq.com/marketplaces/v1beta2/floors/0x3e6046b4d127179f0a421F3148B43cf52c08Fc41' \
-H 'X-API-Key: YOUR_API_KEY_HERE'
Copy
Copied
var request = require("request");

var options = {
  method: "GET",
  url: "https://ethereum-rest.api.mnemonichq.com/marketplaces/v1beta2/floors/0x3e6046b4d127179f0a421F3148B43cf52c08Fc41",
  headers: {
    "X-API-Key": "YOUR_API_KEY_HERE"
  }
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Below, you can see the response to the above request:

Copy
Copied
{
    "price": {
        "totalNative": "0.0442",
        "totalUsd": "72.54303064099386802",
        "fungibleAddress": "",
        "fungibleValue": "0"
    }
}

Before we jump into adding in the tokenId parameter to look up a specific NFT’s floor price, let’s review what you see in the response above.

  • totalNative: Indicates the value of the current floor price in the native token for the chain (i.e. Eth for Ethereum and MATIC for Polygon)
  • totalUsd: Indicates the value of the current floor price converted to USD at the conversion rate of the time of the event.
  • fungibleAddress: In cases where the floor price is in a token other than the native (eth or MATIC) token, shows the contract address of the token.
  • fungibleValue: Shows the floor price value of the fungible token, if relevant.

So, in the above response, the current floor price for BFF's YOU collection is .044 ETH, which at the time of this query, is equivalent to $75.54 USD.

How to get the current floor price of an NFT

Above, we demonstrated how to look up the floor price for a collection. Now, let’s add the tokenID parameter into our request to get the floor price for a specific NFT.

In this example, we’ll look up the current floor for a BAYC (contract address: 0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D) NFT (let’s use token number 5955 because it has a cool skeleton shirt).

Here’s what the query would look like:

curlNode.js
Copy
Copied
curl -L -X GET 'https://ethereum-rest.api.mnemonichq.com/marketplaces/v1beta2/floors/0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D?tokenId=5955' \
-H 'X-API-Key: YOUR_API_KEY_HERE'
Copy
Copied
var request = require("request");

var options = {
  method: "GET",
  url: "https://ethereum-rest.api.mnemonichq.com/marketplaces/v1beta2/floors/0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D?tokenId=5955",
  headers: {
    "X-API-Key": "YOUR_API_KEY_HERE"
  }
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

And here is what the results look like for the example above:

Copy
Copied
{
    "price": {
        "totalNative": "81.0526",
        "totalUsd": "133027.17749620406305606",
        "fungibleAddress": "",
        "fungibleValue": "0"
    }
}

Getting floor prices for Polygon NFTs

In the code samples above, we looked up floor prices for digital assets on Ethereum. In order to get floor prices on Polygon collections and NFTs, all you need to do is change the host name in your request to match the chain.

Conclusion

Now you know how to look up the floor price of a collection or individual NFT on Polygon or Ethereum using Mnemonic’s Marketplace API. Getting real time floor prices is super handy if you’re creating a marketplace, NFT wallet/portfolio, or a trading insights tool.

The Marketplace API supports not only floor prices, but also bids & offers, and listings.

We love feedback here at Mnemonic! After you’ve completed this tutorial, let us know about your experience or share feedback by tagging us on Twitter @mnemonichq or reaching out directly to us at support@mnemonichq.com!