REST API for city and geographic data. Returns city name, state, country, coordinates, population, and capital status.
- Single endpoint for city lookups worldwide
- Returns structured JSON with full location data
- Filter by city name and/or country code
- 5,000 requests/month on free tier
- Example Response:
[
{
"city_name": "New York",
"state": "New York",
"country_code": "US",
"is_capital": false,
"coordinates": {
"latitude": 40.6943,
"longitude": -73.9249
},
"population": 18713220
}
]- Create account at omkar.cloud
- Get API key from omkar.cloud/api-key
- Include
API-Keyheader in requests
curl -X GET "https://city-api.omkar.cloud/city?name=New%20York" \
-H "API-Key: YOUR_API_KEY"[
{
"city_name": "New York",
"state": "New York",
"country_code": "US",
"is_capital": false,
"coordinates": {
"latitude": 40.6943,
"longitude": -73.9249
},
"population": 18713220
}
]pip install requestsimport requests
response = requests.get(
"https://city-api.omkar.cloud/city",
params={"name": "New York"},
headers={"API-Key": "YOUR_API_KEY"}
)
cities = response.json()npm install axiosimport axios from "axios";
const response = await axios.get("https://city-api.omkar.cloud/city", {
params: { name: "New York" },
headers: { "API-Key": "YOUR_API_KEY" }
});
const cities = response.data;GET https://city-api.omkar.cloud/city
| Header | Required | Description |
|---|---|---|
API-Key |
Yes | API key from omkar.cloud/api-key |
| Parameter | Required | Default | Description |
|---|---|---|---|
name |
No | — | City name (e.g., "New York", "Tokyo") |
country_code |
No | — | Two-letter ISO country code (e.g., "US", "JP") |
[
{
"city_name": "string",
"state": "string",
"country_code": "string",
"is_capital": "boolean",
"coordinates": {
"latitude": "number",
"longitude": "number"
},
"population": "number"
}
]| Field | Type | Description |
|---|---|---|
city_name |
string | City name |
state |
string | State or province |
country_code |
string | Two-letter ISO code |
is_capital |
boolean | Whether it's the country's capital |
coordinates.latitude |
number | Latitude coordinate |
coordinates.longitude |
number | Longitude coordinate |
population |
number | City population |
response = requests.get(
"https://city-api.omkar.cloud/city",
params={"name": "Tokyo"},
headers={"API-Key": "YOUR_API_KEY"}
)
for city in response.json():
print(f"{city['city_name']}, {city['country_code']}: {city['population']}")response = requests.get(
"https://city-api.omkar.cloud/city",
params={"name": "London", "country_code": "GB"},
headers={"API-Key": "YOUR_API_KEY"}
)
london_uk = response.json()[0]const { data } = await axios.get("https://city-api.omkar.cloud/city", {
params: { name: "Paris" },
headers: { "API-Key": "YOUR_API_KEY" }
});
const { latitude, longitude } = data[0].coordinates;response = requests.get(
"https://city-api.omkar.cloud/city",
params={"name": "InvalidCity123"},
headers={"API-Key": "YOUR_API_KEY"}
)
if response.status_code == 200:
data = response.json()
if not data:
# No cities found
pass
elif response.status_code == 401:
# Invalid API key
pass
elif response.status_code == 429:
# Rate limit exceeded
pass| Plan | Price | Requests/Month |
|---|---|---|
| Free | $0 | 5,000 |
| Starter | $25 | 100,000 |
| Grow | $75 | 1,000,000 |
| Scale | $150 | 10,000,000 |



