Query Real-time Locations of Multiple Devices

Last Updated on : 2023-06-15 04:58:04

Query the real-time locations of multiple devices by device ID.

API address

GET: /v2.0/iot-01/tracks/location

Request parameter

Parameter name Type IN Required Description
device_ids String query true The list of up to 50 device IDs, separated with commas (,).
coord_type String query false Indicates the type of longitude and latitude positioning coordinate system. Valid values:
  • WGS84: Google Coordinate System.
  • GCJ02: AutoNavi.
  • BD09LL: Baidu.
  • Empty value: defaults to AutoNavi for China data center, and Google for other data centers.

Return parameter

Parameter name Type Description
result DeviceLocationRes

Description of result

Parameter name Type Description
device_location_list List

Description of device_location_list

Parameter name Type Description
device_id String The device ID.
lon Double The longitude.
lat Double The latitude.
speed Double The speed. Unit: kilometers/hour. The magnification conversion has been completed.
protocol String The positioning type. Valid values: GPS, WIFI, and LBS.
report_time Long The 13-bit timestamp when the positioning is reported. Unit: milliseconds.

Request example

GET: /v2.0/iot-01/tracks/location?device_ids=vdevo16245017293****

Return example

{ "result": { "device_location_list": [ { "device_id": "vdevo16245017293****", "lon": 114.003117, "speed": 100, "protocol": "GPS", "lat": 22.594031, "timestamp": 1625198100154 } ] }, "t": 1625231971657, "success": true }

Error code

For more information, see error code.