CORS issue
Access to XMLHttpRequest at 'https://testnets-api.opensea.io/assets?asset_contract_address=0xF42029DD93A9B20805152b804114380d6acba959&order_direction=asc' from origin 'http://localhost:3001' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Facing the same issue.
Seems like they're ignoring this issue for some reason. I raised the same here in another similar open issue
This isnt a problem with the api, this is a problem with your requests. It says exactly that it failed from the access control (CORS) header on the request. See this
Help me with solutions@noahlozevski
They ignore the issue because it's not an issue caused by them, but caused mainly by how you've setup the request, for more information search on stackoverflow or on google in general: "CORS Access Control Allow Origin"
@Iroh-Omolola I found two solutions to this but they aren't very straightforward.
- if you're using nextjs/nuxtjs you could make those API calls server-side through
getServerSidePropsorasyncDatarespectively - you can also move your API calls to a backend server. In my case, I made a HTTP client using python so I call opensea using that and relay the results to my frontend.
check out this StackOverflow answer to understand the cors error.
Thank you all.