iRail & BeTrains
@KevinVanWilder
iRail API /stations/
<stations timestamp="050810"> <station locationX="4.038586" locationY="50.1345678"> AALST </station> ... </stations>
iRail API /liveboard/?station=STATIONNAME
/liveboard/?id=BE.NMBS.1
<liveboard version="1.0“ timestamp="123456789"> <station locationX="4.21485" locationY="..."> GENT ST P [B] </station> <departures number="2"> <departure delay="xx" id="0"> <station locationX="..." locationY="..."> STATIONNAME </station> <vehicle> Be.NMBS.P2000 </vehicle> <time formatted="iso8601">U</time> <platform>X</platform> </departure> ... </departures> </liveboard>
iRail API
• Train schedules /connections/?to=STATION1&from=STATION2
• List all stations /stations/
• Station liveboard /liveboard/?station=STATIONNAME
• Vehicle information /vehicle/?id=Be.NMBS.P1234
0
2000
4000
6000
8000
10000
12000
14000
16000
18000
2/10/2010 2/11/2010 2/12/2010 2/01/2011
iRailForJ
IRail iRail = new IRail("http://api.irail.be","nl");
List<Connection> connections =
iRail.getConnections("LIEDEKERKE","BRUSSEL CENTRAAL");
for(Connection connection : connections) {
TripNode departure = connection.getDeparture();
TripNode arrival = connection.getArrival();
departure.getStation().getName() // Schaerbeek
departure.getVehicle().getType() // IC2367
departure.getDelay() // 60
}
Old: http://code.google.com/p/betrains/
New: http://code.google.com/p/betrains-android/
http://project.irail.be