Data drop – Car Parks & JamCams

In my previous post on Roads Open Data I outlined the importance of providing quality data for London’s roads, particularly at a time when our Road Modernisation Plan is being implemented and we are urging drivers to check for disruption before they travel.

We continue to make improvements to our roads open data, with London Underground live car parking spaces availability now available through the Unified API, as well as live video JamCams that give a far better indication of how traffic is flowing in the Capital.

London Underground car parks

London Underground has over 60 car parks with over 11,000 spaces. With the help of our partners NCP and SmartParking, we have released live data showing available spaces for 25 of these car parks. We are seeing whether we can expand the feed to cover all London Underground car parks in the future.

We don’t have this showing on tfl.gov.uk yet, but we’ve made the feed available as open data in the Unified API so that the dev community can have a head start.

You can get the full list of Car Parks from the Places API, which can also be searched by lat/long bounding box or radius. For each car park, we return information such as the address, opening hours, payment methods and facilities, and in some cases, the live occupancy. In the example below, Barkingside Station car park, the OccupancyUrl is returned, indicating that live data is available.

{
  "id": "CarParks_800491",
  "url": "https://api.tfl.gov.uk/Place/CarParks_800491",
  "commonName": "Barkingside Stn (LUL)",
  "placeType": "CarPark",
  "additionalProperties": [
  {
    "category": "Description",
    "key": "NumberOfSpaces",
    "sourceSystemKey": "CarParks",
    "value": "46",
    "modified": "2016-01-07T15:45:43.153"
  },
  {
    "category": "Description",
    "key": "NumberOfDisabledBays",
    "sourceSystemKey": "CarParks",
    "value": "2",
    "modified": "2016-01-07T15:45:43.153"
  },
  {
    "category": "Meta",
    "key": "OccupancyUrl",
    "sourceSystemKey": "CarParks",
    "value": "https://api.tfl.gov.uk/Occupancy/CarPark/CarParks_800491",
    "modified": "2016-01-07T15:45:43.153"
  }...

The URL is based on the place id of the car park, for example “CarParks_800491” so if you know the Car Park id, you can go straight to the occupancy data. We use a separate URL because we have a much shorter time-to-live in our cache for the occupancy vs. the place data (60 seconds and 1 day respectively). In the example below, using Barkingside again, we can see that there’s no spaces available right now.

{
 "id": "CarParks_800491",
 "bays": [
    {
     "bayType": "Disabled",
     "bayCount": 2,
     "free": 0,
     "occupied": 2
    },
    {
     "bayType": "Pay and Display Parking",
     "bayCount": 45,
     "free": 0,
     "occupied": 45
    }
  ],
  "name": "Barkingside Stn (LUL)",
  "carParkDetailsUrl": "https://api.tfl.gov.uk/Place/CarParks_800491"
}

The JamCams are retrieved from the Places API, which can be searched by lat/long, for items of type “JamCam”.

All of the information about a given camera available from the JSON API response is also included in the EXIF headers of both the videos and images. In addition, the EXIF “User Comments” field contains JSON formatted metadata: direction (a description of the orientation of the camera), the corridor on which the camera is located and the availability of the camera.

In the example above, this is an available camera with orientation “West (twds Parliament Square)” and corridor ”Southern River Route”. If your app directly references the video by id it may be easier to retrieve this metadata from the EXIF header rather than also calling the Places API separately.

The video clips and images will normally update every five minutes. However, if a camera is in use by our control centre, the video will not be updated. Published clips will never be more than 15 minutes old – if they are, they are replaced by a blanking image. We’re currently seeing availability of around 90% (out of 950 cameras), though this will vary depending on what is occurring on the transport network.

Legacy data feeds

We’ll be turning off the legacy data feed in future so please register on the developer portal and use the new Unified API. We’ll give developers a heads up in advance, but please start the process of migrating any of your existing apps as soon as you can. A minor change will occur even before the legacy feed is disabled, the file nomenclature for the images has changed slightly – from “0000107500.jpg” to “00001.07500.jpg” (there is an extra period in the filename that brings it in line with the video naming convention).

We’d love to find out what you’re building with this data, what is most useful to you and if you feel that anything important is missing from the Unified API. Please let us know what you think, or ask any questions you have on our roads data in the comments below.

13 Comments

    1. Hi Andy I believe we met at the AWS Loft event and you had some questions about the jam cams feed. If you send your contact details to [email protected], I’ll put you in touch with my colleague in Road Space Management who developed and supports the feed. Thanks!

  1. Very useful API and most importantly very useful data. An integration with payment system could have been great so overall parking time could be reduced.

    thanks

  2. Hi,
    Nice blog. But a small query. How can we get the car park id if we want to get car parking details based on car park id?

    1. Unfortunately occupancy data from SmartParking and NCP is only available for around 25 of the car parks.

    1. Unfortunately this is a limitation of the source systems. Not all car parks have the infrastructure in place to report their occupancy.

Leave a Reply to mulnopiravir Cancel reply

Your email address will not be published. Required fields are marked *