The Transport API allows interested developers to build their own applications using public timetable data, whether they're on the web, the desktop or mobile devices. The aim of the API is to cover public transport within Switzerland.
This is an implementation of the Open Data Transport API in Java.
For more information go to the official documentation:
OpenTransportClient client = new OpenTransportClient();
Hint: The number of HTTP requests you can send to transport.opendata.ch is limited to 3 requests per second per IP address.
String city = "Basel";
LocationResult result = client.getLocations(city, LocationType.All);
double x = 47.5476;
double y = 7.5897;
LocationResult result = client.getLocations(x, y, TransportationType.ICE_TGV_RJ);
String city1 = "Basel SBB";
String city2 = "Zurich";
ConnectionResult result = client.getConnections(city1, city2);
String city1 = "Basel SBB";
String city2 = "Zurich";
Date connectionDate = new Date(2016 - 1900, 1, 1, 15, 0, 0);
ConnectionParameter params = new ConnectionParameter(city1, city2);
params.setDateTime(connectionDate);
ConnectionResult result = client.getConnections(params);
StationboardParameter param = new StationboardParameter();
param.setStation(station);
param.setLimit(0);
StationboardResult result = client.getStationboard(param);
This framework has been developed by cansik for educational purpose.
Frameworks: