MV Camera Intelligence - REST API Endpoints

MV Camera Intelligence provides a collection of endpoints available in the Dashboard API to interact with your Meraki cameras, areas, analytics, custom CV models and more!

Generating your API Key

First, login to the Meraki Dashboard:

  1. Navigate to Organization > Configure > API & Webhooks.
  2. Click on the API Keys and Access tab.
  3. Click the Generate API Key Button.
  4. You'll now see a pop-up with your API key.

NOTE: It is important that you copy this and keep it somewhere secure as you can only view it once.

Now that you have Dashboard API access, it’s time to enable MV Sense!

NOTE: MV Sense only needs enabling if you plan to use MQTT or Custom CV models on your camera. If you're planning to only use the API Endpoints for Presence Analytics, MV Sense doesn't need to be enabled.

  1. Start by navigating to Cameras > Monitor > Cameras and selecting the camera you would like to enable MV Sense on.
  2. Once the camera is selected, go to Settings > Sense.
  3. Click Enabled.*
  • If this is your organization’s first time using MV Sense, you will have 10 free perpetual licenses available to use. If you have exceeded this 10 free licence count, you must activate more licenses by navigating to Organization > Configure > License info and claiming more licenses.

REST API Endpoints

MV Camera Intelligence provides a collection of endpoints available in the Dashboard API to interact with your Meraki cameras, areas and analytics.

You can review the related MV endpoints below or for more information about the API and available SDKs, check out the official Dashboard API docs.

To understand the basics of the Meraki API, read this guide.

To understand how to use query parameters, read this guide.

For each of the below guides, to view the full input and documentation for that endpoint, refer to the "API Docs" within each section, this will contain the latest and most up to date information.

Presence Analytics Endpoints

GET Areas by Device

GET /organizations/{organizationId}/camera/boundaries/areas/byDevice
API Docs

 Returns all configured area boundaries of cameras
curl --request GET \
  --url https://api.meraki.com/api/v1/organizations/ORG-ID/camera/boundaries/areas/byDevice \
  --header 'Content-Type: application/json' \
  --header 'X-Cisco-Meraki-API-Key: API-KEY'
import requests
url = "https://api.meraki.com/api/v1/organizations/ORG-ID/camera/boundaries/areas/byDevice"
headers = {
    "Content-Type": "application/json",
    "X-Cisco-Meraki-API-Key": "API-KEY"
}
response = requests.get(url, headers=headers)
print(response.json())
[
  {
    "networkId": "L_682858293500086622",
    "serial": "Q2NV-NEWX-TE8U",
    "boundaries": [
      {
        "id": "682858293500052355",
        "type": "area",
        "name": "Untitled Area",
        "vertices": [
          {
            "x": 0.6177083333333333,
            "y": 0.4925925925925926
          },
          {
            "x": 0.71875,
            "y": 0.43148148148148147
          },
          {
            "x": 0.96875,
            "y": 0.43148148148148147
          },
          {
            "x": 0.96875,
            "y": 0.6814814814814815
          },
          {
            "x": 0.96875,
            "y": 0.9314814814814815
          },
          {
            "x": 0.71875,
            "y": 0.9314814814814815
          },
          {
            "x": 0.51875,
            "y": 0.9555555555555556
          },
          {
            "x": 0.503125,
            "y": 0.7407407407407407
          },
          {
            "x": 0.6177083333333333,
            "y": 0.4925925925925926
          }
        ]
      }
    ]
  }
]

What would you use it for?

  • This endpoint would be used to get every area configured on every camera within an Organization.
  • This is an endpoint to ONLY return the areas.
  • The coordinates of the zones are returned, allowing the user to plot the area on an image of the camera feed e.g. via Snapshot API

NOTE: To plot the bounding boxes or lines, the returned coordinates are in relation to the height and width of the frame. E.g. to plot an “x” point, you would use “x*width of frame”, and for a “y” point it would be “y*height of frame”.



GET Lines by Device

GET /organizations/{organizationId}/camera/boundaries/lines/byDevice
API Docs

 Returns all configured crossingline boundaries of cameras
