Get started
  • English
  • 简体中文
Official Site
Get started
  • English
  • 简体中文
Official Site
  • Get started
  • Concepts
  • Guides
  • Device capabilities & events
  • API reference
    • Public conventions
    • Development specification
    • accessToken: Get administrator token
    • API request example
    • Error codes
    • Interface call limits
    • Account docking
    • Device APIs
    • Device live broadcast
    • Push configuration
    • Cloud storage service
    • Resource pool quota
    • AI analysis
      • pictureDetect: Picture detection
      • detectDeviceSnap: Device snapshot detection
    • AI Insight
    • Legacy APIs (deprecated)
  • SDK and tools
  • Solutions
  • Platform and support
On this page
What it does
Request URL
Minimum permission
Request parameters
Sample input
Response data fields
Sample output
Error codes
Related

detectDeviceSnap (Device snapshot detection)

detectDeviceSnap: Device snapshot detection

What it does

Captures one frame from a bound device channel and runs cloud AI detection on that image. Use this when you want the platform to grab the scene instead of supplying your own URL or Base64.

This API detects humans, vehicles, animals, and packages.

The device must be online and bound to your developer account. Respect snapshot rate limits similar to setDeviceSnapEnhanced; do not call in a tight loop.

Request URL

POST https://openapi-[DataCenter].easy4ip.com/openapi/detectDeviceSnap

Minimum permission

Administrator accessToken; the device must be on your developer account.

Request parameters

Parameter nameParameter typeRequired or notParameter description
tokenStringYesAdministrator accessToken
deviceIdStringYesDevice serial number
channelIdStringYesChannel ID

Common request fields and signing: Signing conventions and Common request payload.

Sample input

{
  "id": "98a7a257-c4e4-4db3-a2d3-d97a3836b87c",
  "system": {
    "ver": "1.0",
    "appId": "lcdxxxxxxxxx",
    "sign": "b7e5bbcc6cc07941725d9ad318883d8e",
    "time": 1599013514,
    "nonce": "fbf19fc6-17a1-4f73-a967-75eadbc805a2"
  },
  "params": {
    "token": "At_12345678901234567890123456789012",
    "deviceId": "TESTQWERXXXX",
    "channelId": "0"
  }
}

Response data fields

Parameter nameParameter typeParameter description
urlStringImage URL
detectResultBooleanWhether a target was detected
targetsArrayDetected targets
targets[].targetRegionObjectTarget region in px
targets[].targetRegion.xDoubleX coordinate
targets[].targetRegion.widthDoubleWidth
targets[].targetRegion.heightDoubleHeight
targets[].targetTypeStringTarget type: human, vehicle, animal, box
targets[].confidenceIntegerConfidence score

Sample output

{
  "result": {
    "msg": "Success.",
    "code": "0",
    "data": {
      "url": "https://example.com/snap/sample.jpg",
      "detectResult": true,
      "targets": [
        {
          "targetRegion": {
            "x": 120.0,
            "width": 64.0,
            "height": 96.0
          },
          "targetType": "human",
          "confidence": 85
        }
      ]
    }
  },
  "id": "98a7a257-c4e4-4db3-a2d3-d97a3836b87c"
}

Error codes

Offline, unbound devices or snapshot failures may return DV family codes. See Error codes.

Related

  • AI analysis
  • pictureDetect
  • setDeviceSnapEnhanced
pictureDetect: Picture detection
bindDeviceAiInsight: Enable AI Insight package