├── Access the data.md ├── Additions to GBFS.md ├── README.md ├── Sharedmobility.ch-API.md └── providers.csv /Access the data.md: -------------------------------------------------------------------------------- 1 | # Access the data 2 | 3 | Sharedmobility.ch aggregates the data of shared mobility providers in near real-time. The data is available as: 4 | 5 | * [GBFS 2.3 endpoint](https://github.com/SFOE/sharedmobility/blob/main/Access%20the%20data.md#gbfs-23-endpoint) 6 | * [GBFS 2.0 endpoint](https://github.com/SFOE/sharedmobility/blob/main/Access%20the%20data.md#gbfs-20-endpoint) 7 | * [Web-Service (API)](https://github.com/SFOE/sharedmobility/blob/main/Access%20the%20data.md#web-service) 8 | 9 | **Terms of use**: Open use. Must provide the source. 10 | 11 | * You may use this dataset for non-commercial purposes. 12 | * You may use this dataset for commercial purposes. 13 | * You must provide the source (author, title and link to the dataset). 14 | 15 | See [opendata.swiss](https://opendata.swiss/en/dataset/standorte-und-verfugbarkeit-von-shared-mobility-angeboten) for more information. 16 | 17 | 18 | ## GBFS 2.3 endpoint 19 | 20 | GBFS 2.3 endpoint: 21 | [sharedmobility.ch/v2](https://sharedmobility.ch/v2/) 22 | 23 | :warning: **Please note that a valid email is required in the Authorization header as followed:** 24 | ``` 25 | curl -H "Authorization: gbfs@sharedmobility.ch" -i "https://sharedmobility.ch/v2/" 26 | or 27 | https://sharedmobility.ch/v2/gbfs?Authorization=gbfs@sharedmobility.ch 28 | ``` 29 | 30 | ## GBFS 2.0 endpoint 31 | 32 | GBFS 2.0 endpoint: 33 | [sharedmobility.ch/gbfs.json](https://sharedmobility.ch/gbfs.json) 34 | 35 | Please check the differences to GBFS 2.0 made to support multiple systems in one feed: 36 | 37 | [Additions to GBFS](https://github.com/SFOE/sharedmobility/blob/main/Additions%20to%20GBFS.md) 38 | 39 | ## Web-Service 40 | 41 | See [Access sharedmobility.ch data using the REST API](https://github.com/SFOE/sharedmobility/blob/main/Sharedmobility.ch-API.md) 42 | 43 | ## Service status 44 | 45 | See [Service status](https://stats.uptimerobot.com/xx6M9cLVN3) for uptime information. 46 | -------------------------------------------------------------------------------- /Additions to GBFS.md: -------------------------------------------------------------------------------- 1 | # Additions to GBFS 2 | 3 | Sharedmobility.ch is based on the [General Bikeshare Feed Specification (GBFS)](https://github.com/NABSA/gbfs/blob/v2.0/gbfs.md) Version 2.0. 4 | GBFS is optimized to represent one single system. In order to represent multiple systems in one feed, the following additions to GBFS V2.0 were made: 5 | 6 | ⚠️ **Additions were only made to GBFS 2.0 endpoint. Please use [GBFS 2.3](https://github.com/SFOE/sharedmobility/blob/main/Access%20the%20data.md#gbfs-23-endpoint) which is 100% GBFS compliant!** 7 | 8 | ## Add providers.json 9 | 10 | [Providers.json](https://sharedmobility.ch/providers.json) was added as an additional JSON-File to the GBFS-Feed. Providers.json describes metainformation of every system. Fields are identical to system_information.json. The following fields were added: 11 | 12 | * provider_id was added (see also [List of shared mobility providers](https://github.com/SFOE/sharedmobility/blob/main/providers.csv)). 13 | * vehicle_type is added. The following vehicle types are possible: Bike, E-Bike, CargoBike, E-CargoBike, Scooter, E-Scooter, Moped, E-Moped, Car, E-Car, Taxi, E-Taxi, Other, E-Other 14 | 15 | ## Changes in station_information.json 16 | 17 | * The field station_id comprises the merged fields provider_id and station_id 18 | * provider_id is added to stations as followed: 19 | ```json 20 | { 21 | "last_updated" : 1605098383, 22 | "ttl" : 60, 23 | "version" : "2.0", 24 | "data" : { 25 | "stations" : [ { 26 | "station_id" : "carvelo2go:e4d4f78a-861d-49a9-c216-be6e288dec5a", 27 | "name" : "8610 im Stadtpark ", 28 | "lat" : 47.34867, 29 | "lon" : 8.71413, 30 | "address" : "Landihalle", 31 | "region_id" : "carvelo2go:936ccc56-80e6-441f-959b-da5747118c61", 32 | "post_code" : "8610", 33 | "provider_id" : "carvelo2go" 34 | } 35 | ``` 36 | 37 | ## Changes in station_status.json 38 | 39 | * The field station_id comprises the merged fields provider_id and station_id 40 | * provider_id is added to stations as followed: 41 | ```json 42 | { 43 | "last_updated" : 1605098165, 44 | "ttl" : 60, 45 | "version" : "2.0", 46 | "data" : { 47 | "stations" : [ { 48 | "station_id" : "donkey_thun:17447", 49 | "num_bikes_available" : 0, 50 | "num_docks_available" : 25, 51 | "last_reported" : 1605096513, 52 | "provider_id" : "donkey_thun" 53 | } 54 | ``` 55 | 56 | ## Changes in free_bike_status.json 57 | 58 | * The field bike_id comprises the merged fields provider_id and bike_id 59 | * provider_id is added to bikes as followed: 60 | ```json 61 | { 62 | "last_updated" : 1605099018, 63 | "ttl" : 60, 64 | "version" : "2.0", 65 | "data" : { 66 | "bikes" : [ { 67 | "bike_id" : "airbie-6759c:IszKSTulW6rLO0cJ", 68 | "lat" : 47.17566, 69 | "lon" : 8.515347, 70 | "is_disabled" : 0, 71 | "is_reserved" : 0, 72 | "provider_id" : "airbie-6759c" 73 | } 74 | ``` 75 | 76 | ## Changes in geofencing_zones.json 77 | 78 | * provider_id is added to the properties of a geofencing zone as followed: 79 | ```json 80 | "properties" : { 81 | "name" : "Bond Zürich", 82 | "rules" : [ 83 | { 84 | "ride_allowed" : "true", 85 | "ride_trough_allowed" : "true" 86 | } 87 | ], 88 | "provider_id" : "bond_ch" 89 | } 90 | ``` 91 | 92 | ## Differences 93 | * According to GBFS V2 the field bike_id in free_bike_status.json has to be rotated to a random string, at a minimum, after each trip to protect privacy. This is not fully supported by all providers. 94 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # sharedmobility.ch 2 | In Switzerland, ever greater numbers of people are travelling longer distances and more frequently. Travel currently accounts for over a third of the total energy use in the country. Simply extending the transport infrastructure to cope with this is not a viable solution long term. New approaches and better information are needed in order to make mobility more efficient. Mobility as a Service (MaaS) is a concept in which means of transport such as cars, scooters, bikes etc. are not so much seen as private property but are instead used as a service as required – and can then be made available to other users. Known as multi-modal mobility, this system encompassing all mobility service providers can only operate properly if real-time data is available and interlinked. 3 | 4 | [sharedmobility.ch](https://sharedmobility.ch) is the national shared mobility platform and shows location and availability of all participating shared mobility providers. The data shown on the map is also available as [Open Data](https://opendata.swiss/en/dataset/standorte-und-verfugbarkeit-von-shared-mobility-angeboten). 5 | 6 | This documentation guides you to all sharedmobility.ch ressources. 7 | * [Access the data](https://github.com/SFOE/sharedmobility/blob/main/Access%20the%20data.md) 8 | * [List of shared mobility providers](https://github.com/SFOE/sharedmobility/blob/main/providers.csv) 9 | * [Additions to GBFS](https://github.com/SFOE/sharedmobility/blob/main/Additions%20to%20GBFS.md) 10 | 11 | Are you a shared mobility provider who is interested in showing shared mobility assets on sharedmobility.ch? Contact us on geoinformation@bfe.admin.ch 12 | -------------------------------------------------------------------------------- /Sharedmobility.ch-API.md: -------------------------------------------------------------------------------- 1 | # Access sharedmobility.ch data using the REST API 2 | The data of the [GBFS-endpoint](https://sharedmobility.ch/gbfs.json) of [sharedmobility.ch](https://www.sharedmobility.ch/) can be accessed with a RESTful API. 3 | Here we show you some examples how to query the API. 4 | 5 | ## General information 6 | * Swagger documentation: [api.sharedmobility.ch](https://api.sharedmobility.ch) 7 | 8 | ## Available endpoints 9 | * [GET attributes](https://github.com/SFOE/sharedmobility/blob/main/Sharedmobility.ch-API.md#get-attributes) 10 | * [GET find](https://github.com/SFOE/sharedmobility/blob/main/Sharedmobility.ch-API.md#get-find) 11 | * [GET identify](https://github.com/SFOE/sharedmobility/blob/main/Sharedmobility.ch-API.md#get-identify) 12 | * [GET providers](https://github.com/SFOE/sharedmobility/blob/main/Sharedmobility.ch-API.md#get-providers) 13 | * [GET regions](https://github.com/SFOE/sharedmobility/blob/main/Sharedmobility.ch-API.md#get-regions) 14 | 15 | ## GET attributes 16 | Use the [attributes](https://api.sharedmobility.ch/documentation#/v1/getAttributes) endpoint to receive a list with available filters for [find](https://github.com/SFOE/sharedmobility/blob/main/Sharedmobility.ch-API.md#get-find) and [identify](https://github.com/SFOE/sharedmobility/blob/main/Sharedmobility.ch-API.md#get-identify) endpoints. 17 | 18 | E.G: [Get all available attributes](https://api.sharedmobility.ch/v1/sharedmobility/attributes) 19 | ``` 20 | https://api.sharedmobility.ch/v1/sharedmobility/attributes 21 | ``` 22 | 23 | **Available attributes:** 24 | | Attribute | Description | 25 | | --------------- | --------- | 26 | | ch.bfe.sharedmobility.provider.id | Provider Id according to [providers.csv](https://github.com/SFOE/sharedmobility/blob/main/providers.csv) | 27 | | ch.bfe.sharedmobility.pickup_type | System mode (*free_floating* or *station_based*) | 28 | | ch.bfe.sharedmobility.vehicle_type | Vehicle type of a system | 29 | 30 | 31 | **Attributes to query station_based systems:** 32 | | Attribute | Description | 33 | | --------------- | --------- | 34 | | ch.bfe.sharedmobility.available | Availability of a station | 35 | | ch.bfe.sharedmobility.station.id | Id of a station | 36 | | ch.bfe.sharedmobility.station.postcode | ZIP code of a station. Note that not all stations have postcode information | 37 | | ch.bfe.sharedmobility.station.region.id | Id of a systems regions. Note that not all systems have region information | 38 | | ch.bfe.sharedmobility.station.status.installed | If *true* a station is installed on the street | 39 | | ch.bfe.sharedmobility.station.status.renting | If *true* a station is renting vehicles. Even if the station is empty | 40 | 41 | **Attributes to query free_floating systems:** 42 | | Attribute | Description | 43 | | --------------- | --------- | 44 | | ch.bfe.sharedmobility.vehicle.status.disabled | If *true* a vehicle is currently disabled | 45 | | ch.bfe.sharedmobility.vehicle.status.reserved | If *true* a vehicle is currently reserved | 46 | 47 | ## GET find 48 | Use the [find](https://api.sharedmobility.ch/documentation#/v1/getFind) endpoint for a fulltext search in *station name* and *station address*. 49 | 50 | E.G: [Get all stations with station name "ETH Hönggerberg"](https://api.sharedmobility.ch/v1/sharedmobility/find?searchText=ETH%20H%C3%B6nggerberg&searchField=ch.bfe.sharedmobility.station.name&offset=0&geometryFormat=esrijson) 51 | ``` 52 | https://api.sharedmobility.ch/v1/sharedmobility/find? 53 | searchText=ETH Hönggerberg 54 | &searchField=ch.bfe.sharedmobility.station.name 55 | &offset=0 56 | &geometryFormat=esrijson 57 | ``` 58 | 59 | E.G: [Get all stations from provider "Rent_a_bike" with station name "Bahnhof"](https://api.sharedmobility.ch/v1/sharedmobility/find?filters=ch.bfe.sharedmobility.provider.id%3Drent_a_bike&searchText=Bahnhof&searchField=ch.bfe.sharedmobility.station.name&offset=0&geometryFormat=esrijson) 60 | ``` 61 | https://api.sharedmobility.ch/v1/sharedmobility/find? 62 | filters=ch.bfe.sharedmobility.provider.id=rent_a_bike 63 | &searchText=Bahnhof 64 | &searchField=ch.bfe.sharedmobility.station.name 65 | &offset=0 66 | &geometryFormat=esrijson 67 | ``` 68 | 69 | E.G: [Get all stations with E-Bikes from provider "publiebike" with station name "Mittelstrasse"](https://api.sharedmobility.ch/v1/sharedmobility/find?filters=ch.bfe.sharedmobility.vehicle_type%3DE-Bike&filters=ch.bfe.sharedmobility.provider.id%3Dpubliebike&searchText=Mittelstrasse&searchField=ch.bfe.sharedmobility.station.name&offset=0&geometryFormat=esrijson ) 70 | ``` 71 | https://api.sharedmobility.ch/v1/sharedmobility/find? 72 | filters=ch.bfe.sharedmobility.vehicle_type=E-Bike 73 | &filters=ch.bfe.sharedmobility.provider.id=publiebike 74 | &searchText=Mittelstrasse 75 | &searchField=ch.bfe.sharedmobility.station.name 76 | &offset=0 77 | &geometryFormat=esrijson 78 | ``` 79 | ## GET identify 80 | Use the [identify](https://api.sharedmobility.ch/documentation#/v1/getIdentify) endpoint for spatial queries. 81 | 82 | E.G: [Get all available vehicles which are within 200m around point 8.72334 47.50024](https://api.sharedmobility.ch/v1/sharedmobility/identify?Geometry=8.72334%2C47.50024&Tolerance=200&offset=0&geometryFormat=esrijson) 83 | ``` 84 | https://api.sharedmobility.ch/v1/sharedmobility/identify? 85 | Geometry=8.72334,47.50024 86 | &Tolerance=200 87 | &offset=0 88 | &geometryFormat=esrijson 89 | ``` 90 | 91 | E.G: [Get all available E-Scooter which are within 500m around point 8.72334 47.50024](https://api.sharedmobility.ch/v1/sharedmobility/identify?filters=ch.bfe.sharedmobility.vehicle_type%3DE-Scooter&Geometry=8.72334%2C47.50024&Tolerance=500&offset=0&geometryFormat=esrijson) 92 | ``` 93 | https://api.sharedmobility.ch/v1/sharedmobility/identify? 94 | filters=ch.bfe.sharedmobility.vehicle_type=E-Scooter 95 | &Geometry=8.72334,47.50024 96 | &Tolerance=500 97 | &offset=0 98 | &geometryFormat=esrijson 99 | ``` 100 | 101 | 102 | E.G: [Get all available station-based E-Bikes which are within 5000m around 7.57699,47.55352](https://api.sharedmobility.ch/v1/sharedmobility/identify?filters=ch.bfe.sharedmobility.vehicle_type%3DE-Bike&filters=ch.bfe.sharedmobility.pickup_type%3Dstation_based&Geometry=7.57699%2C47.55352&Tolerance=5000&offset=0&geometryFormat=esrijson) 103 | ``` 104 | https://api.sharedmobility.ch/v1/sharedmobility/identify? 105 | filters=ch.bfe.sharedmobility.vehicle_type=E-Bike 106 | &filters=ch.bfe.sharedmobility.pickup_type=station_based 107 | &Geometry=7.57699,47.55352 108 | &Tolerance=5000 109 | &offset=0 110 | &geometryFormat=esrijson 111 | ``` 112 | 113 | Note: You can use the [SearchServer](https://api3.geo.admin.ch/services/sdiservices.html#search) of the [GeoAdmin API](https://sfoe.github.io/ApiDocumentation/GeoAdminAPI/) to get the coordinates of an address (see [step 1 of GeoAdmin documentation](https://github.com/SFOE/ApiDocumentation/blob/master/GeoAdminAPI_ExampleSonnendach.md#1-get-the-coordinates-of-an-address)). 114 | 115 | ## GET providers 116 | Use the [providers](https://api.sharedmobility.ch/documentation#/v1/getProviders) endpoint to get details about shared mobility providers. 117 | 118 | E.G: [Get a list of all providers](https://api.sharedmobility.ch/v1/sharedmobility/providers) 119 | ``` 120 | https://api.sharedmobility.ch/v1/sharedmobility/providers 121 | ``` 122 | 123 | E.G: [Get details of provider *donkey_thun*](https://api.sharedmobility.ch/v1/sharedmobility/providers) 124 | ``` 125 | https://api.sharedmobility.ch/v1/sharedmobility/providers/donkey_thun 126 | ``` 127 | Note: Provider_id is according to [providers.csv](https://github.com/SFOE/sharedmobility/blob/main/providers.csv) 128 | 129 | ## GET regions 130 | Use the [regions](https://api.sharedmobility.ch/documentation#/v1/getRegions) endpoint to get details about shared mobility regions. 131 | 132 | E.G: [Get a list of all regions](https://api.sharedmobility.ch/v1/sharedmobility/regions) 133 | ``` 134 | https://api.sharedmobility.ch/v1/sharedmobility/regions 135 | ``` 136 | 137 | E.G: [Get details of region *emobility:968*](https://api.sharedmobility.ch/v1/sharedmobility/regions/emobility%3A968) 138 | ``` 139 | https://api.sharedmobility.ch/v1/sharedmobility/regions/emobility:968 140 | ``` 141 | 142 | Note that not all systems have region information 143 | -------------------------------------------------------------------------------- /providers.csv: -------------------------------------------------------------------------------- 1 | Shared mobility provider,provider id,vehicle type,Update cycle (Time to load in seconds) 2 | 2EM Car Sharing,2em_cars,Car,300 3 | 2EM Car Sharing,2em_cars_e,E-Car,300 4 | Bird,bird-basel-escooter,E-Scooter,60s 5 | Bird,bird-kloten-escooter,E-Scooter,60s 6 | Bird,bird-winterthur,E-Scooter,60s 7 | Bird,bird-zurich-escooter,E-Scooter,60s 8 | Bolt,bolt_zurich,E-Scooter,10s 9 | Carvelo2go,carvelo2go,E-CargoBike,60s 10 | Donkey Republic,donkey_ge,Bike,60s 11 | Donkey Republic,donkey_le_locle,Bike,60s 12 | Donkey Republic,donkey_li,Bike,60s 13 | Donkey Republic,donkey_neuchatel,Bike,60s 14 | Donkey Republic,donkey_sion,Bike,60s 15 | Donkey Republic,donkey_thun,Bike,60s 16 | Donkey Republic,donkey_yverdon-les-bains,Bike,60s 17 | edrive carsharing,edrivecarsharing,E-Car,60s 18 | JM Fleets,bird-platform-partner-jmfleetswl-biel,E-Scooter,60s 19 | JM Fleets,bird-platform-partner-jmfleets-bulle,E-Scooter,60s 20 | LIEmobil,liemobil_liechtenstein_ebike,E-Bike,60s 21 | Lime,lime_basel_escooter,E-Scooter,10s 22 | Lime,lime_opfikon_ebike,E-Bike,10s 23 | Lime,lime_opfikon_escooter,E-Scooter,10s 24 | Lime,lime_uster_escooter,E-Scooter,10s 25 | Lime,lime_wetzikon_escooter,E-Scooter,10s 26 | Lime,lime_winterthur_escooter,E-Scooter,10s 27 | Lime,lime_zug_escooter,E-Scooter,10s 28 | Lime,lime_zurich_ebike,E-Bike,10s 29 | Lime,lime_zurich_escooter,E-Scooter,10s 30 | Mobility,mobility,Car,300s 31 | Mobility,emobility,E-Car,300s 32 | Nextbike,nextbike_ch,Bike,60s 33 | Pick-e-Bike,pickebike_aubonne_ebike,E-Bike,60s 34 | Pick-e-Bike,pickebike_basel_ebike,E-Bike,60s 35 | Pick-e-Bike,pickebike_basel_emoped,E-Moped,60s 36 | Pick-e-Bike,pickebike_fribourg_ebike,E-Bike,60s 37 | PubliBike,publibike,Bike,180s 38 | PubliBike,publiebike,E-Bike,180s 39 | Regivelo.ch,donkey_kreuzlingen,Bike,60s 40 | Share Birrer,share_birrer_ch,E-Car,300s 41 | Sponti-Car,sponticar,E-Car,60s 42 | TIER E-Scooter-Sharing,tier,E-Scooter,60s 43 | TIER E-Bike-Sharing, tier_ebike, E-Bike, 60s 44 | Velospot,velospot,Bike,60s 45 | VOI,voiscooters.com,E-Scooter,0s 46 | 47 | --------------------------------------------------------------------------------