curl --request GET \
  --url https://api.meraki.com/api/v1/organizations/ORG-ID/camera/boundaries/lines/byDevice \
  --header 'Content-Type: application/json' \
  --header 'X-Cisco-Meraki-API-Key: API-KEY'
import requests
url = "https://api.meraki.com/api/v1/organizations/ORG-ID/camera/boundaries/lines/byDevice"
headers = {
    "Content-Type": "application/json",
    "X-Cisco-Meraki-API-Key": "API-KEY"
}
response = requests.get(url, headers=headers)
print(response.json())
[
  {
    "networkId": "L_682858293500085161",
    "serial": "Q2LW-VZMD-MP27",
    "boundaries": [
      {
        "id": "3788653186525429771",
        "type": "line",
        "name": "Untitled Line",
        "vertices": [
          {
            "x": 0.4718374757575341,
            "y": 0.12764260071798963
          },
          {
            "x": 0.49472511450696677,
            "y": 0.4022942657111811
          },
          {
            "x": 0.49472511450696677,
            "y": 0.7033547446460257
          },
          {
            "x": 0.5246551036408401,
            "y": 0.8741317414687152
          }
        ],
        "directionVertex": {
          "x": 0.5290156085804579,
          "y": 0.5482238739014975
        }
      }
    ]
  }
]

What would you use it for?

  • This endpoint would be used to get every crossing line configured on every camera within an Organization.
  • This is an endpoint to ONLY return the lines.
  • The coordinates of the line are returned, allowing the user to plot the area on an image of the camera feed e.g. via Snapshot API

NOTE: To plot the bounding boxes or lines, the returned coordinates are in relation to the height and width of the frame. E.g. to plot an “x” point, you would use “x*width of frame”, and for a “y” point it would be “y*height of frame”.




GET Detections by Interval

GET /organizations/{organizationId}/camera/detections/history/byBoundary/byInterval
API Docs

 Returns analytics data for timespans
curl --request GET \
  --url 'https://api.meraki.com/api/v1/organizations/ORG-ID/camera/detections/history/byBoundary/byInterval?boundaryIds%5B%5D=682858293500052355&ranges%5B%5D%5BstartTime%5D=2024-03-12T00%3A00%3A00-06%3A00&ranges%5B%5D%5BendTime%5D=2024-03-13T00%3A00%3A00-06%3A00&ranges%5B%5D%5Binterval%5D=7200' \
  --header 'Content-Type: application/json' \
  --header 'X-Cisco-Meraki-API-Key: API-KEY'
import requests
url = "https://api.meraki.com/api/v1/organizations/ORG-ID/camera/detections/history/byBoundary/byInterval"
querystring = {"boundaryIds[]":"682858293500052355","ranges[][startTime]":"2024-03-12T00:00:00-06:00","ranges[][endTime]":"2024-03-13T00:00:00-06:00","ranges[][interval]":"7200"}

headers = {
    "Content-Type": "application/json",
    "X-Cisco-Meraki-API-Key": "API-KEY"
}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())
[
  {
    "boundaryId": "682858293500052355",
    "type": "areaoccupancy",
    "results": [
      {
        "startTime": "2024-03-12T06:00:00Z",
        "endTime": "2024-03-12T08:00:00Z",
        "objectType": "person",
        "in": 0
      },
      {
        "startTime": "2024-03-12T08:00:00Z",
        "endTime": "2024-03-12T10:00:00Z",
        "objectType": "person",
        "in": 0
      },
      {
        "startTime": "2024-03-12T10:00:00Z",
        "endTime": "2024-03-12T12:00:00Z",
        "objectType": "person",
        "in": 0
      },
      {
        "startTime": "2024-03-12T12:00:00Z",
        "endTime": "2024-03-12T14:00:00Z",
        "objectType": "person",
        "in": 9
      },
      {
        "startTime": "2024-03-12T14:00:00Z",
        "endTime": "2024-03-12T16:00:00Z",
        "objectType": "person",
        "in": 6
      },
      {
        "startTime": "2024-03-12T16:00:00Z",
        "endTime": "2024-03-12T18:00:00Z",
        "objectType": "person",
        "in": 5
      },
      {
        "startTime": "2024-03-12T18:00:00Z",
        "endTime": "2024-03-12T20:00:00Z",
        "objectType": "person",
        "in": 13
      },
      {
        "startTime": "2024-03-12T20:00:00Z",
        "endTime": "2024-03-12T22:00:00Z",
        "objectType": "person",
        "in": 12
      },
      {
        "startTime": "2024-03-12T22:00:00Z",
        "endTime": "2024-03-13T00:00:00Z",
        "objectType": "person",
        "in": 8
      },
      {
        "startTime": "2024-03-13T00:00:00Z",
        "endTime": "2024-03-13T02:00:00Z",
        "objectType": "person",
        "in": 1
      },
      {
        "startTime": "2024-03-13T02:00:00Z",
        "endTime": "2024-03-13T04:00:00Z",
        "objectType": "person",
        "in": 0
      },
      {
        "startTime": "2024-03-13T04:00:00Z",
        "endTime": "2024-03-13T06:00:00Z",
        "objectType": "person",
        "in": 0
      }
    ]
  }
]

