Comments (9)
@roryrjb thank you for trying to help
from iplocation.
We we're seeing this too and were able to get non-empty results again by reversing the list of providers we found at https://github.com/roryrjb/iplocation/blob/master/src/index.ts#L6
So that our client code looks like this
const providers = [
'https://ipinfo.io/*',
'https://ipapi.co/*/json/',
];
const result = await iplocation(ipAddress, providers);
My guess is something changed at ipapi.co recently
from iplocation.
Hey @shivwork thanks for raising this. I have tested with the latest versions in 6.x
, 5.x
and 4.x
branches and cannot replicate. This can happen if there isn't a value from the IP metadata provider, but for this particular IP address all the data is there. I could also have been a temporary issue with the provider at the time. If this issue persists, please let me know and could you also include the output of DEBUG=iplocation node {your_script_name}.js
which will include information about what providers the module tried, what responses it got, etc.
from iplocation.
I am also getting empty response.
from iplocation.
@roryrjb can you help me please ?
from iplocation.
@ntk860 if you are able to share a snippet of the code you are using and ideally the IP address so I can properly test this then that would be good, otherwise if you could tell me what fields are empty.
from iplocation.
iplocation('56.70.97.8').then((res) => {
// res is empty
console.log(res)
})
.catch(error => {
console.log(error)
})
})
{ country: '',
countryCode: '',
region: '',
regionCode: '',
city: '',
postal: '',
ip: '',
latitude: null,
longitude: null,
timezone: '' }
from iplocation.
@wtfleming thanks for pointing this out. I reached a similar fix when looking at this but wanted to get a more permanent solution in place, it seems like we may not be able to continue relying on ipapi.co, so will look for some alternatives. @ntk860 if you are able to implement something similar to this fix I think it'll be the best short term solution.
from iplocation.
iplocation('90.254.60.95', [], callback);
Return an empty record as experienced by #16 (comment).
iplocation(
'90.254.60.95',
[
'https://ipinfo.io/*',
'https://ipapi.co/*/json/'
],
callback
);
Returns a proper record as suggested by #16 (comment)
https://ipapi.co/90.254.60.95/json/ returns:
"{\"error\": true, \"reason\": \"RateLimited\", \"message\": \"Sign up for IP Address Location API @ https://ipapi.co\"}"
then in
try {
log("got: " + body);
json = JSON.parse(body);
}
catch (ex) {
return retry(++i, callback);
}
JSON.parse passes, so return retry(++i, callback);
is not executed.
You need to throw an error or return retry(++i, callback);
in the try block if json.error exists.
from iplocation.
Related Issues (20)
- freegeoip is down? HOT 1
- Add TypeScript Definition / Convert to TypeScript HOT 8
- 🐛Fails Create React App's build HOT 8
- handle sources that require API keys HOT 1
- when using promises, It doesn't report RateLimited as an error HOT 2
- More providers HOT 4
- npmjs reports different version HOT 1
- DOESN'T WORK WITH COLOMBIAN IPs HOT 1
- Error: All providers failed HOT 3
- New keys from the https://freegeoip.app/json/* provider HOT 1
- Looking for new maintainer HOT 8
- text
- Please add city
- Error to use the IpLocation HOT 1
- How to pass API key HOT 8
- Basic test failed HOT 1
- Re-add other services HOT 2
- Freegeoip deprecation warning HOT 3
- Different JSON structures from providers HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iplocation.