Skip to content

Latest commit

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Reverse Geocoding API

REST API to convert latitude/longitude coordinates into city, state, and country data. Turn GPS coordinates into human-readable locations.

Features

  • 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"
}

Get API Key

Create an account at omkar.cloud to get your API key, and use it in requests. 100 requests are free every month.

Quick Start

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"
}
]

Installation

Python

pip install requests
importrequestsresponse=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']}")

Node.js

npm install axios
importaxiosfrom"axios";constresponse=awaitaxios.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}`);

API Reference

Endpoint

GET https://reverse-geocoding-api.omkar.cloud/reverse-geocode

Headers

HeaderRequiredDescription
API-KeyYesAPI key from omkar.cloud/api-key

Parameters

ParameterRequiredDescription
latYesLatitude (-90 to 90)
lonYesLongitude (-180 to 180)

Response Fields

FieldTypeDescription
namestringCity/place name
statestringState or province
country_codestringTwo-letter ISO country code

Examples

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

Tokyo coordinates

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

Error Handling

response=requests.get(
"https://reverse-geocoding-api.omkar.cloud/reverse-geocode",
params={"lat": 37.7749, "lon": -122.4194},
headers={"API-Key": "YOUR_API_KEY"}
)
ifresponse.status_code==200:
data=response.json()
elifresponse.status_code==401:
# Invalid API keypasselifresponse.status_code==429:
# Rate limit exceededpass

Rate Limits

PlanPriceRequests/Month
Free$0100
Starter$163,000
Grow$4815,000
Scale$14875,000

Questions? We have answers.

Reach out anytime. We will solve your query within 1 working day.

Contact Us on WhatsApp about Reverse Geocoding API

Contact Us on Email about Reverse Geocoding API