---
name: "getOutdoorsTracksDetail"
mode: "kit"
versionRequirements:
  - { name: "@tuya-miniapp/cloud-api", version: "1.0.5" }
---

## getOutdoorsTracksDetail

> [VERSION] @tuya-miniapp/cloud-api >= 1.0.5

> 💡 该接口为云能力，需开通授权后使用，关于云能力可[查看文档](/cn/miniapp/common/desc/tech-stack/api)。
> 注意：目前云能力在「开发者工具」环境无法使用，需要打包后或真机调试使用。

### 描述

根据时间段获取设备轨迹点。结束时间与起始时间差小于等于 7 天，单次最多返回 1000 个轨迹点。如果时间段内的轨迹点数量大于 1000 则返回前 1000 个轨迹点以及下次查询的开始时间。为提升响应速度，同时避免轨迹点过多造成请求超时，建议缩短每次请求的时间区间，将轨迹拆分成多段进行拼接。

### 参数

`Params`

| 参数 | 类型 | 必填 | 默认值 | 描述 |
| --- | --- | --- | --- | --- |
| `data` | `GetOutdoorsTracksDetailParams` | 是 | - | 请求体 |

### 引用对象

##### `type` GetOutdoorsTracksDetailParams

| 属性 | 类型 | 描述 |
| --- | --- | --- |
| `deviceId` | `string` | 设备 ID |
| `startTime` | `number` | 开始时间 13 位时间戳 |
| `endTime` | `number` | 结束时间 13 位时间戳 |
| `coordType` | `string` | 经纬度定位坐标系类型：WGS84、GCJ02、BD09LL；不传时国内默认高德，国外默认谷歌 |
| `needRated` | `boolean` | 倍率转换 |

##### `interface` Point

| 属性 | 类型 | 描述 |
| --- | --- | --- |
| `id` | `number` | 点位 id |
| `mpId` | `number` | 移动点位 id |
| `coords` | `string` | 坐标串 |
| `pic` | `string` | 图片地址 |
| `encryption` | `IEncryption` | 路径点位坐标等敏感字段的加密信息 |

##### `interface` IEncryption

| 属性 | 类型 | 描述 |
| --- | --- | --- |
| `key` | `string` | 加密密钥 |


### 示例代码

#### 请求示例

```typescript
import { getOutdoorsTracksDetail } from '@tuya-miniapp/cloud-api';

getOutdoorsTracksDetail({
  deviceId: 'vdevo16245017293',
  startTime: 1625198100154,
  endTime: 1625198190154,
})
  .then((response) => {
    console.log(response);
  })
  .catch();
```

#### 返回示例

```json
{
  "deviceId": "vdevo16245017293****",
  "hasMore": false,
  "pointList": [
    {
      "lon": 114.003117,
      "battery": 100,
      "speed": 100,
      "protocol": "GPS",
      "lat": 22.594031,
      "mileage": 0,
      "timestamp": 1625198100154
    }
  ]
}
```
