eco-ci-energy-estimation icon indicating copy to clipboard operation
eco-ci-energy-estimation copied to clipboard

Add IP2Location.io API

Open ip2location opened this issue 1 year ago • 5 comments

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.

ip2location avatar Sep 25 '24 01:09 ip2location

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.

  1. 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:
Screenshot 2024-11-01 at 10 00 08 AM

Maxmind and ipapi.co deliver Berlin as a result. Can you tell why this inaccuracy happens?

ArneTR avatar Nov 01 '24 09:11 ArneTR

@ArneTR Can you check ipinfo.io for your IP geolocation?

I have a feature request issue here: #96

abdullahdevrel avatar Nov 02 '24 17:11 abdullahdevrel

Hi @ArneTR,

  1. We had added a new flag called USE_IP2LOCATION_API to ensure that user will only be able to use our API if the flag is set to true. If the flag is not set or set to any value other than true, and the IP2LOCATIONIO_API_KEY is not set, the script will fallback to the ipapi.co as the default API.
  2. 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.

ip2location avatar Nov 22 '24 07:11 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 avatar Jun 21 '25 08:06 ArneTR

@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).

ip2location avatar Jun 21 '25 10:06 ip2location