# Content Analysis – 分类趋势 API

**API:** Data API

**Endpoint:** `POST /v1/beta/dataforseo/content_analysis/category_trends/live`

**Tags:** DataForSEO

与 `post_dataforseo_content_phrase_trends_live` 相同的按周期指标，但针对整个产品类别而非单个关键词。`category_code` 取自 `get_dataforseo_content_categories`，`date_from`、`date_to` 和 `date_group` 设定范围与粒度；每个周期返回 `date`，以及 `total_count`、`rank`、`top_domains`（每项包含 `domain` 和 `count`）、`sentiment_connotations`（anger、happiness、love、sadness、share、fun）、`connotation_types`（positive、negative、neutral）、`text_categories`、`page_categories`、`page_types`、`countries` 和 `languages`。用它观察整个市场的走势，而非单个短语；当你已经明确关心确切措辞时，改用短语端点。

### 计费参考

- 计量方式：按上报的响应成本计量。
- 参考请求估算：0.0276 美元。
- 参考客户倍率：1.0。不得对已结算的客户金额再次应用。

仅供参考的元数据，不是账户报价、保证价格或消费上限。资源额度不同于 Felo 额度。最终扣费以 Felo 计费记录为准。

## Base URL

- `https://openapi.felo.ai`

## Authentication

- `FeloBearerAuth` (http bearer, bearer format Felo API Key)
- `FeloApiKey` (apiKey in header `X-API-Key`)

## Request body

Required: **no**

### application/json

Schema:

