DataForSEO
SEO, search-engine results, keyword research, backlinks and AI visibility data.
Content Analysis – Sentiment Analysis API
Sentiment distributions for the citations of a keyword: positive_connotation_distribution (positive, negative, neutral) and sentiment_connotation_distribution (anger, happiness, love, sadness, share, fun). positive_connotation_threshold and sentiments_connotation_threshold set how confident a classification must be to count. ⚠️ Both blocks are already inside post_dataforseo_content_summary_live, which costs the same and adds domains, categories, countries and languages - prefer it unless the smaller response matters. To see the sentiment split by star rating use post_dataforseo_content_rating_distribution_live.
- 类型: array object[]
- keyword类型: string必填
target keyword required field UTF-8 encoding the keywords will be converted to a lowercase format; Note: to match an exact phrase instead of a stand-alone keyword, use double quotes and backslashes; example: "keyword": ""tesla palo alto"" learn more about rules and limitations of keyword and keywords fields in DataForSEO APIs in this Help Center article
- initial类型: array
_dataset _filters initial dataset filtering parameters optional field initial filtering parameters that apply to fields in the Search endpoint you can add several filters at once (8 filters maximum) you should set a logical operator and, or between the conditions the following operators are supported: regex, not_regex, , , >, >=, =, , in, not_in, like,not_like, has, has_not, match, not_match you can use the % operator with like and not_like to match any string of zero or more characters example: ["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]]] for more information about filters, please refer to Content Analysis API – Filters learn more about the initial dataset filters in this help center article.
- internal类型: integer
_list _limit maximum number of elements within internal arrays optional field you can use this field to limit the number of elements within the following arrays: top_domains text_categories page_categories countries languages default value: 1 maximum value: 20
- keyword类型: object
_fields target keyword fields and target keywords optional field use this parameter to filter the dataset by keywords that certain fields should contain; fields you can specify: title, main_title, previous_title, snippet you can indicate several fields; Note: to match an exact phrase instead of a stand-alone keyword, use double quotes and backslashes; example: "keyword_fields": { "snippet": ""logitech mouse"", "main_title": "sale" }
- main类型: string
_title - previous类型: string
_title - snippet类型: string
- title类型: string
- page类型: array string[]
_type target page types optional field use this parameter to filter the dataset by page types possible values: "ecommerce", "news", "blogs", "message-boards", "organization"
- positive类型: number
_connotation _threshold positive connotation threshold optional field specified as the probability index threshold for positive sentiment related to the citation content if you specify this field, connotation_types object in the response will only contain data on citations with positive sentiment probability more than or equal to the specified value possible values: from 0 to 1 default value: 0.4
- rank类型: string
_scale defines the scale used for calculating and displaying the rank values optional field you can use this parameter to choose whether rank values are presented on a 0–100 or 0–1000 scale possible values: one_hundred — rank values are displayed on a 0–100 scale one_thousand — rank values are displayed on a 0–1000 scale default value: one_thousand learn more about how this parameter works in this Help Center article
- sentiments类型: number
_connotation _threshold sentiment connotation threshold optional field specified as the probability index threshold for sentiment connotations related to the citation content if you specify this field, sentiment_connotations object in the response will only contain data on citations where the probability per each sentiment is more than or equal to the specified value possible values: from 0 to 1 default value: 0.4
- tag类型: string
user-defined task identifier optional field the character limit is 255 you can use this parameter to identify the task and match it with the result you will find the specified tag value in the data object of the response
- 类型: object200
Successful response
- 类型: numbercost
total tasks cost, USD
- 类型: integerstatus
_code general status code you can find the full list of the response codes here Note: we strongly recommend designing a necessary system for handling related exceptional or error conditions
- 类型: stringstatus
_message general informational message you can find the full list of general informational messages here
- 类型: array string[]tasks
array of tasks
- 类型: integertasks
_count the number of tasks in the tasks array
- 类型: integertasks
_error the number of tasks in the tasks array returned with an error
- 类型: numbertasks
.cost cost of the task, USD
- 类型: objecttasks
.data contains the same parameters that you specified in the POST request
- 类型: stringtasks
.id task identifier unique task identifier in our system in the UUID format
- 类型: array string[]tasks
.path URL path
- 类型: array string[]tasks
.result array of results
- 类型: integertasks
.result _count number of elements in the result array
- 类型: objecttasks
.result .positive _connotation _distribution citation distribution by sentiment connotation types contains objects with citation counts and relevant data distributed by types of sentiments (sentiment polarity); possible sentiment connotation types: positive, negative, neutral
- 类型: objecttasks
.result .positive _connotation _distribution .$positive positive, negative, or neutral connotations variable can take the following values: positive, negative, neutral
- 类型: objecttasks
.result .positive _connotation _distribution .$positive .connotation _types connotation types contains types of sentiments (sentiment polarity) related to the keyword citation and citation count per each sentiment type; possible connotation types: "positive", "negative", "neutral"
- 类型: objecttasks
.result .positive _connotation _distribution .$positive .countries countries contains countries and citation count in each country to obtain a full list of available countries, refer to the Locations endpoint
- 类型: objecttasks
.result .positive _connotation _distribution .$positive .languages languages to obtain a full list of available languages, refer to the Languages endpoint
- 类型: array string[]tasks
.result .positive _connotation _distribution .$positive .page _categories page categories contains objects with page categories and citation count in each page category to obtain a full list of available categories, refer to the Categories endpoint
- 类型: objecttasks
.result .positive _connotation _distribution .$positive .page _types page types contains page types and citation count per each page type
- 类型: integertasks
.result .positive _connotation _distribution .$positive .rank rank of all relevant URLs
- 类型: objecttasks
.result .positive _connotation _distribution .$positive .sentiment _connotations sentiment connotations contains relevant sentiments (emotional reactions) and the number of citations per each sentiment; possible connotations: "anger", "happiness", "love", "sadness", "share", "fun"
- 类型: array string[]tasks
.result .positive _connotation _distribution .$positive .text _categories text categories contains text categories and citation count in each text category to obtain a full list of available categories, refer to the Categories endpoint
- 类型: array string[]tasks
.result .positive _connotation _distribution .$positive .top _domains top relevant domains contains objects with top relevant domains and the number of citations per each domain
- 类型: integertasks
.result .positive _connotation _distribution .$positive .total _count total number of relevant results
- 类型: stringtasks
.result .positive _connotation _distribution .$positive .type type of element = ‘content_analysis_summary’
- 类型: objecttasks
.result .sentiment _connotation _distribution citation distribution by sentiment connotations contains objects with citation counts and relevant data distributed by sentiments (emotional reactions); possible sentiment connotation types: anger, happiness, love, sadness, share, fun
- 类型: objecttasks
.result .sentiment _connotation _distribution .$anger sentiment name variable can take the following values: anger, happiness, love, sadness, share, fun
- 类型: objecttasks
.result .sentiment _connotation _distribution .$anger .connotation _types connotation types contains types of sentiments (sentiment polarity) related to the keyword citation and citation count per each sentiment type; possible connotation types: "positive", "negative", "neutral"
- 类型: objecttasks
.result .sentiment _connotation _distribution .$anger .countries countries contains countries and citation count in each country to obtain a full list of available countries, refer to the Locations endpoint
- 类型: objecttasks
.result .sentiment _connotation _distribution .$anger .languages languages to obtain a full list of available countries, refer to the Languages endpoint
- 类型: array string[]tasks
.result .sentiment _connotation _distribution .$anger .page _categories page categories contains objects with page categories and citation count in each page category to obtain a full list of available categories, refer to the Categories endpoint
- 类型: objecttasks
.result .sentiment _connotation _distribution .$anger .page _types page types contains page types and citation count per each page type
- 类型: integertasks
.result .sentiment _connotation _distribution .$anger .rank rank of all relevant URLs
- 类型: objecttasks
.result .sentiment _connotation _distribution .$anger .sentiment _connotations sentiment connotations contains relevant sentiments (emotional reactions) and the number of citations per each sentiment; possible connotations: "anger", "happiness", "love", "sadness", "share", "fun"
- 类型: array string[]tasks
.result .sentiment _connotation _distribution .$anger .text _categories text categories contains text categories and citation count in each text category to obtain a full list of available categories, refer to the Categories endpoint
- 类型: array string[]tasks
.result .sentiment _connotation _distribution .$anger .top _domains top relevant domains contains objects with top relevant domains and the number of citations per each domain
- 类型: integertasks
.result .sentiment _connotation _distribution .$anger .total _count total number of relevant results
- 类型: stringtasks
.result .sentiment _connotation _distribution .$anger .type type of element = ‘content_analysis_summary’
- 类型: stringtasks
.result .type type of element = ‘content_analysis_sentiment_analysis’
- 类型: integertasks
.status _code status code of the task generated by DataForSEO; can be within the following range: 10000-60000 you can find the full list of the response codes here
- 类型: stringtasks
.status _message informational message of the task you can find the full list of general informational messages here
- 类型: stringtasks
.time execution time, seconds
- 类型: stringtime
execution time, seconds
- 类型: stringversion
the current version of the API
application/json - 400
Bad request
- 401
Unauthorized
- 402
The request cannot proceed because a billing requirement is not met.
- 403
The account is not permitted to perform this operation.
- 429
Rate limit exceeded
- 500
Internal server error
- 502
The service could not complete the request.
- 503
The API or billing service is temporarily unavailable.
- 504
The service timed out while processing the request.
- default
The operation failed. Keep the response request ID when contacting Felo support.
curl https://openapi.felo.ai/v1/beta/dataforseo/content_analysis/sentiment_analysis/live \
--request POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
--data '[
{
"keyword": "",
"keyword_fields": {
"title": "",
"main_title": "",
"previous_title": "",
"snippet": ""
},
"page_type": [
""
],
"internal_list_limit": 1,
"positive_connotation_threshold": 1,
"sentiments_connotation_threshold": 1,
"initial_dataset_filters": [],
"rank_scale": "",
"tag": ""
}
]'
{
"version": "string",
"status_code": 1,
"status_message": "string",
"time": "string",
"cost": 1,
"tasks_count": 1,
"tasks_error": 1,
"tasks": [
"string"
],
"tasks.id": "string",
"tasks.status_code": 1,
"tasks.status_message": "string",
"tasks.time": "string",
"tasks.cost": 1,
"tasks.result_count": 1,
"tasks.path": [
"string"
],
"tasks.data": {},
"tasks.result": [
"string"
],
"tasks.result.type": "string",
"tasks.result.positive_connotation_distribution": {},
"tasks.result.positive_connotation_distribution.$positive": {},
"tasks.result.positive_connotation_distribution.$positive.type": "string",
"tasks.result.positive_connotation_distribution.$positive.total_count": 1,
"tasks.result.positive_connotation_distribution.$positive.rank": 1,
"tasks.result.positive_connotation_distribution.$positive.top_domains": [
"string"
],
"tasks.result.positive_connotation_distribution.$positive.sentiment_connotations": {},
"tasks.result.positive_connotation_distribution.$positive.connotation_types": {},
"tasks.result.positive_connotation_distribution.$positive.text_categories": [
"string"
],
"tasks.result.positive_connotation_distribution.$positive.page_categories": [
"string"
],
"tasks.result.positive_connotation_distribution.$positive.page_types": {},
"tasks.result.positive_connotation_distribution.$positive.countries": {},
"tasks.result.positive_connotation_distribution.$positive.languages": {},
"tasks.result.sentiment_connotation_distribution": {},
"tasks.result.sentiment_connotation_distribution.$anger": {},
"tasks.result.sentiment_connotation_distribution.$anger.type": "string",
"tasks.result.sentiment_connotation_distribution.$anger.total_count": 1,
"tasks.result.sentiment_connotation_distribution.$anger.rank": 1,
"tasks.result.sentiment_connotation_distribution.$anger.top_domains": [
"string"
],
"tasks.result.sentiment_connotation_distribution.$anger.sentiment_connotations": {},
"tasks.result.sentiment_connotation_distribution.$anger.connotation_types": {},
"tasks.result.sentiment_connotation_distribution.$anger.text_categories": [
"string"
],
"tasks.result.sentiment_connotation_distribution.$anger.page_categories": [
"string"
],
"tasks.result.sentiment_connotation_distribution.$anger.page_types": {},
"tasks.result.sentiment_connotation_distribution.$anger.countries": {},
"tasks.result.sentiment_connotation_distribution.$anger.languages": {}
}