Welcome to the Delhi Metro API! This API provides information about the Delhi Metro routes, stations, fare details, and other related data. The aim is to make it easier for developers to build applications and services that utilize Delhi Metro information.
Before you begin, ensure you have met the following requirements:
- You have Node.js and npm installed on your machine.
-
Clone the repository:
git clone https://github.com/your-username/delhi-metro-api.git
-
Change to the project directory:
cd delhi-metro-api -
Install the required packages:
npm install
-
Start the server:
npm start
-
Endpoint:
/api/stations -
Method:
GET -
Description: Retrieves a list of all metro stations.
-
Response Example:
[ { "id": 1, "name": "Rajiv Chowk", "line": "Blue Line" }, { "id": 2, "name": "Kashmere Gate", "line": "Red Line" } ]
-
Endpoint:
/api/route -
Method:
GET -
Parameters:
from(string): The starting station name.to(string): The destination station name.
-
Description: Retrieves the route between two stations.
-
Response Example:
{ "from": "Rajiv Chowk", "to": "Kashmere Gate", "route": [ "Rajiv Chowk", "New Delhi", "Chandni Chowk", "Kashmere Gate" ], "total_time": "20 mins" }
-
Endpoint:
/api/fare -
Method:
GET -
Parameters:
from(string): The starting station name.to(string): The destination station name.
-
Description: Retrieves the fare details between two stations.
-
Response Example:
{ "from": "Rajiv Chowk", "to": "Kashmere Gate", "fare": 30 }
Contributions are welcome! Please follow these steps to contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch). - Make your changes and commit them (
git commit -m 'Add new feature'). - Push to the branch (
git push origin feature-branch). - Create a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.