Ещё один (совершенно другой) ресурс:
Код: Выделить всё
olej@R420:~$ curl 'https://api.ipgeolocation.io/ipgeo?apiKey=bfd4d4ea7426427b989b6cfbc9aec75f&ip=90.156.230.27'
{"ip":"90.156.230.27","continent_code":"AS","continent_name":"Asia","country_code2":"KZ","country_code3":"KAZ","country_name":"Kazakhstan","country_capital":"Nur-Sultan","state_prov":"","district":"","city":"Almaty","zipcode":"050039","latitude":"43.34666","longitude":"77.01204","is_eu":false,"calling_code":"+7","country_tld":".kz","languages":"kk,ru","country_flag":"https://ipgeolocation.io/static/flags/kz_64.png","geoname_id":"10310702","isp":"PS Internet Company LLC","connection_type":"","organization":"PS Internet Company LLC","currency":{"code":"KZT","name":"Tenge","symbol":"₸"},"time_zone":{"name":"Asia/Almaty","offset":6,"current_time":"2023-03-18 19:48:24.808+0600","current_time_unix":1679147304.808,"is_dst":false,"dst_savings":0}}
"latitude":"43.34666","longitude":"77.01204"
Код: Выделить всё
olej@R420:~$ curl 'https://api.ipgeolocation.io/ipgeo?apiKey=bfd4d4ea7426427b989b6cfbc9aec75f&ip=46.226.227.20'
{"ip":"46.226.227.20","continent_code":"EU","continent_name":"Europe","country_code2":"RU","country_code3":"RUS","country_name":"Russia","country_capital":"Moscow","state_prov":"Southern Federal District","district":"","city":"Krasnodar","zipcode":"350000","latitude":"45.03668","longitude":"38.99639","is_eu":false,"calling_code":"+7","country_tld":".ru","languages":"ru,tt,xal,cau,ady,kv,ce,tyv,cv,udm,tut,mns,bua,myv,mdf,chm,ba,inh,tut,kbd,krc,av,sah,nog","country_flag":"https://ipgeolocation.io/static/flags/ru_64.png","geoname_id":"10110481","isp":"State Unitary Enterprise of Krasnodar Region Information Technology Center","connection_type":"","organization":"State Unitary Enterprise of Krasnodar Region Information Technology Center","currency":{"code":"RUB","name":"Russian Ruble","symbol":"₽"},"time_zone":{"name":"Europe/Moscow","offset":3,"current_time":"2023-03-18 16:49:06.436+0300","current_time_unix":1679147346.436,"is_dst":false,"dst_savings":0}}
Там нужно зарегистрироваться по мэёл или Google-аккаунту, чтобы получить API_KEY, который стоит в вызове (API_KEY, похоже, обновляется "updates every 20 min") ... возможно, они там какие-то копейки насчитывают за запрос - только кто же им станет платить"latitude":"45.03668","longitude":"38.99639"
