Geo & Travel

Nearest City API

Find the closest populated city to any latitude/longitude, with its distance in kilometers.

Request Headers

Name Required Description
X-RapidAPI-Key required Your RapidAPI key. Get one free.
X-RapidAPI-Host required nearest-city.p.rapidapi.com

Endpoints

GET /v1/geo/nearest-city

Find the nearest city to a coordinate

Parameters

NameTypeRequiredDefaultConstraints
latnumberrequired—-90-90
lonnumberrequired—-180-180

Code Examples

curl --request GET \
  --url 'https://nearest-city.p.rapidapi.com/v1/geo/nearest-city?lat=0&lon=0' \
  --header 'x-rapidapi-key: YOUR_API_KEY' \
  --header 'x-rapidapi-host: nearest-city.p.rapidapi.com'

Interactive Example

nearest-city
$ GET /v1/geo/nearest-city?lat=35.69&lon=139.69
{"name":"Tokyo","country":"JP","latitude":35.6895,"longitude":139.69171,"population":8336599,"timezone":"Asia/Tokyo","distance_km":0.16}

Subscribe & License

Access this API with commercial-ready tiers on RapidAPI. Flexible plans designed for side-projects, startups, and high-volume production architectures.

View Pricing & Subscribe

Developer Support

Need help integrating or have a custom endpoint request? Our engineering team is here to assist with authentication, payload schemas, and high-frequency rate limit increases.

Contact API Engineering

System Performance

Monitored 24/7 with a 99.9% uptime SLA. Built atop cloud-native microservices with globally distributed edge caching to ensure ultra-low latency response times.

All Systems Operational