Blocked by CORS policy
dutta-alankar opened this issue · 1 comments
dutta-alankar commented
I'm using the example script at https://ipapi.co/api/?javascript#complete-location5 to use ipapi with javascript. But I get the following error. How do I fix this?
Access to fetch at 'https://ipapi.co/8.8.8.8/json/' from origin 'null' 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.
visitor-test.html:52
GET https://ipapi.co/8.8.8.8/json/ net::ERR_FAILED 403 (Forbidden)
script used:
fetch('https://ipapi.co/8.8.8.8/json/', )
.then(function(response) {
response.json().then(jsonData => {
console.log(jsonData);
});
})
.catch(function(error) {
console.log(error)
});
ipapi-co commented
Can you please message our support team to get this resolved.