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

Rest API RESPONSE for collections: offset – ensure this value is less than or equal to 50000

Open JohannesHoppe opened this issue 5 years ago • 11 comments

I found a bug in the REST API and this seems to be the best place to write an issue.

Try this in your browser:

fetch('https://api.opensea.io/api/v1/collections?offset=' + 50000 + '&limit=300', {method: 'GET'})
  .then(response => response.json())
  .then(x => console.log(x));

You get a response with 300 collections, so there must be more.

Now this:

fetch('https://api.opensea.io/api/v1/collections?offset=' + (50000+1) + '&limit=300', {method: 'GET'})
  .catch(err => console.error(err));

RESPONSE:

{"offset":["ensure this value is less than or equal to 50000"]}

So the huge amount of collections has hit an internal limit of the API. That value must be increased.

JohannesHoppe avatar Oct 21 '21 20:10 JohannesHoppe

Same issue here

mixeden avatar Oct 25 '21 10:10 mixeden

any solution for this? Where is the best place to get all the slugs ?

SourceSafe avatar Feb 01 '22 12:02 SourceSafe

Certainly not on this Web 2.5 platform. LooksRare is also supposed to be nice...

JohannesHoppe avatar Feb 01 '22 12:02 JohannesHoppe

Thanks for bringing this up to us! We are looking into this.

esteban-OpenSea avatar Apr 18 '22 20:04 esteban-OpenSea

still seems to be an issue 😕

passabilities avatar Dec 01 '22 07:12 passabilities

Thanks for bringing this up to us! We are looking into this.

@alexanderatallah @esteban-OpenSea @JoshuaSchmidt-OpenSea One year has passed... What is the reason that this still is a issue?

labralords avatar May 11 '23 19:05 labralords

Unfortunately, this is a limitation of the current v1 implementation because the offset is not performant at high values. The plan is to build a more sensible, and scalable, implementation for V2 and eventually deprecate this endpoint.

thenerdassassin avatar Jun 27 '23 21:06 thenerdassassin

After how many years?!

JohannesHoppe avatar Jun 28 '23 05:06 JohannesHoppe

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. If you believe this was a mistake, please comment.

github-actions[bot] avatar Aug 28 '23 00:08 github-actions[bot]

This feature is in active development and should be announced in the near future. Make sure to follow the API changelog to be updated when the V2 collections endpoint is released.

thenerdassassin avatar Sep 07 '23 23:09 thenerdassassin

v1 api is now deprecated, being removed next week, see our V2 APIs which should have this pagination issue fixed with next cursors.

ryanio avatar Dec 08 '23 00:12 ryanio