Coordinates → nearest city

Returns the nearest city to a latitude/longitude, with its distance.

Request

GEThttps://geo-tools.p.apihiver.com/v1/reverse?coords=18.52%2C73.85
*
String. 'lat,lon', e.g. 28.6139,77.2090.
Language
Client
1curl --request GET \
2  --url 'https://geo-tools.p.apihiver.com/v1/reverse?coords=18.52%2C73.85' \
3  --header 'Accept: application/json' \
4  --header 'X-API-Key: YOUR_API_KEY'

Coordinates → nearest city: Geocoding & Geo Tools API reference

Returns the nearest city to a latitude/longitude, with its distance. This endpoint is part of the Geocoding & Geo Tools API: Geocode cities to coordinates, reverse-geocode coordinates, measure distances and find the time zone of any place.

Example response (200, application/json)

Success.

1{
2  "distance_km": 0.57,
3  "nearest_city": {
4    "lat": 18.51957,
5    "lon": 73.85535,
6    "name": "Pune",
7    "country": "India",
8    "timezone": "Asia/Kolkata",
9    "population": 3124458,
10    "country_code": "IN"
11  }
12}

Errors

  • 400 — A required parameter is missing or a value has the wrong format.
    1{
    2  "error": {
    3    "code": "INVALID_INPUT",
    4    "message": "coords: Field required"
    5  }
    6}

Gateway errors (missing key, no subscription, rate limits) are listed in Error codes.