CORS error popping up all over opensea
Hi, was there a recent tweak that is resulting in the following errors on the server end?
/blog/wp-json/wp/v2/posts?_fields=title,jetpack_featured_media_url,link&categories[]=86&per_page=6&order_date:1 Failed to load resource: the server responded with a status of 403 (Forbidden) opensea.io/:1 Access to fetch at 'https://api.opensea.io/graphql/' from origin 'https://opensea.io' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled. api.opensea.io/graphql/:1 Failed to load resource: net::ERR_FAILED opensea.io/:1 Access to fetch at 'https://api.opensea.io/graphql/' from origin 'https://opensea.io' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled. api.opensea.io/graphql/:1 Failed to load resource: net::ERR_FAILED
Hi @mongodillo did you find a workaround ? I encountered this error too
Any luck with this? I'm getting a cors error in production for only the collections endpoint. This one https://docs.opensea.io/reference/retrieving-collections.
I just encountered this problem, can anyone help me?
I am having the same issue in my react app. I added proxy to my package.json, but it did'nt helped . If you have any solution please share.
could not find a workaround so I used a google cloud function to make the fetch calls also if you are coding on a SSR (next/nuxt etc) app you can fetch on server side
I am having the same issue in my react app. I added proxy to my package.json, but it did'nt helped . If you have any solution please share.
On google you can find multiple articles about this issue, it's not caused by the API but from your requests, an easy workaround as you mentioned react is to request on server side, for example with an API Wrapper made with express.js
OpenSea website is not loading for me. I was getting CloudFlare 1020 error. Then all of a sudden I am no longer able to retrieve date from api.opensea.io.
I have the same issue today Access to fetch at 'https://api.opensea.io/wyvern/v1/orders/post/' from origin 'https://mydomain.vercel.app' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
Please help
@huyredfox Here's the solution Hoping it helps.
The solution @lewis-kori provided is a good way to fix this.
Also, please make sure you are using a valid api key and check this. It might be a problem with your requests. It says that it failed from the access control (CORS) header on the request.
Add the following to the options variable to your fetch statement to resolve :
const proxyUrl = 'https://cors-anywhere.herokuapp.com/';
const options = {
method: 'GET',
headers: {
Accept: 'application/json',
'X-API-KEY': APIkey,
},
proxy: proxyUrl,
};