Transport for Belgium API

⭐ Beginner's Pick Transportation / No Auth Required Beginner HTTPS CORS
Free to Use Varies (check documentation)

Overview

The iRail API gives you free access to Belgian railway timetables, live train positions, and station information. It is an unofficial but well-maintained third-party API that mirrors data from the national rail operator NMBS/SNCB. Beginners will appreciate the simple REST endpoints with no authentication required.

💡

Beginner Tip

No API key is needed — just call the endpoint with your parameters and you get JSON back immediately. Start with the /stations endpoint to get a list of all Belgian train stations.

Available Data

match scores and results
team standings
player statistics
schedule and fixtures

Example Response

JSON Response
{
  "route": "Line 1",
  "origin": "Station A",
  "destination": "Station B",
  "departure": "08:30",
  "arrival": "09:15",
  "status": "On Time",
  "delays_min": 0
}

Field Reference

id Unique identifier for the station (e.g., "BE.NMBS.008814001")
name Official name of the railway station
locationX Longitude coordinate of the station
locationY Latitude coordinate of the station
standardname Standardized station name used in routing queries

Implementation Example

const url = "https://docs.irail.be/";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

No results for station Station name is misspelled or given in the wrong language
Fetch all stations first via /stations and use the exact name or ID from the response
503 Service Unavailable iRail servers are temporarily overloaded or down
This is a free community API — retry after a few minutes or check iRail's GitHub for status updates
Empty departures array Querying outside service hours or for a non-stop station
Verify the station name and ensure your time parameter falls within regular train operating hours

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 20/20
🔒 Security 15/15
🛠 Developer XP 20/20
✓ Reliability 7/15
Response Time 195ms

Fully tested on Apr 5, 2026

Technical Specifications

Auth No Auth
HTTPS REQUIRED
CORS YES
Category Transportation
Difficulty Beginner
Verified: 2026-04-04

Similar APIs

View All →