ericpaulbishop / gargoyle

Gargoyle Router Management Utility
http://www.gargoyle-router.com
465 stars 222 forks source link

[New Feature] Add IP2Location.io API in gipquery.c #996

Open ip2location opened 6 months ago

ip2location commented 6 months ago

I would like to suggest adding IP2Location.io API to gipquery.c.

(a) get user IP address - https://ip2location.io/ip (b) get IP geolocation by IP address - https://api.ip2location.io/?ip=[IP]

lantis1008 commented 6 months ago

Hi, thanks for reaching out! Can you please confirm if these APIs are free to consume?

ip2location commented 6 months ago

Yes, both APIs are free to use.

For the IP geolocation API, there is a limit of 500 queries per IP address per day.

lantis1008 commented 6 months ago

Thanks! I'll look into this, I'm in the process of doing a large update anyway.

obsy commented 6 months ago

..."message":"Limit to 500 queries per day. Sign up for a Free plan at https://www.ip2location.io to get 30K queries per month."}

ip2location commented 6 months ago

@obsy The keyless/tokenless 500 credits should be sufficient in most use case.

lantis1008 commented 4 months ago

Hi @ip2location

(a) get user IP address - https://api.ip2location.io/ip

Is this expected to work? I get the following message every time

root@Gargoyle:~# ewget https://api.ip2location.io/ip
{"error":{"error_code":10000,"error_message":"Invalid API key or insufficient credit."}}

The geolocation api seems to work fine.

ip2location commented 4 months ago

Sorry, the correction endpoint should be as following:

(a) get user IP address - https://ip2location.io/ip

lantis1008 commented 4 months ago

Thanks for letting us know about your service, I've added it in to our new development branch with commit 6749b46. This issue will automatically close when we bring that in to master, but if you'd like to close it yourself feel free. 👍