```json
{
  "type": "array",
  "items": {
    "type": [
      "object",
      "null"
    ],
    "oneOf": [
      {
        "type": "object",
        "properties": {
          "category_code": {
            "type": [
              "integer",
              "null"
            ],
            "description": "<em>目标类别代码</em><br><strong>必填字段</strong><br>如需获取完整的可用类别列表，请参阅 <a href=\"/v3/content_analysis/categories/\" rel=\"noopener noreferrer\" target=\"_blank\">Categories</a> 端点"
          },
          "page_type": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "<em>目标页面类型</em><br>可选字段<br>使用此参数按页面类型筛选数据集<br>可能的值： <br><code>\"ecommerce\"</code>、<code>\"news\"</code>、<code>\"blogs\"</code>、<code>\"message-boards\"</code>、<code>\"organization\"</code>"
          },
          "search_mode": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>结果分组类型</em><br>可选字段<br>可用的分组类型：<br><code>as_is</code> - 返回目标 <code>category_code</code> 的所有引用数据<br><code>one_per_domain</code> - 每个域名返回一条 <code>category_code</code> 的引用数据<br>默认值：<code>as_is</code>"
          },
          "internal_list_limit": {
            "type": [
              "integer",
              "null"
            ],
            "description": "<em>内部数组中的最大元素数量</em><br>可选字段<br>可使用此字段限制以下数组中的元素数量：<br><code>top_domains</code><br><code>text_categories</code><br><code>page_categories</code><br><code>countries</code><br><code>languages</code><br>默认值：<code>1</code><br>最大值：<code>20</code>"
          },
          "date_from": {
            "type": "string",
            "description": "<em>时间范围的开始日期</em><br><strong>必填字段</strong><br>最小值：<code>2022-10-31</code><br>日期格式：<code>\"yyyy-mm-dd\"</code><br>示例：<br><code>\"2019-01-15\"</code>"
          },
          "date_to": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>时间范围的结束日期</em><br>可选字段<br>如果未指定此字段，将默认使用今天的日期<br>日期格式：<code>\"yyyy-mm-dd\"</code><br>示例：<br><code>\"2019-01-15\"</code>"
          },
          "date_group": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>用于对结果进行分组的时间范围</em><br>可选字段<br>默认值：<code>month</code><br>可能的值：<code>day</code>、<code>week</code>、<code>month</code>"
          },
          "initial_dataset_filters": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": [
                "object",
                "null"
              ]
            },
            "description": "<em>初始数据集筛选参数</em><br>可选字段<br>适用于 <a href=\"/v3/content_analysis/search/live/?bash\" target=\"_blank\">Search 端点</a>中字段的初始筛选参数；<br><strong>可同时添加多个筛选条件（最多 8 个）</strong><br>应在条件之间设置逻辑运算符 <code>and</code>、<code>or</code><br>支持以下运算符：<br><code>regex</code>、<code>not_regex</code>、<code>&lt;</code>、<code>&lt;=</code>、<code>&gt;</code>、<code>&gt;=</code>、<code>=</code>、<code>&lt;&gt;</code>、<code>in</code>、<code>not_in</code>、<code>like</code>、<code>not_like</code>、<code>has</code>、<code>has_not</code>、<code>match</code>、<code>not_match</code><br>可在 <code>like</code> 和 <code>not_like</code> 中使用 <code>%</code> 运算符，匹配任意长度（零个或多个字符）的字符串<br>示例：<br><code>[\"domain\",\"&lt;&gt;\", \"logitech.com\"]</code><p><code>[[\"domain\",\"&lt;&gt;\",\"logitech.com\"],\"and\",[\"content_info.connotation_types.negative\",\"&gt;\",1000]]</code><p><code>[[\"domain\",\"&lt;&gt\",\"logitech.com\"]],<br>\"and\",<br>[[\"content_info.connotation_types.negative\",\"&gt;\",1000],<br>\"or\",<p>[\"content_info.text_category\",\"has\",10994]]]</code><br>有关筛选条件的更多信息，请参阅 <a href=\"/v3/content_analysis/filters\" target=\"_blank\" rel=\"noopener noreferrer\">Content Analysis API 的筛选条件</a><br>有关初始数据集筛选条件的更多信息，请参阅<a href=\"https://dataforseo.com/help-center/what-are-the-initial-dataset-filters-and-how-do-they-work\" rel=\"noopener noreferrer\" target=\"_blank\">这篇帮助中心文章。</a>"
          },
          "rank_scale": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>定义用于计算和显示 <code>rank</code> 值的量级</em><br>可选字段<p>可使用此参数选择 rank 值以 0–100 还是 0–1000 的量级呈现<p>可能的值：<br><code>one_hundred</code> — rank 值以 0–100 的量级显示<br><code>one_thousand</code> — rank 值以 0–1000 的量级显示<p>默认值：<code>one_thousand</code><p>有关此参数工作方式的更多信息，请参阅<a href=\"https://dataforseo.com/help-center/using-the-rank_scale-parameter-in-content-analysis-api\">这篇帮助中心文章</a>"
          },
          "tag": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>用户自定义任务标识符</em><br>可选字段<br><em>字符数上限为 255</em><br>可使用此参数标识任务，并将其与结果对应<br>可在响应的 <code>data</code> 对象中找到指定的 <code>tag</code> 值"
          }
        },
        "example": [
          {
            "category_code": 10994,
            "search_mode": "as_is",
            "date_from": "2022-09-01",
            "date_group": "month"
          }
        ]
      }
    ]
  },
  "example": [
    {
      "category_code": 10994,
      "search_mode": "as_is",
      "date_from": "2022-09-01",
      "date_group": "month"
    }
  ]
}
```

## Responses

### 200 — 操作成功

Headers:
- `X-Request-Id` (string) — 联系 Felo 支持时需提供的请求标识符。

**application/json**

Schema: object | null

```json
{
  "type": [
    "object",
    "null"
  ],
  "oneOf": [
    {
      "$ref": "#/components/schemas/Response36Afe1097B20_ContentAnalysisCategoryTrendsLiveResponseInfo"
    }
  ]
}
```

### 400 — 无法处理该请求。请检查请求参数。

### 401 — 需要有效的 Felo API 密钥。

### 402 — 由于未满足计费要求，请求无法继续。

### 403 — 该账户无权执行此操作。

### 429 — 已达到请求或支出限额。

### 502 — 服务无法完成该请求。

### 503 — API 或计费服务暂时不可用。

### 504 — 服务在处理请求时超时。

### default — 错误响应；上游透传响应可能采用提供方格式

**application/json**

Schema:

```json
{}
```

## Schema definitions

### Response36Afe1097B20_BaseResponseInfo

`#/components/schemas/Response36Afe1097B20_BaseResponseInfo`

