How to display a list of listings?
Reminder, a listing is:
An Asset that is currently being sold on the primary market
Or a token that is currently being sold on the secondary market
Use case
Say you are making fantasy football video game : you want to be able to display to your End Users all the current listings (example: all the listings from the “Players” collection, on the primary market only).
In your user journey, you can display to your End Users all the current listings, but with specific filters like: a specific market (primary or secondary market), a specific collection (“Players” for example), etc.
If you want to display the list of all NTFs that are currently for sale for this specific End User, you need to call the endpoint, for each
assetId
to check one by one if the NFT is for sale (so if there are 5assetId
, you need to call 5 times the following endpoint).When calling this endpoint, you will need to query the following parameters:
assetId
marketType
:SECONDARY
state
:COMING_SOON
orLIVE
mine
:true
For a given asset, if the response from the endpoint gives result, it means the token is for sale.
API
Here is the link to the API documentation to display a list of all listings, with specific filters:
https://sandbox.nfts.eniblock.fr/redoc/listings-trades#operation/getListings