Guides
Guides

How to get a list of safety cameras along a route

This section provides an example of a request for a list of all static and live safety cameras along a route from London to Windsor.

📘

Note

Each request requires authentication with a valid bearer token in the HTTP authorization header. For more information about obtaining credentials, see the Identity and Access Management - Developer Guide.

Sample request

The following code block provides the complete request:

POST /v2/search HTTP/1.1
Host: safetycameras.cit.cc.api.here.com
Authorization: Bearer eyJhbGceOyJSAMPLEiIsImN0eSISAMPLEt7VTFIllwIM0cKNCjN2WCCTqlwEEmk-t3gx1BpqUFoeBSAMPLEvhj8nl-RBGcyoljY...
Cache-Control: no-cache
Accept: application/json
Content-Type: application/json
{
  "corridor": [
   {
      "lng":-0.15380859375,
      "lat":51.49506473014368
   },
   {
      "lng":-0.20050048828125,
      "lat":51.492499698989036
   },
   {
      "lng":-0.232086181640625,
      "lat":51.513870548723986
   },
   {
      "lng":-0.270538330078125,
      "lat":51.52327054772943
   },
   {
      "lng":-0.34332275390625,
      "lat":51.53437713632629
   },
   {
      "lng":-0.37078857421875,
      "lat":51.5429188223739
   },
   {
      "lng":-0.391387939453125,
      "lat":51.53779400311784
   },
   {
      "lng":-0.39276123046875,
      "lat":51.517288954651846
   },
   {
      "lng":-0.40924072265625,
      "lat":51.49762961696847
   },
   {
      "lng":-0.4449462890625,
      "lat":51.49335472541077
   },
   {
      "lng":-0.484771728515625,
      "lat":51.49335472541077
   },
   {
      "lng":-0.542449951171875,
      "lat":51.49335472541077
   },
   {
      "lng":-0.57952880859375,
      "lat":51.48565891027458
   },
   {
      "lng":-0.6097412109375,
      "lat":51.477106480966924
   }
  ],
  "width": 2000
}

Sample response

The HTTP status code is 200 and the response contains a list of static and live safety cameras, where each camera has its own unique id, location, and type, alongside other properties as defined in Response data types.

{
    "safetyCameras": [
        {
            "id": "23642_3_GBR",
            "country": "GBR",
            "positions": [
                {
                    "latitude": 51.568904876709,
                    "longitude": -0.240258768200874,
                    "drivingDirection": 241
                },
                {
                    "latitude": 51.5466804504395,
                    "longitude": -0.267343759536743,
                    "drivingDirection": 235
                }
            ],
            "cameraType": "Average",
            "speedLimit": {
                "value": 40,
                "unit": "MPH"
            },
            "directionType": "Same",
            "openLR": [
                "CINGARAAg0GDO//USCSr3AAJBQQBA..."
            ]
        },
        {
            "id": "AAAAAACOClc_GBR",
            "country": "GBR",
            "positions": [
                {
                    "latitude": 51.61791,
                    "longitude": -0.2534,
                    "drivingDirection": 148
                }
            ],
            "cameraType": "Mobile",
            "directionType": "Both",
            "length": {
                "value": 600,
                "unit": "Meter"
            },
            "openLR": [
                "CC8BEAIrJv/QNiS2xQA...",
                "CC8BEAIrJv/UBySyigA..."
            ],
            "timestamp": "2021-01-19T06:04:42.07Z"
        },
        ... (remaining safety cameras removed to shorten document)
    ]
}