iRail (Belgium) API
Free Belgian rail API with no key: stations, live departures, connections and vehicle tracking for NMBS/SNCB trains, with real-time delays. Tested example.
Endpoint tested and returned HTTP 200 on 2026-08-20
What is the iRail (Belgium) API?
iRail is a free, key-free API for Belgian railways, providing station lists, live departure boards, journey connections and individual train tracking for the NMBS/SNCB network, including real-time delay information.
iRail has been running as an open project for well over a decade, wrapping the Belgian railway operator's data in a clean REST interface with real-time delays rather than just scheduled times.
The maintainers ask that you send a descriptive User-Agent identifying your application. This is a volunteer-run service in front of an operator's system, so identifying yourself and caching are genuine courtesies rather than formalities.
Quick facts
- Base URL
https://api.irail.be- Authentication
- No API key, but a descriptive User-Agent identifying your application is requested.
- Rate limit
- No published hard limit; the project asks for reasonable use and caching.
- Pricing
- Free and open source.
- CORS
- Not enabled — call it from your server
- Official docs
- Read the docs
How to use the iRail (Belgium) API
Every request below was executed against the live API on 2026-08-20, and the response shown is the real body it returned — not an illustration.
1. List Belgian railway stations
GET https://api.irail.be/v1/stations?format=json
curl 'https://api.irail.be/v1/stations?format=json'const res = await fetch("https://api.irail.be/v1/stations?format=json");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);import requests
res = requests.get("https://api.irail.be/v1/stations?format=json", timeout=20)
res.raise_for_status()
print(res.json()){
"version": "1.4",
"timestamp": "1787176810",
"station": [
{
"@id": "http://irail.be/stations/NMBS/008400319",
"id": "BE.NMBS.008400319",
"name": "'s Hertogenbosch",
"locationX": "5.294278",
"locationY": "51.69042",
"standardname": "'s Hertogenbosch"
},
{
"@id": "http://irail.be/stations/NMBS/008015345",
"id": "BE.NMBS.008015345",
"name": "Aachen Hbf",
"locationX": "6.105275",
"locationY": "50.770832",
"standardname": "Aachen Hbf"
},
{
"@id": "http://irail.be/stations/NMBS/008015199",
"id": "BE.NMBS.008015199",
"name": "Aachen West",
"locationX": "6.07055",
"locationY": "50.78078",
"standardname": "Aachen West"
},
{
"@id": "http://irail.be/stations/NMBS/008895000",
"id": "BE.NMBS.008895000",
"name": "Aalst",
"locationX": "4.039653",
"locationY": "50.942813",
"standardname": "Aalst"
},
{
"@id": "http://irail.be/stations/NMBS/008895125",
"id": "BE.NMBS.008895125",
"name": "Aalst-Kerrebroek",
"locationX": "4.024407",
"locationY": "50.948377",
"standardname": "Aalst-Kerrebroek"
},
{
"@id": "http://irail.be/stations/NMBS/008891140",
"id": "BE.NMBS.008891140",
"name": "Aalter",
"locationX": "3.447848",
"locationY": "51.092295",
"standardname": "Aalter"
},
{
"@id": "http://irail.be/stations/NMBS/008833209",
"id": "BE.NMBS.008833209",
"name": "Aarschot",
"locationX": "4.824043",
"loParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
v1/stations | path | Optional | All stations on the network. v1/stations |
v1/liveboard | path | Optional | Live departures for a station. v1/liveboard?station=Brussels-Central |
v1/connections | path | Optional | Journey planning between two stations. v1/connections?from=X&to=Y |
format | string | Optional | json or xml. Default is XML. json |
lang | string | Optional | nl, fr, en or de. en |
Response fields
versionstring- API version.
timestampstring- Unix timestamp of the response.
stationarray- Stations with id, name and coordinates.
station[].@idstring- Linked-data URI identifying the station.
station[].locationX / locationYstring- Longitude and latitude, as strings.
(liveboard) departures.departure[].delaystring- Delay in seconds.
(liveboard) departures.departure[].timestring- Scheduled departure as a Unix timestamp.
What you can build with the iRail (Belgium) API
- Build a Belgian train departure board
- Add journey planning to a travel app
- Alert commuters to delays on a specific route
- Analyse punctuality across the Belgian network
Common errors and how to fix them
XML instead of JSON
XML is the default format.
Fix: Always pass format=json.
Station name not recognised
Names vary by language.
Fix: Fetch /v1/stations first and use the exact name or the station id.
Coordinates as strings
locationX and locationY are strings.
Fix: Parse before plotting; note locationX is longitude.
iRail (Belgium) API — frequently asked questions
Is the iRail API free?
Yes, free with no API key. The maintainers ask that you send a descriptive User-Agent identifying your application and that you cache responses.
Does it include real-time delays?
Yes, liveboard departures include a delay field in seconds alongside the scheduled time, so it is genuine real-time data.
Why am I getting XML?
XML is the default. Pass format=json on every request.
Which languages are supported?
Dutch, French, English and German, matching Belgium's official languages. Station names differ between them, so specify `lang` consistently.
Tools that pair with this API
JSON Formatter
Format, beautify and minify JSON online with 2-space, 4-space or tab indentation. Sort keys alphabetically and catch syntax errors instantly — free and private.
Timestamp Converter
Convert timestamps to human-readable dates and dates back to timestamps. Auto-detects seconds vs milliseconds, shows local, UTC and ISO 8601 formats.
iRail (Belgium) is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-20; always check the official documentation before relying on this API in production, as terms and limits can change.