API Endpoint
/nearestmetro
API Method
GET
Parameters
lat: (required) The latitude coordinate of the user’s location.
long: (required) The longitude coordinate of the user’s location.
Response Format
{
“name”: “The name of the nearest metro station.”,
“latitude”: “The latitude coordinate of the nearest metro station.”,
“longitude”: “The longitude coordinate of the nearest metro station.”,
“directions”: “The directions to the nearest metro station using Google Maps.”
}
Error Handling
400 Bad Request - If the lat and long parameters are missing or invalid.
404 Not Found - If no metro stations are found within a certain radius of the provided coordinates.
Usage Example
GET /nearestmetro?lat=28.5729&long=77.2122
Response:
{
“name”: “Rajiv Chowk”,
“latitude”: 28.6328,
“longitude”: 77.2196,
“directions”: “https://www.google.com/maps/dir/?api=1&destination=Rajiv+Chowk+Metro+Station&dir_action=navigate”
}
Usage Guidelines
• The API can be used for non-commercial purposes only.
• The API should not be used in a manner that interferes with the operation of the Delhi Metro system or the safety of its passengers.
• The API may be subject to rate limiting or other usage restrictions.
• Any use of the API should comply with the Terms of Use of the Delhi Metro system.