opensea-js icon indicating copy to clipboard operation
opensea-js copied to clipboard

No way to access all assets listed for sale from a given contract?

Open gwendall opened this issue 5 years ago • 19 comments

I need to list all the tokens for sale from a given contract - both individual tokens and bundles. Has anyone built something similar through the opensea api ?

I have done a couple of unsuccessful attempts:

  • the /assets endpoint doesn't allow to filter for assets for sale, only the /bundles endpoint does
  • the /orders endpoint only works for a specific token, not for the entire contract tokens

gwendall avatar Jun 08 '21 10:06 gwendall

Have you managed to list all assets for a specific contract address? I tried the /assats endpoint, but sadly Offset cannot exceed 10000.. I tried incrementing the token_id, but sadly not all collections have counting token_ids.

brandsimon avatar Aug 01 '21 14:08 brandsimon

@brandsimon is correct as far as I can tell, there is no way to access all information whether it be Assets or Collections ("Offset cannot exceed 50000")

This is pretty critical as it makes it impossible to get all assets for many projects with > 10,000 items as well as to gather information on any collection without knowing the asset_owner once 49,999 collections have been created after said collection

Alx-AI avatar Aug 09 '21 23:08 Alx-AI

Hello @AlxDfy I have gone through your above comments. But still, I want to know that how to use the offset parameter to get data more than 10000 NFT via Opensea API ? OR there is no way to fatch more the 10k NFTs from Opensea API ?

TechforceG avatar Sep 11 '21 17:09 TechforceG

You can use the ID parameter to get all assets in a collection but for collection, the 50,000 cap is a hard limit as far as I've seen.

REALLY annoying @alexanderatallah

Alx-AI avatar Sep 11 '21 18:09 Alx-AI

Thanks for the Reply @AlxDfy

So, Considering Offset 10,000 AND capped 50 means 50K will be the Max limit to get NFTs from Opensea API?

Correct me If I am wrong @AlxDfy @alexanderatallah

TechforceG avatar Sep 11 '21 18:09 TechforceG

If you're talking assets, you can increment indefinitely by token_ids but if the project numbered the assets differently it would mess up your scraping. Otherwise, the offset is capped at 10k. I believe it is the same for events.

If you're talking collections, the offset is capped at 50k,

Alx-AI avatar Sep 11 '21 18:09 Alx-AI

Linking this issue to https://github.com/ProjectOpenSea/opensea-js/issues/255 😄

gsmachado avatar Nov 25 '21 00:11 gsmachado

@TechforceG You can use the sorting parameters to get more than 10k results. The default is desc where you will get 10k; do the same with asc and you will get another 10k (if there are at least 20k results). You can then use sale_date, sale_count and sale_price with both desc and asc. It's not a perfect solution but it will help to get more than 10k results. I hope this helps

chaim6888 avatar Jan 31 '22 08:01 chaim6888

Seriously, this is such a quick implementation on their API's side and it's appalling nobody even cares about addressing any issue. Can we get this resolved? Querying (even with a limit) a collection's assets and sorting the result by current fixed sale price has to be a must for so many projects.

blessedbythestorm avatar Feb 13 '22 18:02 blessedbythestorm

We hear your feedback and working on improving it!

esteban-OpenSea avatar Mar 30 '22 22:03 esteban-OpenSea

it would be great if we can move this API to cursor based pagination + accepting a collection slug instead of contract_address + token_id

its really painful to sync the asset orders currently

dpenacton avatar Apr 03 '22 18:04 dpenacton

+1 any news ?

Philigane avatar Apr 10 '22 14:04 Philigane

+1 , I'm currently looking at writing a scraper here to get all listed prices now bc this functionality does not exist on the current API, or trying to figure out how to access the graphql endpoint. This has to be a need by so many people trying to integrate with OS.

dnilosek avatar Apr 21 '22 17:04 dnilosek

+1 , I'm currently looking at writing a scraper here to get all listed prices now bc this functionality does not exist on the current API, or trying to figure out how to access the graphql endpoint. This has to be a need by so many people trying to integrate with OS.

If i can help you my workaround is this one : Do a first check with a puppeter for getting all listed assets with your requirements.

Then start a thread which check events endpoint to see if there is any listing.

Philigane avatar Apr 21 '22 20:04 Philigane

+1

emorling avatar Apr 21 '22 22:04 emorling

+1, would be great to just get the list of all active listings, which can be ordered by timestamp or id

Genry1 avatar May 08 '22 19:05 Genry1

+1 , I'm currently looking at writing a scraper here to get all listed prices now bc this functionality does not exist on the current API, or trying to figure out how to access the graphql endpoint. This has to be a need by so many people trying to integrate with OS.

If i can help you my workaround is this one : Do a first check with a puppeter for getting all listed assets with your requirements.

Then start a thread which check events endpoint to see if there is any listing.

I wrote a scraper but scraping OS is a little tricky do to how items dynamically load to the page on scrolls. @dnilosek I'll share some code when I get home if you need insight.

krjii avatar May 08 '22 19:05 krjii

+1 , I'm currently looking at writing a scraper here to get all listed prices now bc this functionality does not exist on the current API, or trying to figure out how to access the graphql endpoint. This has to be a need by so many people trying to integrate with OS.

If i can help you my workaround is this one : Do a first check with a puppeter for getting all listed assets with your requirements. Then start a thread which check events endpoint to see if there is any listing.

I wrote a scraper but scraping OS is a little tricky do to how items dynamically load to the page on scrolls. @dnilosek I'll share some code when I get home if you need insight.

@krjii would be great if you could!

Genry1 avatar May 08 '22 19:05 Genry1

Pagination past 10k is not yet supported

I will go ahead and close this issue since it's a duplicate. Please follow this ticket for the latest updates on this issue: https://github.com/ProjectOpenSea/opensea-js/issues/438

esteban-OpenSea avatar Jun 16 '22 19:06 esteban-OpenSea