> ## Documentation Index
> Fetch the complete documentation index at: https://aisa.one/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# 内容分析 – 情感分析 API

> 此端点将为您提供目标关键词可用引用的情感分析数据。



## OpenAPI

````yaml openapi/zh/dataforseo.json POST /dataforseo/content_analysis/sentiment_analysis/live
openapi: 3.0.3
info:
  title: DataForSEO API
  version: 1.0.0
  description: 通过 AIsa 统一网关提供的 DataForSEO API 端点。
servers:
  - url: https://api.aisa.one/apis/v1
security:
  - BearerAuth: []
paths:
  /dataforseo/content_analysis/sentiment_analysis/live:
    post:
      summary: 内容分析 – 情感分析 API
      description: 此端点将为您提供目标关键词可用引用的情感分析数据。
      operationId: post_dataforseo_content_analysis_sentiment_analysis_live
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                keyword:
                  type: string
                  description: >-
                    目标关键词，必填字段，采用 UTF-8
                    编码。关键词将转换为小写格式；注意：如需匹配完整短语而非独立关键词，请使用双引号和反斜杠；示例："keyword":
                    "\"tesla palo alto\""。有关 DataForSEO API 中 keyword 和 keywords
                    字段的规则与限制，请参阅此帮助中心文章。
                keyword_fields:
                  type: object
                  description: >-
                    目标关键词字段和目标关键词，可选字段。使用此参数可按特定字段应包含的关键词筛选数据集；可指定的字段：title、main_title、previous_title、snippet。您可以指定多个字段；注意：若要匹配完整短语而非独立关键词，请使用双引号和反斜杠；示例："keyword_fields":
                    { "snippet": "\"logitech mouse\"", "main_title": "sale" }
                page_type:
                  type: array
                  items:
                    type: string
                  description: >-
                    目标页面类型，可选字段。使用此参数按页面类型筛选数据集；可能的值："ecommerce"、"news"、"blogs"、"message-boards"、"organization"
                internal_list_limit:
                  type: integer
                  description: >-
                    内部数组中的最大元素数量，可选字段；你可以使用此字段限制以下数组中的元素数量：top_domains、text_categories、page_categories、countries、languages；默认值：1；最大值：20
                positive_connotation_threshold:
                  type: number
                  description: >-
                    正面倾向阈值。可选字段。指定为与引用内容相关的正面情感概率指数阈值。如果指定此字段，响应中的
                    connotation_types 对象将仅包含正面情感概率大于或等于指定值的引用数据。可选值：0 到
                    1。默认值：0.4
                sentiments_connotation_threshold:
                  type: number
                  description: >-
                    情感内涵阈值，可选字段。指定为与引用内容相关的情感内涵概率指数阈值。如果指定此字段，响应中的
                    sentiment_connotations 对象将仅包含各项情感概率大于或等于指定值的引用数据。可选值：0 到
                    1。默认值：0.4
                initial_dataset_filters:
                  type: array
                  items:
                    type: string
                  description: >-
                    初始数据集过滤参数，可选字段。应用于 Search 端点中字段的初始过滤参数。可以同时添加多个过滤器（最多 8
                    个）。应在条件之间设置逻辑运算符 and、or。支持以下运算符：regex, not_regex, , , >, >=,
                    =, , in, not_in, like,not_like, has, has_not, match,
                    not_match。可以将 % 运算符与 like 和 not_like
                    配合使用，以匹配由零个或多个字符组成的任意字符串。示例：["domain","", "logitech.com"]
                    [["domain","","logitech.com"],"and",["content_info.connotation_types.negative",">",1000]]
                    [["domain","","logitech.com"]], "and",
                    [["content_info.connotation_types.negative",">",1000], "or",
                    ["content_info.text_category","has",10994]]]。有关过滤器的更多信息，请参阅
                    Content Analysis API – Filters。有关初始数据集过滤器的更多信息，请参阅此帮助中心文章。
                rank_scale:
                  type: string
                  description: >-
                    定义用于计算和显示排名值的刻度，可选字段。您可以使用此参数选择以 0–100 还是 0–1000
                    刻度显示排名值。可选值：one_hundred — 以 0–100 刻度显示排名值；one_thousand — 以
                    0–1000 刻度显示排名值。默认值：one_thousand。有关此参数工作原理的更多信息，请参阅此帮助中心文章。
                tag:
                  type: string
                  description: >-
                    用户定义的任务标识符。可选字段。字符数限制为 255。您可以使用此参数标识任务并将其与结果匹配；您将在响应的 data
                    对象中找到指定的 tag 值
              required:
                - keyword
      responses:
        '200':
          description: 成功响应
          content:
            application/json:
              schema:
                type: object
                properties:
                  version:
                    type: string
                    description: API 的当前版本
                  status_code:
                    type: integer
                    description: 通用状态码；您可以在此处查看完整的响应码列表。注意：我们强烈建议设计必要的系统来处理相关异常或错误情况
                  status_message:
                    type: string
                    description: 常规信息消息；可在此处查看常规信息消息的完整列表
                  time:
                    type: string
                    description: 执行时间（秒）
                  cost:
                    type: number
                    description: 任务总成本（美元）
                  tasks_count:
                    type: integer
                    description: tasks 数组中的任务数量
                  tasks_error:
                    type: integer
                    description: 返回错误的 tasks 数组中的任务数量
                  tasks:
                    type: array
                    items:
                      type: string
                    description: 任务数组
                  tasks.id:
                    type: string
                    description: 任务标识符，系统中采用 UUID 格式的唯一任务标识符
                  tasks.status_code:
                    type: integer
                    description: DataForSEO 生成的任务状态码；范围为：10000-60000；完整响应代码列表可在此处查看
                  tasks.status_message:
                    type: string
                    description: 任务的信息性消息，你可以在此处查看通用信息性消息的完整列表
                  tasks.time:
                    type: string
                    description: 执行时间（秒）
                  tasks.cost:
                    type: number
                    description: 任务成本（美元）
                  tasks.result_count:
                    type: integer
                    description: 结果数组中的元素数量
                  tasks.path:
                    type: array
                    items:
                      type: string
                    description: URL 路径
                  tasks.data:
                    type: object
                    description: 包含您在 POST 请求中指定的相同参数
                  tasks.result:
                    type: array
                    items:
                      type: string
                    description: 结果数组
                  tasks.result.type:
                    type: string
                    description: 元素类型 = ‘content_analysis_sentiment_analysis’
                  tasks.result.positive_connotation_distribution:
                    type: object
                    description: >-
                      按情感内涵类型划分的引用分布；包含按情感类型（情感极性）分布的引用次数及相关数据的对象。可能的情感内涵类型：positive、negative、neutral。
                  tasks.result.positive_connotation_distribution.$positive:
                    type: object
                    description: 正面、负面或中性含义；变量可取以下值：positive、negative、neutral
                  tasks.result.positive_connotation_distribution.$positive.type:
                    type: string
                    description: 元素类型 = ‘content_analysis_summary’
                  tasks.result.positive_connotation_distribution.$positive.total_count:
                    type: integer
                    description: 相关结果总数
                  tasks.result.positive_connotation_distribution.$positive.rank:
                    type: integer
                    description: 所有相关 URL 的排名
                  tasks.result.positive_connotation_distribution.$positive.top_domains:
                    type: array
                    items:
                      type: string
                    description: 最相关域名，包含最相关域名以及每个域名引用次数的对象
                  tasks.result.positive_connotation_distribution.$positive.sentiment_connotations:
                    type: object
                    description: >-
                      情感内涵。包含相关情感（情绪反应）以及每种情感对应的引用次数；可能的情感内涵："anger"、"happiness"、"love"、"sadness"、"share"、"fun"
                  tasks.result.positive_connotation_distribution.$positive.connotation_types:
                    type: object
                    description: >-
                      内涵类型，包含与关键词引用相关的情感类型（情感极性），以及每种情感类型的引用次数；可能的内涵类型："positive"、"negative"、"neutral"
                  tasks.result.positive_connotation_distribution.$positive.text_categories:
                    type: array
                    items:
                      type: string
                    description: 文本类别，包含各文本类别及其中的引用数量；如需获取所有可用类别的完整列表，请参阅 Categories 端点
                  tasks.result.positive_connotation_distribution.$positive.page_categories:
                    type: array
                    items:
                      type: string
                    description: >-
                      页面类别，包含由页面类别以及各页面类别中的引用次数构成的对象。如需获取所有可用类别的完整列表，请参阅
                      Categories 端点
                  tasks.result.positive_connotation_distribution.$positive.page_types:
                    type: object
                    description: 页面类型，包含各页面类型及其引用次数
                  tasks.result.positive_connotation_distribution.$positive.countries:
                    type: object
                    description: countries 包含各个国家及其引用次数；如需获取完整的可用国家列表，请参阅 Locations 端点。
                  tasks.result.positive_connotation_distribution.$positive.languages:
                    type: object
                    description: 如需获取完整的可用语言列表，请参阅 Languages 端点
                  tasks.result.sentiment_connotation_distribution:
                    type: object
                    description: >-
                      按情感内涵划分的引用分布，包含具有引用次数及按情感（情绪反应）分布的相关数据的对象；可能的情感内涵类型：anger、happiness、love、sadness、share、fun
                  tasks.result.sentiment_connotation_distribution.$anger:
                    type: object
                    description: 情感名称变量可采用以下值：anger、happiness、love、sadness、share、fun
                  tasks.result.sentiment_connotation_distribution.$anger.type:
                    type: string
                    description: 元素类型 = ‘content_analysis_summary’
                  tasks.result.sentiment_connotation_distribution.$anger.total_count:
                    type: integer
                    description: 相关结果总数
                  tasks.result.sentiment_connotation_distribution.$anger.rank:
                    type: integer
                    description: 所有相关 URL 的排名
                  tasks.result.sentiment_connotation_distribution.$anger.top_domains:
                    type: array
                    items:
                      type: string
                    description: 最相关域名，包含最相关域名以及每个域名引用次数的对象
                  tasks.result.sentiment_connotation_distribution.$anger.sentiment_connotations:
                    type: object
                    description: >-
                      情感内涵。包含相关情感（情绪反应）以及每种情感对应的引用次数；可能的情感内涵："anger"、"happiness"、"love"、"sadness"、"share"、"fun"
                  tasks.result.sentiment_connotation_distribution.$anger.connotation_types:
                    type: object
                    description: >-
                      内涵类型，包含与关键词引用相关的情感类型（情感极性），以及每种情感类型的引用次数；可能的内涵类型："positive"、"negative"、"neutral"
                  tasks.result.sentiment_connotation_distribution.$anger.text_categories:
                    type: array
                    items:
                      type: string
                    description: 文本类别，包含各文本类别及其中的引用数量；如需获取所有可用类别的完整列表，请参阅 Categories 端点
                  tasks.result.sentiment_connotation_distribution.$anger.page_categories:
                    type: array
                    items:
                      type: string
                    description: >-
                      页面类别，包含由页面类别以及各页面类别中的引用次数构成的对象。如需获取所有可用类别的完整列表，请参阅
                      Categories 端点
                  tasks.result.sentiment_connotation_distribution.$anger.page_types:
                    type: object
                    description: 页面类型，包含各页面类型及其引用次数
                  tasks.result.sentiment_connotation_distribution.$anger.countries:
                    type: object
                    description: countries 包含各个国家及其引用次数；如需获取完整的可用国家列表，请参阅 Locations 端点。
                  tasks.result.sentiment_connotation_distribution.$anger.languages:
                    type: object
                    description: 语言：如需获取所有可用国家/地区的完整列表，请参阅 Languages 端点
        '400':
          description: 错误请求
        '401':
          description: 未授权
        '429':
          description: 超出速率限制
        '500':
          description: 内部服务器错误
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````