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

## getOutdoorsTracksDetail

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

> 💡 This API is a cloud capability and requires authorization before use. For details on cloud capabilities, see the [documentation](/cn/miniapp/common/desc/tech-stack/api).
> Note: Currently, cloud capabilities are not available in the Developer Tools environment; you must package the app or debug on a real device.

### Description

Retrieve device track points by time range. The time span between start and end must be ≤ 7 days, and up to 1000 points are returned per request. If there are more than 1000 points in the period, the first 1000 points and the start time for the next query are returned. To improve response speed and avoid timeouts due to excessive points, shorten each request’s time window and split the track into segments for stitching.

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | `GetOutdoorsTracksDetailParams` | Yes | Request body |

### Return Value

Type: `Promise<GetOutdoorsTracksDetailResult>`

GetOutdoorsTracksDetailResult (see the type definition and minituya return table for field meanings)

##### GetOutdoorsTracksDetailResult

| Property | Type | Description |
| --- | --- | --- |
| `deviceId` | `string` | Device ID |
| `pointList` | `Point[]` | Track point list |
| `startTime` | `number` | Start timestamp for the next-page query |
| `hasMore` | `boolean` | Whether there is a next page |

### Referenced Types

##### `type` GetOutdoorsTracksDetailParams

| Property | Type | Description |
| --- | --- | --- |
| `deviceId` | `string` | Device ID |
| `startTime` | `number` | Start time, 13-digit timestamp |
| `endTime` | `number` | End time, 13-digit timestamp |
| `coordType` | `string` | Coordinate system type for geolocation: WGS84, GCJ02, BD09LL; if not provided, defaults to Amap in China and Google outside China. |
| `needRated` | `boolean` | Scale conversion |

##### `interface` Point

| Property | Type | Description |
| --- | --- | --- |
| `id` | `number` | Point ID |
| `mpId` | `number` | Moving point ID |
| `coords` | `string` | Coordinate string |
| `pic` | `string` | Image URL |
| `encryption` | `IEncryption` | Encryption info for sensitive fields such as path point coordinates |

##### `interface` IEncryption

| Property | Type | Description |
| --- | --- | --- |
| `key` | `string` | Encryption key |


### Examples

#### Request example

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

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

#### Response example

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