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

## getCameraList

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

### 描述

获取家庭摄像头设备列表

### 参数

`Params`

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

### 引用对象

##### `type` QueryCameraListDto

| 属性 | 类型 | 必填 | 描述 |
| --- | --- | --- | --- |
| `homeId` | `string` | 是 | 家庭 id |
| `stockId` | `string` | 否 | 库存 id（可选） |
| `pids` | `string` | 否 | 产品 id 列表（可选，文档为产品筛选条件） |
| `ownerType` | `1 \| 0` | 否 | 归属维度：0 设备级，1 账号级 |
| `serviceCode` | `string` | 否 | 服务 code（可选） |
| `commodityCode` | `string` | 否 | 商品编码（可选） |
| `categoryCode` | `string` | 是 | 业务分类 code（必填） |

##### `type` ResBindDeviceDto

| 属性 | 类型 | 描述 |
| --- | --- | --- |
| `totalDevices` | `number` | 设备总数 |
| `bindDeviceNum` | `number` | 已绑定设备数量 |
| `list` | `BindDeviceInfo[]` | 设备数据列表 |


### 示例代码

#### 请求示例

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

getCameraList({ homeId: '194137', categoryCode: 'ipc' })
  .then((res) => console.log(res))
  .catch(console.error);
```

#### 返回示例

```json
{
  "totalDevices": 1,
  "bindDeviceNum": 1,
  "list": [
    {
      "uuid": "vdevo176127325226099",
      "name": "摄像头 1",
      "online": true,
      "iconUrl": "https://images.example.com/icon.png",
      "isBindCurrentService": true
    }
  ]
}
```