What would you use it for?

  • This endpoint allows querying of timespans with a custom interval to pull all the relevant information for a specific area/line.
  • This endpoint can return the same data for multiple boundaries, for the same time periods/intervals in a single request
  • This is the endpoint to use for all area/line data querying.

NOTE: As shown in the code examples above, the time parameters should follow the ISO 8601 format. Timezone offsets are supported as long as they're encoded properly.




Custom CV/MV Sense Endpoints

GET Custom CV Settings by Camera

GET /devices/{serial}/camera/customAnalytics
API Docs

 Return custom analytics settings for a camera
curl --request GET \
  --url https://api.meraki.com/api/v1/devices/SERIAL/camera/customAnalytics \
  --header 'Content-Type: application/json' \
  --header 'X-Cisco-Meraki-API-Key: API-KEY'
import requests
url = "https://api.meraki.com/api/v1/devices/SERIAL/camera/customAnalytics"
headers = {
    "Content-Type": "application/json",
    "X-Cisco-Meraki-API-Key": "API-KEY"
}
response = requests.get(url, headers=headers)
print(response.json())
{
  "enabled": true,
  "artifactId": "682858293500051606",
  "parameters": [
    {
      "name": "detection_threshold",
      "value": 0.3
    }
  ]
}

What would you use it for?

  • Getting the current model Artifact and any additional Custom CV settings related to the model on a specific camera



PUT Custom CV Settings by Camera

PUT /devices/{serial}/camera/customAnalytics
API Docs

 Update custom analytics settings for a camera
curl --request PUT \
  --url https://api.meraki.com/api/v1/devices/SERIAL/camera/customAnalytics \
  --header 'Content-Type: application/json' \
  --header 'X-Cisco-Meraki-API-Key: API-KEY' \
  --data '  {
  "enabled": true,
  "artifactId": "3788653186525429765",
  "parameters": [
    {
      "name": "detection_threshold",
      "value": 0.4
    }
  ]
}'
import requests
url = "https://api.meraki.com/api/v1/devices/SERIAL/camera/customAnalytics"
payload = {
    "enabled": True,
    "artifactId": "3788653186525429765",
    "parameters": [
        {
            "name": "detection_threshold",
            "value": 0.4
        }
    ]
}
headers = {
    "Content-Type": "application/json",
    "X-Cisco-Meraki-API-Key": "API-KEY"
}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
{
  "enabled": true,
  "artifactId": "3788653186525429765",
  "parameters": [
    {
      "name": "detection_threshold",
      "value": 0.4
    }
  ]
}

What would you use it for?

  • Updating the settings on a camera for Custom CV, this includes the model and the threshold.



GET MV Sense Settings by Camera

GET /devices/{serial}/camera/sense
API Docs

 Returns sense settings for a given camera
curl --request GET \
  --url https://api.meraki.com/api/v1/devices/SERIAL/camera/sense \
  --header 'Content-Type: application/json' \
  --header 'X-Cisco-Meraki-API-Key: API-KEY'
