DJTommek / better-location

Telegram bot for parsing and generating various of location formats.
https://t.me/BetterLocationBot
MIT License
8 stars 2 forks source link

Service IP address #64

Open DJTommek opened 3 years ago

DJTommek commented 3 years ago

Example input and their coordinates

Input Coordinates
77.75.75.176 (seznam.cz) 50.0880, 14.4208
172.217.23.238 (google.com) 50.087736,14.422685

IP addresses loaded using ping, coordinates gathered from https://www.iplocation.net/ip-lookup

Description (optional)

If IP address is provided, try to use some geolocation API service to get location.

DJTommek commented 2 years ago

Free API, that could be used: https://ip-api.com/ Request: http://ip-api.com/json/24.48.0.1 Response:

{
    "status": "success",
    "country": "Canada",
    "countryCode": "CA",
    "region": "QC",
    "regionName": "Quebec",
    "city": "Montreal",
    "zip": "H1A",
    "lat": 45.6752,
    "lon": -73.5022,
    "timezone": "America/Toronto",
    "isp": "Le Groupe Videotron Ltee",
    "org": "Videotron Ltee",
    "as": "AS5769 Videotron Telecom Ltee",
    "query": "24.48.0.1"
}