SmartCambridge API
Programmatic access to data held by the Smartcambridge project.
See the main API documentation for important information about using this API, in particular about the need for authentication.
aq
read
Return metadata for a single station identified by station_id.
Path Parameters
The following parameters should be included in the URL path.
| Parameter | Description |
|---|---|
station_id required | Air quality sensor station id (e.g. 'S-1134') |
history > read
Return historic data for a single sensor identified by sensor_type on a station identified by station_id for a particular month.
Path Parameters
The following parameters should be included in the URL path.
| Parameter | Description |
|---|---|
station_id required | Air quality station id (e.g. 'S-1134') |
sensor_type required | Air quality sensor id (e.g. 'NO2') |
month required | The month for which to return data. YYYY-MM (e.g. '2016-06') |
parking
read
Return the metadata for a single car park identified by parking_id.
Path Parameters
The following parameters should be included in the URL path.
| Parameter | Description |
|---|---|
parking_id required | Car park identifier (e.g. 'grafton-east-car-park') |
history > read
Return historic car park occupancy data for a single car park identified by parking_id. Data is returned in 24-hour chunks from start_date to end_date inclusive. A most 31 day's data can be retrieved in a single request.
Path Parameters
The following parameters should be included in the URL path.
| Parameter | Description |
|---|---|
parking_id required | Car park identifier (e.g. 'grafton-east-car-park') |
Query Parameters
The following parameters should be included as part of a URL query string.
| Parameter | Description |
|---|---|
start_date required | Start date for returned data. YYYY-MM-DD (e.g. '2018-01-01') |
end_date | End date for returned data. YYYY-MM-DD (e.g. '2018-01-15'). Defaults to start_date and must be no more than 31 days from start_date |
latest > read
Return most recent car park occupancy data for the car park identified by parking_id.
Path Parameters
The following parameters should be included in the URL path.
| Parameter | Description |
|---|---|
parking_id required | Car park identifier (e.g. 'grafton-east-car-park') |
previous > read
Return previous most recent car park occupancy data for the car park identified by parking_id.
Path Parameters
The following parameters should be included in the URL path.
| Parameter | Description |
|---|---|
parking_id required | Car park identifier (e.g. 'grafton-east-car-park') |
traffic
btjourney > history > read
Return historic journey time data for the 'link' (journey segment between a pair of sensors) or 'route' (journey segments built from multiple links) identified by id. Data is returned in 24-hour chunks from start_date to end_date inclusive. At most 31 day's data can be retrieved in a single request.
Links and routes are occasionally added. This endpoint might return journey time data for links or routes for which metadata is not yet available.
Path Parameters
The following parameters should be included in the URL path.
| Parameter | Description |
|---|---|
id required | Identifier for a link or route (e.g. 'CAMBRIDGE_JTMS|9800W1CHALH6' or 'CAMBRIDGE_JTMS|9800WMBVAGBF') |
Query Parameters
The following parameters should be included as part of a URL query string.
| Parameter | Description |
|---|---|
start_date required | Start date for returned data. YYYY-MM-DD (e.g. '2018-01-01') |
end_date | End date for returned data. YYYY-MM-DD (e.g. '2018-01-15'). Defaults to start_date and must be no more than 31 days from start_date |
btjourney > latest > list
Return most recent journey times for all currently monitored 'links' (journey segments between pairs of sensors) and 'routes' (journey segments built from multiple links)
Links and routes are occasionally added. This endpoint might return journey time data for links or routes for which metadata is not yet available.
btjourney > latest > read
Return most recent journey time data for the 'link' (journey segment between a pair of sensors) or 'route' (journey segments built from multiple links) identified by id.
Links and routes are occasionally added. This endpoint might return journey time data for links or routes for which metadata is not yet available.
Path Parameters
The following parameters should be included in the URL path.
| Parameter | Description |
|---|---|
id required | Identifier for a link or route (e.g. 'CAMBRIDGE_JTMS|9800W1CHALH6' or 'CAMBRIDGE_JTMS|9800WMBVAGBF') |
btjourney > link > list
List metadata for all known 'links' (journey segments between pairs of sensors).
Links are added and removed from the monitoring system from time to time so journey time data will not be available for all of these links all of the time.
btjourney > link_or_route > read
Return the metadata for a single 'link' (journey segment between a pair of sensors) or 'route' (journey segments built from multiple links) identified by id.
Links and routes are added and removed from the monitoring system from time to time so journey time data will not necessarily be available for this links or route all of the time.
Path Parameters
The following parameters should be included in the URL path.
| Parameter | Description |
|---|---|
id required | Identifier for a link or route (e.g. 'CAMBRIDGE_JTMS|9800W1CHALH6' or 'CAMBRIDGE_JTMS|9800WMBVAGBF') |
btjourney > route > list
List metadata for all known 'routes' (journey segments built from multiple links).
Routes are added and removed from the monitoring system from time to time so journey time data will not be available for all of these routes all of the time.
btjourney > site > read
Return the metadata for a single sensor 'site' identified by site_id.
Path Parameters
The following parameters should be included in the URL path.
| Parameter | Description |
|---|---|
site_id required | Site identifier (e.g. '{0D7C672E-EEE9-4924-815E-B49CC382DFFA}') |
zone > read
Return the metadata for a single zone identified by zone_id.
Path Parameters
The following parameters should be included in the URL path.
| Parameter | Description |
|---|---|
zone_id required | Zone identifier (e.g. 'east_road_in') |
zone > history > read
Return historic zone data for the single zone identified by zone_id. Data is returned in 24-hour chunks from start_date to end_date inclusive. A most 31 day's data can be retrieved in a single request.
Path Parameters
The following parameters should be included in the URL path.
| Parameter | Description |
|---|---|
zone_id required | Zone identifier (e.g. 'east_road_in') |
Query Parameters
The following parameters should be included as part of a URL query string.
| Parameter | Description |
|---|---|
start_date required | Start date for returned data. YYYY-MM-DD (e.g. '2018-01-01') |
end_date | End date for returned data. YYYY-MM-DD (e.g. '2018-01-15'). Defaults to start_date and must be no more than 31 days from start_date |
transport
journey > read
Return information about the vehicle journey identified by id.
Path Parameters
The following parameters should be included in the URL path.
| Parameter | Description |
|---|---|
id required | Journey identifier (e.g. 'ea-20-PR2-_-y08-1-429-UL') |
journeys > list
Return a list of all known vehicle journeys.
Query Parameters
The following parameters should be included as part of a URL query string.
| Parameter | Description |
|---|---|
page | A page number within the paginated result set (e.g. 2). Default 1 |
page_size | Number of results to return per page. (e.g. 10). Default 25, maximum 50. |
line | Limit results to journeys whose 'line name' is this. (e.g. 'Universal U') |
operator | Limit results to journeys whose operator name or operator code is this. (e.g. 'Whippet Coaches' or 'WHIP') |
journeys_by_time_and_stop > list
Return the timetabled vehicle journeys expected for a given stop identified by stop_id from a specific date and time identified by datetime_from (optional, default = now).
All results are paginated based on nresults and a next attribute is returned containing the URL to use to retrieve more results. The pagination can return up to nresults or less if there are no more results for a day, for example.
Query Parameters
The following parameters should be included as part of a URL query string.
| Parameter | Description |
|---|---|
stop_id required | Stop atco_code (e.g. '0500CCITY111') |
datetime_from | Start datetime or time for returned results. If time is given insetad of a datetime, today is used as date. Defaults to now. YYYY-MM-DDTHH:MM:SS or HH:MM:SS (e.g. '2018-06-01T12:00:00') |
nresults | Maximum number of journeys to return, default 10. (e.g. 20) |
expand_journey | Expands the resulting journey into a full journey object |
stop > read
Return information about the bus stop identified by atco_code.
Path Parameters
The following parameters should be included in the URL path.
| Parameter | Description |
|---|---|
atco_code required | Stop atco_code (e.g. '0500CCITY111') |
stops > list
Return a list of bus stops.
Query Parameters
The following parameters should be included as part of a URL query string.
| Parameter | Description |
|---|---|
page | A page number within the paginated result set (e.g. 2). Default 1 |
page_size | Number of results to return per page. (e.g. 10). Default 50, maximum 200. |
search | Limit results to stops that contain this text somewhere within their stop_id, common_name or locality_name fields (e.g. 'madingley') |
ordering | Field to sort results by. One of 'atco_code', 'common_name', or 'locality_name'. |
bounding_box | Limit results to stops within a bounding box, specified as 'southwest_lng,southwest_lat,northeast_lng,northeast_lat', (e.g. '0.08,52.20,0.11,52.21') |