import requests
url = "https://api.meraki.com/api/v1/devices/SERIAL/camera/sense"
headers = {
    "Content-Type": "application/json",
    "X-Cisco-Meraki-API-Key": "API-KEY"
}
response = requests.get(url, headers=headers)
print(response.json())
{
  "senseEnabled": true,
  "mqttBrokerId": "682858293500052084",
  "mqttTopics": [
    "/merakimv/SERIAL/raw_detections",
    "/merakimv/SERIAL/light",
    "/merakimv/SERIAL/custom_analytics"
  ],
  "audioDetection": {
    "enabled": false
  },
  "detectionModelId": "0"
}

What would you use it for?

  • Getting the current MV Sense settings for a camera, including the MQTT broker and topics it is publishing on.



PUT MV Sense Settings by Camera

PUT /devices/{serial}/camera/sense
API Docs

 Update sense settings for the given camera
curl --request PUT \
  --url https://api.meraki.com/api/v1/devices/SERIAL/camera/sense \
  --header 'Content-Type: application/json' \
  --header 'X-Cisco-Meraki-API-Key: API-KEY' \
  --data '  {
  "senseEnabled": true,
  "mqttBrokerId": "682858293500052084",
  "audioDetection": {
    "enabled": true
  },
  "detectionModelId": "0"
}
'
import requests
url = "https://api.meraki.com/api/v1/devices/SERIAL/camera/sense"
payload = {
    "senseEnabled": True,
    "mqttBrokerId": "682858293500052084",
    "audioDetection": { "enabled": True },
    "detectionModelId": "0"
}
headers = {
    "Content-Type": "application/json",
    "X-Cisco-Meraki-API-Key": "API-KEY"
}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
{
  "senseEnabled": true,
  "mqttBrokerId": "682858293500052084",
  "mqttTopics": [
    "/merakimv/SERIAL/raw_detections",
    "/merakimv/SERIAL/light",
    "/merakimv/SERIAL/audio_detections",
    "/merakimv/SERIAL/audio_analytics",
    "/merakimv/SERIAL/custom_analytics"
  ],
  "audioDetection": {
    "enabled": true
  },
  "detectionModelId": "0"
}

What would you use it for?

  • Updating the MV Sense settings of a camera, including the MQTT broker which is being published to.
  • Enabling or disabling MV sense, or Audio Detection



GET MV Default Detection Models

GET /devices/{serial}/camera/sense/objectDetectionModels
API Docs

Returns the MV Sense object detection model list for the given camera
curl --request GET \
  --url https://api.meraki.com/api/v1/devices/SERIAL/camera/sense/objectDetectionModels \
  --header 'Content-Type: application/json' \
  --header 'X-Cisco-Meraki-API-Key: API-KEY'
import requests
url = "https://api.meraki.com/api/v1/devices/SERIAL/camera/sense/objectDetectionModels"
headers = {
    "Content-Type": "application/json",
    "X-Cisco-Meraki-API-Key": "API-KEY"
}
response = requests.get(url, headers=headers)
print(response.json())
[
  {
    "id": "0",
    "description": "Body & vehicle"
  }
]

What would you use it for?

  • Getting the possible out of the box models that can be run on a device, along with a description.



GET Custom CV Artifacts

GET /organizations/{organizationId}/camera/customAnalytics/artifacts
API Docs

 List Custom Analytics Artifacts
curl --request GET \
  --url https://api.meraki.com/api/v1/organizations/ORG-ID/camera/customAnalytics/artifacts \
  --header 'Content-Type: application/json' \
  --header 'X-Cisco-Meraki-API-Key: API-KEY'
import requests
url = "https://api.meraki.com/api/v1/organizations/ORG-ID/camera/customAnalytics/artifacts"
headers = {
    "Content-Type": "application/json",
    "X-Cisco-Meraki-API-Key": "API-KEY"
}
response = requests.get(url, headers=headers)
print(response.json())
[
  {
    "artifactId": "3788653186525429762",
    "organizationId": "ORG-ID",
    "name": "test2",
    "status": {
      "type": "error",
      "message": "Failed to process the upload: unknown artifact type, please ensure your upload matches artifact specification"
    }
  },
  {
    "artifactId": "3788653186525429763",
    "organizationId": "ORG-ID",
    "name": "test 3",
    "status": {
      "type": "error",
      "message": "Failed to process the upload: contains unexpected files: ['__MACOSX/._model.tflite']"
    }
  },
  {
    "artifactId": "682858293500051606",
    "organizationId": "ORG-ID",
    "name": "newcat",
    "status": {
      "type": "ready",
      "message": null
    }
  },
  {
    "artifactId": "3788653186525429764",
    "organizationId": "ORG-ID",
    "name": "Test 4",
    "status": {
      "type": "ready",
      "message": null
    }
  }
]

