ipapi-co / api Goto Github PK
View Code? Open in Web Editor NEWAPI for IP address lookup (ipapi.co)
Home Page: https://ipapi.co
API for IP address lookup (ipapi.co)
Home Page: https://ipapi.co
im using this api on checkout while consuming its giving cross error, how i can handle this
my code : let getIP = await axios.get("https://ipapi.co/json/");
// .then(async (response) => {console.log("RESPONSE==>",response)})
geo_data = getIP
? getIP.data
: JSON.parse(localStorage?.getItem("visitor_data"));
Tech : PHP
return file_get_contents('https://ipapi.co/8.8.8.8/json/');
"{"error": true, "reason": "RateLimited", "message": "For details, see https://ipapi.co/ratelimited/ "}"
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)
});
so we can make ajax request
Hi, I'm using your Api to get the user location.
I'm using javascript to get this information like:
fetch('https://ipapi.co/json/')
.then( resp => resp.text())
.then( data => {
const {country_code: countryCode} = JSON.parse(data)
fetch(`https://xxxxxxxxxx.com?country=${countryCode}`)
.then( response=> response.json() )
.then((data) => console.log('some code with ', data));
})
sometimes it works ok and other times wrong.
Sometimes in Google Chrome I have this error: Failed to fetch --> testint with Chrome 38, Chrome81, Chrome80
Sometimes in Opera I have this error: Failed to fetch --> version Chrome67
Normally in Firefox I have this error: TypeError: NetworkError when attempting to fetch resource. --> version Firefox75
Can you help me please?
Thank you
hi!
thanks for this api, it looks awesome :)
I just found a little bug (i think), the region code for my ip is this https://ipapi.co/81.234.60.162/json/
in the api it's "AB", which is wrong I believe.
It's not a big deal, and I really don't care about it myself, but I just wanted to point it out, in case you guys are parsing any file wrongly, the "AB" could maybe from the organization?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.