Skip to main content
Query the live driver location index to discover drivers currently near a specific coordinate. Results reflect each driver’s most recently reported position. No authentication required — this is a public endpoint.

Request

GET /rides/drivers/nearby
lat
number
required
Latitude of the center point to search from.
lon
number
required
Longitude of the center point to search from.
radiusKm
number
Search radius in kilometers. Defaults to 5 if not specified.
limit
integer
Maximum number of drivers to return. Defaults to 10 if not specified.

Response

An array of driver location objects. Returns an empty array if no drivers are found within the radius.
driverId
number
Unique identifier of the driver.
lat
number
Current latitude of the driver.
lon
number
Current longitude of the driver.
distanceKm
number
Distance in kilometers from the queried coordinate to the driver’s current location.

Example

curl -X GET "http://localhost:8080/rides/drivers/nearby?lat=12.9757&lon=77.6011&radiusKm=3&limit=5"
Driver locations are updated in real time as drivers report their positions. Results may be a few seconds behind each driver’s actual location.
When no drivers are available in the search area, the endpoint returns an empty array ([]) with a 200 OK status. Your client should handle an empty result gracefully.
Use a smaller radiusKm value in dense urban areas to keep the result set relevant. In low-density areas, increase the radius or omit it to use the default of 5 km.