What would you use it for?

  • Getting a list of Custom CV models which have been uploaded for the organization with their name, status and artifact ID.



GET Custom CV Artifact Details

GET /organizations/{organizationId}/camera/customAnalytics/artifacts/{artifactId}
API Docs

 Get Custom Analytics Artifact
curl --request GET \
  --url https://api.meraki.com/api/v1/organizations/ORG-ID/camera/customAnalytics/artifacts/682858293500051606 \
  --header 'Content-Type: application/json' \
  --header 'X-Cisco-Meraki-API-Key: API-KEY'
import requests
url = "https://api.meraki.com/api/v1/organizations/ORG-ID/camera/customAnalytics/artifacts/682858293500051606"
headers = {
    "Content-Type": "application/json",
    "X-Cisco-Meraki-API-Key": "API-KEY"
}
response = requests.get(url, headers=headers)
print(response.json())
{
  "artifactId": "682858293500051606",
  "organizationId": "ORG-ID",
  "name": "newcat",
  "status": {
    "type": "ready",
    "message": null
  }
}

What would you use it for?

  • Getting more information about a specific artifact, rather than the whole organization’s artifacts.



DELETE Custom CV Artifact

DELETE /organizations/{organizationId}/camera/customAnalytics/artifacts/{artifactId}
API Docs

Delete Custom Analytics Artifact
curl --request DELETE \
  --url https://api.meraki.com/api/v1/organizations/ORG-ID/camera/customAnalytics/artifacts/3788653186525429763 \
  --header 'Content-Type: application/json' \
  --header 'X-Cisco-Meraki-API-Key: API-KEY'
import requests
url = "https://api.meraki.com/api/v1/organizations/ORG-ID/camera/customAnalytics/artifacts/3788653186525429763"
headers = {
    "Content-Type": "application/json",
    "X-Cisco-Meraki-API-Key": "API-KEY"
}
response = requests.delete(url, headers=headers)
print(response.json())
204 No Content

What would you use it for?

  • Deleting a Custom CV artifact which exists in the Organization



Snapshot API

POST /devices/{serial}/camera/generateSnapshot
API Docs

Generate a snapshot of what the camera sees at the specified time and return a link to that image.
curl --request POST \
  --url https://api.meraki.com/api/v1/devices/SERIAL/camera/generateSnapshot \
  --header 'Content-Type: application/json' \
  --header 'X-Cisco-Meraki-API-Key: API-KEY'
import requests
url = "https://api.meraki.com/api/v1/devices/SERIAL/camera/generateSnapshot"
headers = {
    "Content-Type": "application/json",
    "X-Cisco-Meraki-API-Key": "API-KEY"
}
response = requests.post(url, headers=headers)
print(response.json())
{
  "url": "https://spn30.meraki.com/stream/jpeg/snapshot/97fce14ee1862d88VHMmZiMGE1ZjUyZTY2ZWZkZTk2YzA2Yzc1NDAyNTJiYjc0NmI5NzJlYmJjOGZiY2VmMGNkMjA2MTAwNGIzNTBkOQMk_8U7axi0F5DGres7xXDnVoSO9uurMWp5KTMLykgWEdse8dCIfllnxrm2aNwt4sLD6XGMM_AlD3WuttHS5zuTUXVhemOFv2gTbC_aw7jB19vKUKQJXAChH04Gz6BATKF3lrI7VZL5fUvKavCkHMUeJVzS_9YgPk__fsaCxApYkO_c7NwJ9VNk-bGYmYR_gK3-NpaIgQC-ql6xNivpProg4olg-NG-O8eUIT89wwQt",
  "expiry": "Access to the image will expire at 2024-03-25T11:19:31-07:00"
}

What would you use it for?

  • Getting the current view of the camera, or a timestamped view of a camera programmatically.
  • This endpoint will provide a URL which links to a hosted image pulled from the camera and hosted in the Meraki cloud for 1 hour. NOTE: Timestamp as a parameter is unavailable for MV2



