'Find Floor Of Opensea NFT
Is there a way to get the floor price thats displayed on the main page of an NFT collection?
Here you see the floor price is 5.75 but if I query the contract using the Opensea api:
url = "https://api.opensea.io/api/v1/asset/0x1cb1a5e65610aeff2551a50f76a87a7d3fb649c6/1/"
response = requests.request("GET", url)
print(response.text)
I get a floor of:
So it seems as though the api is a little off. Was just curious if anyone here knows of a better way to get a more accurate floor price?
Solution 1:[1]
I have no idea why this works, but...
https://api.opensea.io/collection/${slug}
slug
= the collection slug (name in URL).
For reference, I found this in some random other library's documentation... But it seems to work
Solution 2:[2]
Floor price is for collections (contracts). Opensea api does have a collections endpoint but it can't filter by anything except owner address. So you have to know the address of someone why owns a token I guess, which seems pretty retarded.
Also you can get the owner of a token from the assets endpoint which can filter by contract address and token id.
Solution 3:[3]
In the documentation it shows how the API works
https://api.opensea.io/api/v1/collection/doodles-official/stats
This returns all the stats. So change the name of the collection to the one you want and that's it.
Solution 4:[4]
In case anyone was still looking, it looks like OpenSea added a new endpoint that more accurately tracks floor price:
https://docs.opensea.io/reference/retrieving-collection-stats
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Roxkstar74 |
Solution 2 | pguardiario |
Solution 3 | msqar |
Solution 4 | wjvukasovic |