Skip to content

Navigation Menu

Sign in
Sign up

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

Node.js

npm install axios
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}`);

API Reference

Endpoint

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

Headers

Header Required Description
API-Key Yes API key from omkar.cloud/api-key

Parameters

Parameter Required Description
lat Yes Latitude (-90 to 90)
lon Yes Longitude (-180 to 180)

Response Fields

Field Type Description
name string City/place name
state string State or province
country_code string Two-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"}
)
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

Rate Limits

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.

Contact Us on WhatsApp about Reverse Geocoding API

Contact Us on Email about Reverse Geocoding API

AltStyle によって変換されたページ (->オリジナル) /