A Java wrapper for the PubliBike API to fetch informations about the bicycles.
On the official website of PubliBike you can find a map with all stations and the specific amount of vehicles at those stations (here). So I found out that the map is using 2 public endpoints which can be used to gather informations about the stations and vehicles.
These are the endpoints I've discovered:
GET https://api.publibike.ch/v1/public/stations
GET https://api.publibike.ch/v1/public/stations/{ID}
<dependency>
<groupId>ch.phatec</groupId>
<artifactId>publibike</artifactId>
<version>1.5</version>
</dependency>
Fetch all stations.
PublibikeService service = new PublibikeService();
List<Station> stations = service.getStations();
Fetch one station.
PublibikeService service = new PublibikeService();
Long stationId = 100L;
Station station = service.getStation(stationId);
Get all vehicles at a station.
PublibikeService service = new PublibikeService();
Long stationId = 100L;
Station station = service.getStation(stationId);
List<Vehicle> vehicles = station.getVehicles();