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

## getStatisticsConfig

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

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

### 描述

获取统计配置，获取开通智能计量的 DP 点及配置。

### 参数

`Params`

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

### 引用对象

##### `type` IDevId

仅含设备 ID 的请求体（如 `getStatisticsConfig`、`resetStatistics`）。

| 属性 | 类型 | 描述 |
| --- | --- | --- |
| `devId` | `string` | 设备 ID |


### 示例代码

#### 请求示例

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

getStatisticsConfig({
  devId: 'vdevo166789063330437',
})
  .then((response) => {
    console.log(response);
  })
  .catch();
```

#### 返回示例

```json
[
  {
    "storageDuration": 365,
    "productId": "lcrxzqjqojafatrv",
    "dpId": 18,
    "statisticInterval": 1,
    "algorithmType": "avg"
  },
  {
    "storageDuration": 365,
    "productId": "lcrxzqjqojafatrv",
    "dpId": 1,
    "statisticInterval": 1,
    "algorithmType": "count"
  },
  {
    "storageDuration": 7,
    "productId": "lcrxzqjqojafatrv",
    "dpId": 1,
    "statisticInterval": 2,
    "algorithmType": "count"
  }
]
```
