REST API to convert latitude/longitude coordinates into city, state, and country data. Turn GPS coordinates into human-readable locations.
Convert lat/long coordinates to location names Returns city, state, and country code Works with any location on Earth 100 requests/month on free tier Example Response: {
"name" : " San Francisco" ,
"state" : " California" ,
"country_code" : " US"
} Create an account at omkar.cloud to get your API key, and use it in requests. 100 requests are free every month.
curl -X GET " https://reverse-geocoding-api.omkar.cloud/reverse-geocode?lat=37.7749&lon=-122.4194" \
-H " API-Key: YOUR_API_KEY" [
{
"name" : " San Francisco" ,
"state" : " California" ,
"country_code" : " US"
}
] import requests response = requests .get (
"https://reverse-geocoding-api.omkar.cloud/reverse-geocode" ,
params = {"lat" : 37.7749 , "lon" : - 122.4194 },
headers = {"API-Key" : "YOUR_API_KEY" }
)
data = response .json ()[0 ]
print (f"Location: { data ['name' ]} , { data ['state' ]} , { data ['country_code' ]} " )import axios from "axios" ; const response = await axios . get ( "https://reverse-geocoding-api.omkar.cloud/reverse-geocode" , { params : { lat : 37.7749 , lon : - 122.4194 } , headers : { "API-Key" : "YOUR_API_KEY" } } ) ; console . log ( `Location: ${ response . data [ 0 ] . name } , ${ response . data [ 0 ] . state } ` ) ; GET https://reverse-geocoding-api.omkar.cloud/reverse-geocode
Headers Parameter Required Description latYes Latitude (-90 to 90) lonYes Longitude (-180 to 180)
Field Type Description namestring City/place name statestring State or province country_codestring Two-letter ISO country code
Get location from coordinates response = requests .get (
"https://reverse-geocoding-api.omkar.cloud/reverse-geocode" ,
params = {"lat" : 40.7128 , "lon" : - 74.0060 },
headers = {"API-Key" : "YOUR_API_KEY" }
)
location = response .json ()[0 ]
print (f"{ location ['name' ]} , { location ['state' ]} " ) # New York, New York response = requests .get (
"https://reverse-geocoding-api.omkar.cloud/reverse-geocode" ,
params = {"lat" : 35.6762 , "lon" : 139.6503 },
headers = {"API-Key" : "YOUR_API_KEY" }
)
location = response .json ()[0 ]
print (f"{ location ['name' ]} , { location ['country_code' ]} " ) # Tokyo, JP response = requests .get (
"https://reverse-geocoding-api.omkar.cloud/reverse-geocode" ,
params = {"lat" : 37.7749 , "lon" : - 122.4194 },
headers = {"API-Key" : "YOUR_API_KEY" }
)
if response .status_code == 200 :
data = response .json ()
elif response .status_code == 401 :
# Invalid API key pass elif response .status_code == 429 :
# Rate limit exceeded pass Plan Price Requests/Month Free $0 100 Starter $16 3,000 Grow $48 15,000 Scale $148 75,000
Questions? We have answers. Reach out anytime. We will solve your query within 1 working day.