Search trains (v1)
Find Indian Railways trains by name or number, with each train's first and last station. A query nothing matches returns empty results.
1 credit / requestBilled only on success
Authorization
ApiKeyAuth x-api-key<token>
In: header
Query Parameters
query*string
A train name or part of it, such as mumbai rajdhani or vande bharat, or the start of a train number.
Length
2 <= length <= 100curl -X GET "https://example.com/v1/indianrail/trains/search?query=mumbai+rajdhani" \ -H "x-api-key: YOUR_API_KEY"{ "data": { "query": "mumbai rajdhani", "count": 0, "results": [ { "train_number": "12953", "name": "MUMBAI CENTRAL - HAZRAT NIZAMUDDIN August Kranti Rajdhani Exp", "source": { "code": "NDLS", "name": "New Delhi" }, "destination": { "code": "NDLS", "name": "New Delhi" } } ] }, "details": { "reason": "string", "message": "string" }}