Add IP2Location.io API
This PR reflected the issue #95. It features 2 updates:
- Add a failover for ipapi.co to use IP2Location.io keyless API if the ipapi.co returned HTTP error code 429 (Refers to their doc for more information)
- Add IP2Location.io API which required an API key. If user setup IP2Location.io API key, it will used it to call IP2Location.io API instead of ipapi.co. And also added the steps to add API key in README.md too.
Please let us know if any changes required for this PR. Hope to see the PR gets approved.
Hey, sry for the delay on this.
I had a look at the PR and the integration looks partially usable.
You ripped out the alternative vendor, which was not our intention. We would still like to have it as a fallback.
Can you still integrate that? If not please direct the commit to another branch (ip2location) for instance and I will adapt the PR from our side so that your contribution does not get lost.
- The accuracy of your API seems a bit off to the other vendors we are using. I am currently in Berlin with IP 2003:cd:ef14:8901:79e8:bab3:4384:fac5 and this is the result I get:
Maxmind and ipapi.co deliver Berlin as a result. Can you tell why this inaccuracy happens?
@ArneTR Can you check ipinfo.io for your IP geolocation?
I have a feature request issue here: #96
Hi @ArneTR,
- We had added a new flag called
USE_IP2LOCATION_APIto ensure that user will only be able to use our API if the flag is set totrue. If the flag is not set or set to any value other thantrue, and theIP2LOCATIONIO_API_KEYis not set, the script will fallback to the ipapi.co as the default API. - We regret that we did not get your results correctly. We will fix it in the next release. The IP geolocation is not 100% accurate for Germany. You can visit this link for more information about the accuracy of IP geolocation results in IP2Location.
Hey, sorry for having this left so long.
In the current version a key is needed. Does the API also work without a key? If so, what are the downsides / restrictions?
@ArneTR IP2Location.io allows user to perform up to 1,000 queries per day without the need to sign up for an API key (keyless).