11 lines
271 B
Python
Executable file
11 lines
271 B
Python
Executable file
import requests
|
|
|
|
|
|
def get_location():
|
|
response = requests.get(f'https://ipinfo.io').json()
|
|
location_data = {
|
|
"city": response.get("city"),
|
|
"region": response.get("region"),
|
|
"country": response.get("country")
|
|
}
|
|
return location_data
|