Indian Railways Trains Database
Complete database of 13,334 Indian Railways trains with train numbers, names, and details. Perfect for developers, researchers, and railway enthusiasts.
13,334 Trains
JSON Format
Live API
API Access
GET /api/v1/trains/all-kvsAccess this data programmatically via our REST API. The endpoint returns all trains in JSON format with train numbers as values and “number - name“ as labels.
An API key is required to access this endpoint. Include your API key in the
X-API-Key header of your request.API Key Required
CORS Enabled
Rate Limited
Showing first 50 of 0 trains
Loading trains database...
Usage Examples
How to use this data in your applications
JavaScript/Node.js
// Using React Query Hook (Recommended)
import { useAllTrainKVs } from '@rail-radar/shared';
function MyComponent() {
const { data: trains, isLoading } = useAllTrainKVs();
if (isLoading) return <div>Loading...</div>;
// Find a specific train
const rajdhani = trains?.find(t => t[0] === '12951');
return (
<div>
{trains?.map(train => (
<div key={train[0]}>{train[1]}</div>
))}
</div>
);
}Python
# For standalone Python applications
import requests
headers = {'X-API-Key': 'YOUR_API_KEY'}
response = requests.get(
'https://railradar.in/api/v1/trains/all-kvs',
headers=headers
)
trains = response.json()
# Filter express trains
express_trains = [
t for t in trains
if 'express' in t[1].lower()
]