Get nft floor price

Can you check the floor price on an ERC1155 collection using moralis?

Check this out

You can get the lowest traded price in the past X days - check Web3 API

Hi Cedro, is it possible to get floor price for a collection? I went through the link, I couldn’t really see/find how to do this

yes you can using:

var options = {
address: ‘0x…’, // address of token contract
chain: ‘eth’, // chain of tokens

floor = await Moralis.Web3API.token.getNFTLowestPrice(options);

The default is to check the lowest sale price over the past 7 days. If you need to adjust this, add:

days: x // the number of days as an int

to the options

Thanks @DegenDeveloper, that all worked, I can’t seem to get price for below 4 days, is this a free tier limitation or??? Is there a way to get current floor price?

Hi can you post an example of your API call? No that’s not a limit with a free plan.

curl '<URL>/server/functions/getNFTLowestPrice' \
  -H 'authority:<URL>' \
  -H 'accept: application/json' \
  -H 'accept-language: en-IE,en;q=0.9,it-IT;q=0.8,it;q=0.7,en-US;q=0.6' \
  -H 'content-type: application/json' \
  -H 'dnt: 1' \
  -H 'origin: http://localhost:4000' \
  -H 'referer: http://localhost:4000/' \
  -H 'sec-fetch-dest: empty' \
  -H 'sec-fetch-mode: cors' \
  -H 'sec-fetch-site: cross-site' \
  -H 'user-agent: Mozilla/5.0 (Linux; Android 11; Pixel 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.91 Mobile Safari/537.36' \
  --data-raw '{"chain":"eth","marketplace":"opensea","address":"0x656b9e24de2e41a94a7dbbaeb3937777cf34e448","days":4}' \

Sample Curl taken from browser. The moment i change “days” to 1-3 i get back…

{"code":141,"error":"Could not get NFT lower Price"}

This happens for all NFTs I’ve tried from a few public addresses.