# 监控任务投放分析

## 接口信息

- **接口名称**: 监控任务投放分析
- **请求方法**: POST
- **接口地址**: `open-api/v1/monitor/data`
- **接口路径**: `/v3/api/ad-monitor-task/ad-deep-analysis`
- **接口描述**:
    - 获取监控任务的广告深度投放分析数据
    - 支持按天或按时段进行深度分析
    - 提供广告投放的详细分析报告
    - 价格说明: `免费`

**请求头:**

- Content-Type: application/json
- Accept: application/json

## 请求参数

### 请求结构

| 参数名 | 类型   | 描述                        | 示例                                | 必填 | 默认值 |
| ------ | ------ | --------------------------- | ----------------------------------- | ---- | ------ |
| key    | string | 用户申请的外部 api 请求 key | "your_api_key_here"                 | 是   |        |
| uri    | string | 接口路径                    | "/v3/api/ad-monitor-task/ad-deep-analysis" | 是   |        |
| params | object | 接口入参对象                | 见参数列表                          | 是   |        |

### 请求体参数 (params 对象)

| 参数名               | 类型     | 必填   | 描述    |
|-------------------|--------|------|-------|
| task_id           | string  | true | 任务id  |
| dimension           | integer   | true | 分析维度, 1:按天, 2:按时段|


### 请求示例

```bash
curl -X POST "https://www.pipispy.com/open-api/v1/monitor/data" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "key": "your_api_key_here",
    "uri": "/v3/api/ad-monitor-task/ad-deep-analysis",
    "params": {
      "task_id": "68fa2e36789edb5700215e03",
      "dimension": 1
    }
  }'
```

## 响应参数

### 响应体结构

```json
{
  "code": 200,
  "message": "success",
  "data": {},
  "version": "v1",
  "timestamp": null,
  "sign": null,
  "remaining_credits": 9980,
  "consumed_credits": 0,
  "fail": false,
  "success": true
}
```

### 响应字段说明

| 字段名    | 类型    | 描述                     |
| --------- | ------- | ------------------------ |
| code      | Integer | 响应状态码，200 表示成功 |
| message   | String  | 响应消息                 |
| data      | Object  | 响应数据                 |
| version   | String  | API 版本                 |
| timestamp | String  | 响应时间戳               |
| sign      | String  | 响应签名                 |
| remaining_credits | Long    | 当前请求后的剩余可用积分 |
| consumed_credits  | Long    | 本次请求消耗的积分 |
| success   | Boolean | 请求是否成功             |
| fail      | Boolean | 请求是否失败             |

### 响应结果信息字段

| 字段名  | 类型               | 描述                |
|------|------------------|-------------------|
| dimension |     integer         | 分析维度(1:按天, 2:按时段) |
| time1 |     string          | 周一/6-9小时          |
| time1_ad_count |     integer           | 广告总数              |
| time1_proportion |     integer           | 广告占比（百分比）         |
| time2 |     integer           | 周二/9-12小时         |
| time2_ad_count |     integer           | 广告总数              |
| time2_proportion |     integer           | 广告占比（百分比）         |
| time3 |     string            | 周三/12-15小时        |
| time3_ad_count |     integer             | 广告总数              |
| time3_proportion |     integer             | 广告占比（百分比）         |
| time4 |     string              | 周四/15-18小时        |
| time4_ad_count |     integer               | 广告总数              |
| time4_proportion |     integer               | 广告占比（百分比）         |
| time5 |     string                | 周五/18-21小时        |
| time5_ad_count |     integer                 | 广告总数              |
| time5_proportion |     integer                 | 广告占比（百分比）         |
| time6 |     string                  | 周六/21-23小时        |
| time6_ad_count |     integer                   | 广告总数              |
| time6_proportion |     integer                   | 广告占比（百分比）         |
| time7 |     string                    | 周日/23-6小时         |
| time7_ad_count |     integer                     | 广告总数              |
| time7_proportion |     integer                     | 广告占比（百分比）              |


## 响应示例

```json
{
  "code": 200,
  "message": "success",
  "data": {
    "time1_proportion": 21.02,
    "time3_proportion": 18.95,
    "time4_ad_count": 1634,
    "time7_ad_count": 1354,
    "time3_ad_count": 2726,
    "time5_proportion": 14.0,
    "time6_ad_count": 682,
    "time2_ad_count": 2950,
    "time1": "Monday",
    "time2": "Tuesday",
    "time7_proportion": 9.41,
    "time2_proportion": 20.51,
    "time3": "Wednesday",
    "time5_ad_count": 2014,
    "time4": "Thursday",
    "time4_proportion": 11.36,
    "time6_proportion": 4.74,
    "time5": "Friday",
    "time1_ad_count": 3023,
    "dimension": 2,
    "time6": "Saturday",
    "time7": "Sunday"
  },
  "version": "v1",
  "timestamp": null,
  "sign": null,
  "remaining_credits": 9980,
  "consumed_credits": 0,
  "fail": false,
  "success": true
}
```

## 错误码说明

| 错误码 | 描述           |
| ------ | -------------- |
| 200    | 成功           |
| 400    | 请求参数错误   |
| 500    | 服务器内部错误 |