```json
{
  "properties": {
    "version": {
      "type": [
        "string",
        "null"
      ],
      "description": "API 的当前版本"
    },
    "status_code": {
      "type": [
        "integer",
        "null"
      ],
      "description": "通用状态码\n完整响应码列表见此处"
    },
    "status_message": {
      "type": [
        "string",
        "null"
      ],
      "description": "通用信息性消息\n完整的一般信息性消息列表见此处"
    },
    "time": {
      "type": [
        "string",
        "null"
      ],
      "description": "总执行时间，秒"
    },
    "cost": {
      "type": [
        "number",
        "null"
      ],
      "description": "任务总费用，美元",
      "format": "double"
    },
    "tasks_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "tasks 数组中的任务数",
      "format": "int64"
    },
    "tasks_error": {
      "type": [
        "integer",
        "null"
      ],
      "description": "tasks 数组中返回错误的任务数",
      "format": "int64"
    }
  }
}
```

### Response36Afe1097B20_BaseResponseTaskInfo

`#/components/schemas/Response36Afe1097B20_BaseResponseTaskInfo`

```json
{
  "properties": {
    "id": {
      "type": [
        "string",
        "null"
      ],
      "description": "任务标识符\n我们系统中 UUID 格式的唯一任务标识符"
    },
    "status_code": {
      "type": [
        "integer",
        "null"
      ],
      "description": "任务的状态码\n由 DataForSEO 生成，范围如下：10000-60000\n完整响应码列表见此处"
    },
    "status_message": {
      "type": [
        "string",
        "null"
      ],
      "description": "任务的信息性消息\n完整的一般信息性消息列表见此处"
    },
    "time": {
      "type": [
        "string",
        "null"
      ],
      "description": "执行时间，秒"
    },
    "cost": {
      "type": [
        "number",
        "null"
      ],
      "description": "任务总费用，美元",
      "format": "double"
    },
    "result_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "result 数组中的元素数",
      "format": "int64"
    },
    "path": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": [
          "string",
          "null"
        ]
      },
      "description": "URL 路径"
    },
    "data": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": [
          "object",
          "null"
        ]
      },
      "description": "包含你在 POST 请求中指定的相同参数"
    }
  }
}
```

### Response36Afe1097B20_ContentAnalysisCategoriesInfo

`#/components/schemas/Response36Afe1097B20_ContentAnalysisCategoriesInfo`

```json
{
  "properties": {
    "category": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": [
          "integer",
          "null"
        ]
      }
    },
    "count": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int64"
    }
  }
}
```

### Response36Afe1097B20_ContentAnalysisCategoryTrendsLiveResponseInfo

`#/components/schemas/Response36Afe1097B20_ContentAnalysisCategoryTrendsLiveResponseInfo`

```json
{
  "type": "object",
  "allOf": [
    {
      "$ref": "#/components/schemas/Response36Afe1097B20_BaseResponseInfo"
    },
    {
      "type": "object",
      "properties": {
        "tasks": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "object",
              "null"
            ],
            "oneOf": [
              {
                "$ref": "#/components/schemas/Response36Afe1097B20_ContentAnalysisCategoryTrendsLiveTaskInfo"
              }
            ]
          },
          "description": "<em>任务数组</em>"
        }
      }
    }
  ]
}
```

### Response36Afe1097B20_ContentAnalysisCategoryTrendsLiveResultInfo

`#/components/schemas/Response36Afe1097B20_ContentAnalysisCategoryTrendsLiveResultInfo`

