# Content Analysis – 评分分布 API

**API:** Data API

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

**Tags:** DataForSEO

将某个关键词的引用按评分区间划分，并报告每个区间的完整指标集。每个区间返回一条记录，包含 `min`、`max` 和一个 `metrics` 对象，后者包含 `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`。`rank_scale` 决定分桶方式。若需要同样但不分桶的指标，请使用 `post_dataforseo_content_summary_live`；若只需要情感，请使用 `post_dataforseo_content_sentiment_analysis_live`。

### 计费参考

- 计量方式：按上报的响应成本计量。
- 参考请求估算：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": {
          "keyword": {
            "type": "string",
            "description": "<em>目标关键词</em><br><strong>必填字段</strong><br>UTF-8 编码<br>关键词将转换为小写格式；<br><strong>注意</strong>：如需匹配完整短语而非单个关键词，请使用双引号和反斜杠； <br>示例： <br><code>\"keyword\": \"\\\"tesla palo alto\\\"\"</code><p>有关 DataForSEO API 中 <code>keyword</code> 和 <code>keywords</code> 字段的规则与限制，请参阅这篇 <a href=\"https://dataforseo.com/help-center/rules-and-limitations-of-keyword-and-keywords-fields-in-dataforseo-apis\" rel=\"noopener noreferrer\" target=\"_blank\">帮助中心文章</a>"
          },
          "keyword_fields": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": {
              "type": [
                "string",
                "null"
              ]
            },
            "description": "<em>目标关键词字段与目标关键词</em><br>可选字段<br>使用此参数按特定字段应包含的关键词筛选数据集；<br>可指定的字段：<code>title</code>、<code>main_title</code>、<code>previous_title</code>、<code>snippet</code><br>可指定多个字段；<br><strong>注意</strong>：如需匹配完整短语而非单个关键词，请使用双引号和反斜杠； <br>示例：<br>`\"keyword_fields\": {<br>\"snippet\": \"\\\"logitech mouse\\\"\",<br>\"main_title\": \"sale\"<br>}`"
          },
          "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>"
          },
          "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>"
          },
          "search_mode": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>结果分组类型</em><br>可选字段<br>可用的分组类型：<br><code>as_is</code> - 返回目标 <code>keyword</code> 的所有引用数据<br><code>one_per_domain</code> - 每个域名返回一条 <code>keyword</code> 的引用数据<br>默认值：<code>as_is</code>"
          },
          "positive_connotation_threshold": {
            "type": [
              "number",
              "null"
            ],
            "description": "<em>正面情感阈值</em><br>可选字段<br>以与引用内容相关的正面情感概率指数阈值表示<br>如果指定此字段，响应中的 <code>connotation_types</code> 对象将仅包含 <code>positive</code> 情感概率大于或等于指定值的引用数据<br>可能的值：<code>0</code> 到 <code>1</code><br>默认值：<code>0.4</code>"
          },
          "sentiments_connotation_threshold": {
            "type": [
              "number",
              "null"
            ],
            "description": "<em>情感倾向阈值</em><br>可选字段<br>以与引用内容相关的情感倾向概率指数阈值表示<br>如果指定此字段，响应中的 <code>sentiment_connotations</code> 对象将仅包含各情感概率均大于或等于指定值的引用数据<br>可能的值：<code>0</code> 到 <code>1</code><br>默认值：<code>0.4</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": [
          {
            "keyword": "logitech",
            "search_mode": "as_is",
            "internal_list_limit": 10
          }
        ]
      }
    ]
  },
  "example": [
    {
      "keyword": "logitech",
      "search_mode": "as_is",
      "internal_list_limit": 10
    }
  ]
}
```

## Responses

### 200 — 操作成功

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

**application/json**

Schema: object | null

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

### 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_ContentAnalysisRatingDistributionLiveResponseInfo

`#/components/schemas/Response36Afe1097B20_ContentAnalysisRatingDistributionLiveResponseInfo`

```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_ContentAnalysisRatingDistributionLiveTaskInfo"
              }
            ]
          },
          "description": "<em>任务数组</em>"
        }
      }
    }
  ]
}
```

### Response36Afe1097B20_ContentAnalysisRatingDistributionLiveResultInfo

`#/components/schemas/Response36Afe1097B20_ContentAnalysisRatingDistributionLiveResultInfo`

```json
{
  "type": "object",
  "properties": {
    "type": {
      "type": [
        "string",
        "null"
      ],
      "description": "元素类型"
    },
    "min": {
      "type": [
        "number",
        "null"
      ],
      "description": "<em>分布量表上的最低评分</strong></em>"
    },
    "max": {
      "type": [
        "number",
        "null"
      ],
      "description": "<em>分布量表上的最高评分</strong></em>"
    },
    "metrics": {
      "type": [
        "object",
        "null"
      ],
      "oneOf": [
        {
          "$ref": "#/components/schemas/Response36Afe1097B20_ContentAnalysisSummaryInfo"
        }
      ],
      "description": "<em>包含评分分布指标</strong></em>"
    }
  }
}
```

### Response36Afe1097B20_ContentAnalysisRatingDistributionLiveTaskInfo

`#/components/schemas/Response36Afe1097B20_ContentAnalysisRatingDistributionLiveTaskInfo`

```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_ContentAnalysisRatingDistributionLiveResultInfo"
              }
            ]
          },
          "description": "<em>结果数组</em>"
        }
      }
    }
  ]
}
```

### Response36Afe1097B20_ContentAnalysisSummaryInfo

`#/components/schemas/Response36Afe1097B20_ContentAnalysisSummaryInfo`

```json
{
  "type": "object",
  "properties": {
    "type": {
      "type": [
        "string",
        "null"
      ],
      "description": "元素类型"
    },
    "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>happiness</code>、<code>love</code>、<code>sadness</code>、<code>share</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_TopDomainInfo

`#/components/schemas/Response36Afe1097B20_TopDomainInfo`

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