Geocoding City Bounds
Get city location and bounding box information using OpenStreetMap Nominatim geocoding service. Public endpoint.
Endpoint
Authentication
Not required (public endpoint)
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
city |
string | Yes | City name |
country |
string | No | Country name (optional, helps narrow down results) |
Response
Success (200 OK)
Returns city location and bounding box information:
{
"lat": "40.37",
"lon": "49.84",
"display_name": "Baku, Azerbaijan",
"boundingbox": ["40.365", "40.375", "49.835", "49.845"]
}
Response Fields:
- lat: Latitude of the city center
- lon: Longitude of the city center
- display_name: Full display name of the location
- boundingbox: Array of 4 values [min_lat, max_lat, min_lon, max_lon] defining the city boundaries
Error Responses
Bad Request (400)
Not Found (404)
Internal Server Error (500)
or
or
Example Request
curl -X GET "https://api.luxmart.site/v1/accounts/geocoding/city-bounds/?city=Baku&country=Azerbaijan"
Notes
- This endpoint proxies requests to OpenStreetMap Nominatim geocoding service
- The
cityparameter is required - The
countryparameter is optional but recommended to narrow down results for cities with common names - Returns the first matching result
- The bounding box can be used to limit map viewport to the city area
- This is a public endpoint, no authentication required
- The service uses a 10-second timeout for external requests