CTS Client
Javascript client for CTS API (Compagnie des transports strasbourgeois). For more informations go to CTS Portail Open Data and API service
Installation
npm install cts-client
or
Usage
; const cts_client = 'my_api_key:';
API key information
The API key generated by the CTS portal looks something like this: my-api-key
. But to use the Javascript client you need to add a colon at the end of the string, which makes my-api-key:
Request timeout
const cts_client = 'my_api_key:' 10000; // default: 10000ms
Methods
Siri (tram and bus)
CTS
Velhop
Estimated Timetable
Estimated Timetable service is used to inform interested schedule information systems of the current status of all known VEHICLE JOURNEYs. All VEHICLE JOURNEYs currently running and all those that start in the hour are returned.
// ES6cts_client; cts_client; // ES5cts_client; cts_client;
Properties:
Property | Type | Require |
---|---|---|
vehicle_mode |
string |
false |
line_ref |
string |
false |
direction_ref |
string |
false |
Lines Discovery
Returns a list of all lines.
// ES6cts_client; // ES5cts_client;
Stop Monitoring
Stop Monitoring service provides a stop-centric view of VEHICLE departures (in realtime) at a list of designated stops.
// ES6cts_client; cts_client; // ES5cts_client; cts_client;
Properties:
Property | Type | Require |
---|---|---|
monitoring_ref |
string |
true |
vehicule_mode |
string |
false |
preview_interval |
string |
false |
start_time |
string |
false |
line_ref |
string |
false |
direction_ref |
number |
false |
maximum_stop_visits |
number |
false |
minimum_stop_visits_per_line |
number |
false |
Stop Points Discovery
Returns a list of stop points.
// ES6cts_client; cts_client; // ES5cts_client; cts_client;
Properties:
Property | Type | Require |
---|---|---|
latitude |
number |
false |
longitude |
number |
false |
distance |
number |
false |
Park and Ride
Returns a list of park and ride with available spots
// ES6cts_client; // ES5cts_client;
Retail Outlet
Returns a list of retail outlet
// ES6cts_client; cts_client; // ES5cts_client; cts_client;
Properties:
Property | Type | Require |
---|---|---|
ticket_sales |
boolean |
false |
badgeo_top_up |
boolean |
false |
types |
string |
false |
latitude |
number |
false |
longitude |
number |
false |
distance |
number |
false |
Retail Outlet Types
Returns a list of retail outlet types.
// ES6cts_client; // ES5cts_client;
Veloparc
Returns a list of veloparc.
// ES6cts_client; // ES5cts_client;
Velhop
Returns a list of velhop automatic stations and stores.
// ES6cts_client; // ES5cts_client;
Version update
CTS Client | REST API |
---|---|
2.0 |
1.0 |
1.0 |
1.0 |
License
MIT, see LICENSE for details.