Deprecated Endpoints

Zones

Dashboard API Doc
Replaced By:
GET /organizations/{organizationId}/camera/boundaries/lines/byDevice
GET /organizations/{organizationId}/camera/boundaries/areas/byDevice

GET /devices/[serial]/camera/analytics/zones

Returns all configured analytic zones for this camera.
curl --request GET \
  --url https://api.meraki.com/api/v1/devices/SERIAL/camera/analytics/zones \
  --header 'Content-Type: application/json' \
  --header 'X-Cisco-Meraki-API-Key: API-KEY'
import requests
url = "https://api.meraki.com/api/v1/devices/SERIAL/camera/analytics/zones"
headers = {
    "Content-Type": "application/json",
    "X-Cisco-Meraki-API-Key": "API-KEY"
}
response = requests.get(url, headers=headers)
print(response.json())
[
  {
    "zoneId": "0",
    "type": "occupancy",
    "label": "Full Frame",
    "regionOfInterest": {
      "x0": "0.00",
      "y0": "0.00",
      "x1": "1.00",
      "y1": "1.00"
    }
  },
  {
    "id": "3788653186525429807",
    "type": "line",
    "name": "Kitchen/Bathroom",
    "vertices": [
      {
        "x": 0.6294896392836284,
        "y": 0.9973769814721916
      },
      {
        "x": 0.6629405124507513,
        "y": 0.9034790122220954
      },
      {
        "x": 0.7192788251532737,
        "y": 0.7250728706469125
      },
      {
        "x": 0.7386451201447658,
        "y": 0.646824562938499
      }
    ],
    "directionVertex": {
      "x": 0.7138176251661731,
      "y": 0.8369394441708031
    }
  },
  {
    "id": "3788653186525429808",
    "type": "area",
    "name": "Tables New",
    "vertices": [
      {
        "x": 0.07083333333333333,
        "y": 0.44814814814814813
      },
      {
        "x": 0.24375,
        "y": 0.4111111111111111
      },
      {
        "x": 0.3875,
        "y": 0.5074074074074074
      },
      {
        "x": 0.41458333333333336,
        "y": 0.7555555555555555
      },
      {
        "x": 0.4197916666666667,
        "y": 0.9962962962962963
      },
      {
        "x": 0.31979166666666664,
        "y": 1
      },
      {
        "x": 0.06979166666666667,
        "y": 1
      },
      {
        "x": 0.06979166666666667,
        "y": 0.75
      },
      {
        "x": 0.07083333333333333,
        "y": 0.44814814814814813
      }
    ]
  }
]

What would you use it for?

  • This endpoint is used for getting the current zones and lines on the camera, as well as the coordinates of the zone in the frame.
  • A user could use the response in this endpoint to virtually map the boundaries onto the video outside of dashboard.
  • This endpoint will return the new Areas as well as Zones.



Analytics Overview

Dashboard API Doc
Replaced By: GET /organizations/{organizationId}/camera/detections/history/byBoundary/byInterval

GET /devices/[serial]/camera/analytics/overview

Returns an overview of aggregate analytics data for a timespan
curl --request GET \
  --url 'https://api.meraki.com/api/v1/devices/SERIAL/camera/analytics/overview?t0=2024-03-10T15%3A00%3A00.000Z&t1=2024-03-10T19%3A00%3A00.000Z&objectType=person' \
  --header 'Content-Type: application/json' \
  --header 'X-Cisco-Meraki-API-Key: API-KEY'
import requests
url = "https://api.meraki.com/api/v1/devices/SERIAL/camera/analytics/overview"
querystring = {"t0":"2024-03-10T15:00:00.000Z","t1":"2024-03-10T19:00:00.000Z","objectType":"person"}
headers = {
    "Content-Type": "application/json",
    "X-Cisco-Meraki-API-Key": "API-KEY"
}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())
[
  {
    "startTs": "2024-03-10T15:00:00.000Z",
    "endTs": "2024-03-10T19:00:00.000Z",
    "zoneId": 0,
    "entrances": 2089,
    "averageCount": 0.07539999999999998
  }
]

