richienb / iplocation Goto Github PK
View Code? Open in Web Editor NEWGet ip location information.
License: MIT License
Get ip location information.
License: MIT License
Please add an index.d.ts file for TypeScript definitions
0|API | Mon Sep 23 2019 07:54:43 GMT+0000 (UTC) { Error: All providers failed.
0|API | at new ProviderError (/home/ubuntu/api/node_modules/iplocation/lib/index.js:39:28)
0|API | at retry (/home/ubuntu/api/node_modules/iplocation/lib/index.js:55:29)
0|API | at Request._callback (/home/ubuntu/api/node_modules/iplocation/lib/index.js:65:28)
0|API | at Request.self.callback (/home/ubuntu/api/node_modules/iplocation/node_modules/request/request.js:185:22)
0|API | at emitTwo (events.js:126:13)
0|API | at Request.emit (events.js:214:7)
0|API | at Request.<anonymous> (/home/ubuntu/api/node_modules/iplocation/node_modules/request/request.js:1161:10)
0|API | at emitOne (events.js:116:13)
0|API | at Request.emit (events.js:211:7)
0|API | at IncomingMessage.<anonymous> (/home/ubuntu/api/node_modules/iplocation/node_modules/request/request.js:1083:12)
0|API | at Object.onceWrapper (events.js:313:30)
0|API | at emitNone (events.js:111:20)
0|API | at IncomingMessage.emit (events.js:208:7)
0|API | at IncomingMessage.wrapped (/home/ubuntu/api/node_modules/newrelic/lib/transaction/tracer/index.js:188:22)
0|API | at IncomingMessage.wrappedResponseEmit (/home/ubuntu/api/node_modules/newrelic/lib/instrumentation/core/http-outbound.js:212:24)
0|API | at endReadableNT (_stream_readable.js:1064:12)
0|API | at Shim.applySegment (/home/ubuntu/api/node_modules/newrelic/lib/shim/shim.js:1424:20)
0|API | at wrapper (/home/ubuntu/api/node_modules/newrelic/lib/shim/shim.js:2065:17)
0|API | at _combinedTickCallback (internal/process/next_tick.js:138:11)
0|API | at process._tickDomainCallback [as _tickCallback] (internal/process/next_tick.js:218:9) message: 'All providers failed.' }
Getting this error on one server. Same works fine on other servers.
Can someone check if this module is being maintained.
Basic test failed with latest version and works fine with 6.x
const ipLocation = require("iplocation");
(async () => {
await ipLocation("172.217.167.78");
})();
With 7.x (latest), i see the following error
HTTPError: Too Many Requests
I don't use this module anymore, and to be honest I don't even use Node.js or GitHub much anymore, and I don't have the time to update it, review issues or pull requests, so I am looking for a new maintainer. I won't just pick anyone, as people are using the module, so I have to ensure it goes into good hands, it's not complicated and there isn't much coding involved it's more about checking providers and keeping on top of stuff. If no one suitable comes forward (in a reasonable amount of time) I will deprecate the module in npm and archive the repo in GitHub.
Hi, this is the message that promise resolves after facing a RateLimited error. shouldn't be a rejection instead?
{
"error": true,
"reason": "RateLimited",
"message": "Sign up for IP Address Location API @ https://ipapi.co"
}
The package.json reports version 3.0.0 but npmjs only serves version 2.0.1. This causes confusion as the docs are different too.
I want to add API key . Where I can add it ?
This are the keys for this api:
region: ['region_name']
postal: ['zip_code']
timezone: ['time_zone']
Each of the providers produces slightly different JSON structures. So what I think this lib needs is an optional transform function per provider to convert the JSON into a set of common fields.
Some of the providers DO produce similar results so they could become the defacto standard.
Hello I used this package in my express backend with node and I used mi local ip that it is from colombia bug the response json doesn't give any information about country name, code, latitud, longitude, etc.
Can you fix this ?
It might be more useful to have many services that are all slightly off from each other than to rely on a single one.
Maybe re-add the services that used to be here?
Hi,
I've created the following list with more providers.
trade_name, uri, key, result_pattern, is_free
---------------------------------------------
'Antideo', 'https://api.antideo.com/ip/location/*', '', 'location.country_code', false
'Antideo(Limited)', 'https://api.antideo.com/ip/location/*', '', 'location.country_code', true
'dbip', 'https://api.db-ip.com/v2/#/*/{propertyName}', '#', 'countryCode', false
'dbip(Limited)', 'https://api.db-ip.com/v2/free/*/{propertyName}', '', 'countryCode', true
'Geo IP Lookup', 'http://api.geoiplookup.net/?query=*', '', 'countrycode', true
'ip2c.org', 'https://ip2c.org/*', '', '1;CD;COD;COUNTRY', true
'ip2location', 'https://api.ip2location.com/?ip=*&key=#&package=<WS1|WS2|WS3|...|WS24>&format=json', '#', 'country_code', false
'ip2location(Limited)', 'https://api.ip2location.com/?ip=*&key=#&package=<WS1|WS2|WS3|...|WS24>&format=json', 'demo', 'country_code', true
'ipapi', 'https://ipapi.co/*/json/', '', 'country', false
'ipapi(Limited)', 'https://ipapi.co/*/json/', '', 'country', true
'ipinfo.io', 'https://*?token=#', '#', 'country', false
'ipinfo.io(Limited)', 'https://*?token=#', '#', 'country', true
'IPIP', 'http://enapi.ipip.net/*?token=#', '#', 'country_code', false
'IPIP(Limited)', 'http://enapi.ipip.net/*?token=#', '#', 'country_code', true
'IPLocate', 'https://www.iplocate.io/api/lookup/*?apikey=#', '#', 'country_code', false
'IPLocate(Limited)', 'https://www.iplocate.io/api/lookup/*', '', 'country_code', true
'ipstack', 'https://api.ipstack.com/* ? access_key = #', '#', 'country_code', false
'ipstack(Limited)', 'https://api.ipstack.com/* ? access_key = #', '#', 'country_code', true
'MAXMIND', 'https://geoip.maxmind.com/geoip/v2.1/country/*', '', 'country.iso_code', false
Notes:
Tia
PS: I hope more to be added.
Creating an optimized production build...
Failed to compile.
Failed to minify the code from this file:
./node_modules/ip-regex/index.js:6
Read more here: http://bit.ly/2tRViJ9
ip-regex
library failing to be minified.Fix: #13
Describe the bug
I can't run the library because it gives me a JSON error.
Example
async function myFunction(req, res, next) {
try {
console.log( await ipLocation('172.217.167.78') )
} catch (error) {
console.log(error)
}
}
Expected behavior
I expected a response from the bookstore.
Output log
SyntaxError: Unexpected end of JSON input
at JSON.parse ()
at C:~~~~~\node_modules\ip-location\index.js:12:23
at done (C:~~~~~\node_modules\ip-location\http-get.js:13:5)
at IncomingMessage. (C:~~~~~\node_modules\ip-location\http-get.js:24:7)
at IncomingMessage.emit (events.js:327:22)
at endReadableNT (_stream_readable.js:1220:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
Freegeoip will be deprecated on Juli first and needs to be replaced with https://ipstack.com
Originally raised here: #9 (comment).
City is available as https://ipapi.co/84.68.57.75/json/ returns:
Note that country_capital is of little interest.
{
"ip": "84.68.57.75",
"city": "Ilford",
"region": "England",
"region_code": "ENG",
"country": "GB",
"country_code": "GB",
"country_code_iso3": "GBR",
"country_capital": "London",
"country_tld": ".uk",
"country_name": "United Kingdom",
"continent_code": "EU",
"in_eu": false,
"postal": "IG3",
"latitude": 51.5646,
"longitude": 0.0898,
"timezone": "Europe/London",
"utc_offset": "+0100",
"country_calling_code": "+44",
"currency": "GBP",
"currency_name": "Pound",
"languages": "en-GB,cy-GB,gd",
"country_area": 244820.0,
"country_population": 62348447.0,
"asn": "AS5378",
"org": "Vodafone Limited"
}
res = {
country: '',
...
}
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.