You mentioned using node-fetch but the error you’re getting reads to me as a client browser error, could you clarify where this code is running?
If it’s node-fetch on the server I’m afraid I don’t really know how to help. On the client side though, CORS is a browser specification that prevents client side JavaScript from fetching resources from origins that differ from the user’s current origin unless the server hosting the requested resource explicitly permits it.
CORS is a confusing standard, I’d recommend the Mozilla Developer Docs to learn more of the specifics:
https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
As it relates to your project, if this is client side code, there’s not a lot you can do. It appears as though the third party resource you’re querying has enabled CORS and that your domain is not approved. The Fetch API allows for opaque requests which ignore CORS but you wouldn’t be able to use .json()
on the response, among other limitations. There are services that allow you to route a CORS bound request through a server that removes the CORS limitation but that’s not a viable approach in all scenarios.