```json
{
  "type": "object",
  "properties": {
    "type": {
      "type": [
        "string",
        "null"
      ],
      "description": "元素类型"
    },
    "date": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>数据所属的日期</em>"
    },
    "total_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>我们数据库中与你的请求相关的结果总数</em>",
      "format": "int64"
    },
    "rank": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>引用 <code>keyword</code> 的所有 URL 的排名</em><br>指定日期引用目标 <code>keyword</code> 的所有 URL 排名的归一化总和"
    },
    "top_domains": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": [
          "object",
          "null"
        ],
        "oneOf": [
          {
            "$ref": "#/components/schemas/Response36Afe1097B20_TopDomainInfo"
          }
        ]
      },
      "description": "<em>引用目标关键词的热门域名</em><br>包含引用目标类别的热门域名对象，以及每个域名的引用次数"
    },
    "sentiment_connotations": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": [
          "integer",
          "null"
        ],
        "format": "int64"
      },
      "description": "<em>情感含义</em><br>包含与目标类别引用相关的情感（情绪反应），以及每种情感的引用次数<br>可能的含义：<code>\"anger\"</code>、<code>\"fear\"</code>、<code>\"happiness\"</code>、<code>\"love\"</code>、<code>\"sadness\"</code>、<code>\"share\"</code>、<code>\"neutral\"</code>、<code>\"fun\"</code>"
    },
    "connotation_types": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": [
          "integer",
          "null"
        ],
        "format": "int64"
      },
      "description": "<em>情感含义类型</em><br>包含与类别引用相关的情感类型（情感极性），以及每种情感类型的引用次数<br>可能的情感含义类型：<code>\"positive\"</code>、<code>\"negative\"</code>、<code>\"neutral\"</code>"
    },
    "text_categories": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": [
          "object",
          "null"
        ],
        "oneOf": [
          {
            "$ref": "#/components/schemas/Response36Afe1097B20_ContentAnalysisCategoriesInfo"
          }
        ]
      },
      "description": "<em>文本类别</em><br>包含文本类别对象及每个文本类别的引用次数<br>如需获取可用类别的完整列表，请参阅 <a href=\"/v3/content_analysis/categories/\" rel=\"noopener noreferrer\" target=\"_blank\">Categories</a> 端点"
    },
    "page_categories": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": [
          "object",
          "null"
        ],
        "oneOf": [
          {
            "$ref": "#/components/schemas/Response36Afe1097B20_ContentAnalysisCategoriesInfo"
          }
        ]
      },
      "description": "<em>页面类别</em><br>包含页面类别对象及每个页面类别的引用次数<br>如需获取可用类别的完整列表，请参阅 <a href=\"/v3/content_analysis/categories/\" rel=\"noopener noreferrer\" target=\"_blank\">Categories</a> 端点"
    },
    "page_types": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": [
          "integer",
          "null"
        ],
        "format": "int64"
      },
      "description": "<em>页面类型</em><br>包含页面类型及每种页面类型的引用次数"
    },
    "countries": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": [
          "integer",
          "null"
        ],
        "format": "int64"
      },
      "description": "<em>国家/地区</em><br>包含国家/地区及每个国家/地区的引用次数<br>如需获取可用国家/地区的完整列表，请参阅 <a href=\"/v3/content_analysis/locations/\" rel=\"noopener noreferrer\" target=\"_blank\">Locations</a> 端点"
    },
    "languages": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": [
          "integer",
          "null"
        ],
        "format": "int64"
      },
      "description": "<em>语言</em><br>包含语言及每种语言的引用次数<br>如需获取可用语言的完整列表，请参阅 <a href=\"/v3/content_analysis/languages/\" rel=\"noopener noreferrer\" target=\"_blank\">Languages</a> 端点"
    }
  }
}
```

### Response36Afe1097B20_ContentAnalysisCategoryTrendsLiveTaskInfo

`#/components/schemas/Response36Afe1097B20_ContentAnalysisCategoryTrendsLiveTaskInfo`

```json
{
  "type": "object",
  "allOf": [
    {
      "$ref": "#/components/schemas/Response36Afe1097B20_BaseResponseTaskInfo"
    },
    {
      "type": "object",
      "properties": {
        "result": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "object",
              "null"
            ],
            "oneOf": [
              {
                "$ref": "#/components/schemas/Response36Afe1097B20_ContentAnalysisCategoryTrendsLiveResultInfo"
              }
            ]
          },
          "description": "<em>结果数组</em>"
        }
      }
    }
  ]
}
```

### Response36Afe1097B20_TopDomainInfo

`#/components/schemas/Response36Afe1097B20_TopDomainInfo`

```json
{
  "properties": {
    "domain": {
      "type": [
        "string",
        "null"
      ]
    },
    "count": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int64"
    }
  }
}
```
