ProjectOpenSea / opensea-js

TypeScript SDK for the OpenSea marketplace
https://docs.opensea.io/reference
MIT License
2.28k stars 956 forks source link

Can we use opensea graphql for getting assets with query? #71

Closed prodvdjin closed 2 years ago

prodvdjin commented 3 years ago

If I check query on following playground, it works. https://api.opensea.io/graphql

But if I integrate the graphql on my next.js project, it does not work. Can we find a way to use the graphql on our customized projects?

prodvdjin commented 3 years ago

@alexanderatallah @taylorjdawson @DJViau Please help me on this issue.

nikkaroraa commented 3 years ago

I'm interested to know this as well.

KhaledBinAmir commented 3 years ago

I have tried to query top NFTs but their cloudflare firewall stops accessing the graphql endpoint. There is no way I found in REST to get top NFTs, the /collection endpoint does not support sorting.

hashgarage commented 3 years ago

I'm struggling with the same issue. The weird thing is it works from postman, but not from cURL or any other way I tried to make the request

imbyoe commented 3 years ago

same issue here, let me know if anyone finds a work around

sfichera commented 3 years ago

I'm having this same issue with python... can't bypass cloudflare :-(

JustroX commented 3 years ago

Same issue here. Any updates on this?

warneracw21 commented 2 years ago

Any updates? I am able to use the graphql API flawlessly in Graphiql, but not from any application

artyrcheek commented 2 years ago

Same issue here, the REST api isn't great...

artyrcheek commented 2 years ago

@eth0izzle s comment on #66 May be useful to some people

joventuraz commented 2 years ago

Is this not accesible anymore?

arcticmatt commented 2 years ago

https://api.opensea.io/graphql doesn't work for me, I get an "access denied" error

bboynton97 commented 2 years ago

+1 would like access to this

efthymios1991 commented 2 years ago

Did anyone managed to make this work?

efthymios1991 commented 2 years ago

I'm struggling with the same issue. The weird thing is it works from postman, but not from cURL or any other way I tried to make the request

How did you manage to make this work on postman?

joventuraz commented 2 years ago

I'm struggling with the same issue. The weird thing is it works from postman, but not from cURL or any other way I tried to make the request

How did you manage to make this work on postman?

Opensea does not allow a different origin than theirs to access their graphql anymore

sfichera commented 2 years ago

Sup guys how are u? All I wanted to do was to take a snapshot of current holders for my OS (OPENSTORE) collection... So i've ended up using free account at "moralis.io" in order to get the info I was trying to get with the graphQL... I've used "/api/v2/nft" endpoint... Hope this helps! 👍

bboynton97 commented 2 years ago

I ended up using a python script and selenium to automate my browser and click through the listing of all my tokens. It's very unfortunate that it was the only option.

pmosse commented 2 years ago

Hey @bboynton97, would you mind sharing the script? I would really appreciate it as I need to implement something similar until OpenSea releases the API for Polygon.

pmosse commented 2 years ago

Hey @sfichera, could you share the complete URL of the API that you used? Do you know of any way to access information about an asset that is in Polygon instead of Ethereum, at OpenSea? Thanks!

bboynton97 commented 2 years ago

Hey @bboynton97, would you mind sharing the script? I would really appreciate it as I need to implement something similar until OpenSea releases the API for Polygon.

I was feeling helpful, so I made the script more generalized and included it in this gist

sfichera commented 2 years ago

Hi @pmosse here's the python script i've created just take a look to lines 15 to 20 to set your collection slug, total items and moralis api properly... The script just create a csv file with 2 columns: token id and holder address, hope it helps!

take_og_storefront_snapshot.py.zip

pmosse commented 2 years ago

Thanks @sfichera ! From what I see, this uses OpenSea's API as well. Do you know if this would work with Polygon assets? As OpenSea doesn't have any API for Polygon network... I am trying to use Graphql directly and I managed to make that work locally (copying the same headers and keys that OpenSea's page use when they use their own Graphql) but not from as server (I get a 403).

ctohster commented 2 years ago

Seems that they don't want you to be able to access the data. Best option would be to web scrape it

mwmwmw commented 2 years ago

If you can access it via python, node, etc. The you just need a cloud function or something similar to grab the data.

I get a 403, so perhaps you need one of the coveted API keys to do so.

aun-shahbaz-awan commented 2 years ago

https://rinkeby-api.opensea.io/graphql/ will work for rinkeby-testnet

vasinl124 commented 2 years ago

+1

CastilloLuis commented 2 years ago

same request here, do we have any update about this? web-scraping could work but isn't the best solution imo. I'm wondering if this can be accessible by a subgraph. I would like to query opensea's collection in order to explorer by any [key] given

matthewklinko commented 2 years ago

I can access the graphql without issues

MarkMoranNZ commented 2 years ago

I can access the graphql without issues

.

omareldamiry commented 2 years ago

I can access the graphql without issues

@matthewklinko How?

matthewklinko commented 2 years ago

I can access the graphql without issues

@matthewklinko How?

check out https://rapidapi.com/openseatools/api/opensea15/

surikata commented 2 years ago

I get 'You are not allowed to use this resource.' error, do you know why? is it still working for you? Can you make offers through eh graphql?

MuhammadMinhaj commented 1 year ago

Has anyone managed to access the polygon API in open-sea?