What would you use it for?

  • To get a single overview of detections on a single camera for a set time period.
  • You can set ‘timespan’ to do a time period back from now or ‘t0’ and ‘t1’ for a set historical period.
  • Time should be set in ISO 8601 and are given in UTC time



History

Dashboard API Doc
Replaced By: GET /organizations/{organizationId}/camera/detections/history/byBoundary/byInterval


GET /devices/[serial]/camera/analytics/zones/[zoneId]/history

Return historical records for analytic zones aggregated per minute.
curl --request GET \
  --url 'https://api.meraki.com/api/v1/devices/SERIAL/camera/analytics/zones/3788653186525429808/history?t0=2024-02-23T00%3A00%3A00&t1=2024-02-23T05%3A00%3A00' \
  --header 'Content-Type: application/json' \
  --header 'X-Cisco-Meraki-API-Key: API-KEY'
import requests
url = "https://api.meraki.com/api/v1/devices/SERIAL/camera/analytics/zones/3788653186525429808/history"
querystring = {"t0":"2024-02-23T00:00:00","t1":"2024-02-23T05:00:00"}
payload = "  "
headers = {
    "Content-Type": "application/json",
    "X-Cisco-Meraki-API-Key": "API-KEY"
}
response = requests.get(url, data=payload, headers=headers, params=querystring)
print(response.json())
[
    {
        "startTs": "2018-08-15T18:32:38.123Z",
        "endTs": "2018-08-15T18:33:38.123Z",
        "entrances": 5,
        "averageCount": 1.5
    }
]

What would you use it for?

  • This endpoint would return the number of crossings or people/vehicles counted per 60 seconds for the specified time period.
  • This endpoint can use “timespan” allowing you to specify a period before the current time to use for the query.

NOTE: Zone ID is a mandatory field in the URL. Ensure to replace it with a valid Zone ID from the camera you are requesting

NOTE: This is only valid for querying the old Zones, which can no longer be created. Use the replacement endpoint listed above.

NOTE: This endpoint allows a parameter of “resolution”, however there is only 1 valid value of 60.




Recent

Dashboard API Doc

GET /devices/[serial]/camera/analytics/recent/[zoneId]

Returns most recent record for analytics zone.
  curl --request GET \
  --url https://api.meraki.com/api/v1/devices/SERIAL/camera/analytics/recent \
  --header 'Content-Type: application/json' \
  --header 'X-Cisco-Meraki-API-Key: API-KEY'
import requests
url = "https://api.meraki.com/api/v1/devices/SERIAL/camera/analytics/recent"
headers = {
    "Content-Type": "application/json",
    "X-Cisco-Meraki-API-Key": "API-KEY"
}
response = requests.get(url, headers=headers)
print(response.json())
[
  {
    "zoneId": 0,
    "startTs": "2024-03-13T18:08:57.085Z",
    "endTs": "2024-03-13T18:09:57.085Z",
    "entrances": 9,
    "averageCount": 0.021
  }
]

What would you use it for?

  • This will get the most recent record which was sent to dashboard for the analytics data.



Live

Dashboard API Doc

GET /devices/[serial]/camera/analytics/live/[zoneId]

Returns live state from camera of analytics zones
curl --request GET \
  --url https://api.meraki.com/api/v1/devices/SERIAL/camera/analytics/live \
  --header 'Content-Type: application/json' \
  --header 'X-Cisco-Meraki-API-Key: API-KEY'
import requests
url = "https://api.meraki.com/api/v1/devices/SERIAL/camera/analytics/live"
payload = "  "
headers = {
    "Content-Type": "application/json",
    "X-Cisco-Meraki-API-Key": "API-KEY"
}
response = requests.get(url, data=payload, headers=headers)
print(response.json())
{
  "ts": "2024-03-13T16:34:08.241Z",
  "zones": {
    "0": {
      "person": 1
    }
  }
}

What would you use it for?

  • The goal of this endpoint is to provide a current “live” look at what is happening in the frame of the camera, as well as all areas individually.
  • It will return the current count of people in each zone.

NOTE: This endpoint will not work if new “Areas” have been created. This only works for cameras with no areas, or with the old implementation of zones.