NAVNavbar
Logo
cURL php NodeJS Python cSharp

Content Analysis – Summary API


This endpoint will provide you with an overview of citation data available for the target keyword.

Instead of ‘login’ and ‘password’ use your credentials from https://app.dataforseo.com/api-dashboard

<?php
// You can download this file from here https://cdn.dataforseo.com/v3/examples/php/php_RestClient.zip
require('RestClient.php');
$api_url = 'https://api.dataforseo.com/';
// Instead of 'login' and 'password' use your credentials from https://app.dataforseo.com/api-dashboard
$client = new RestClient($api_url, null, 'login', 'password');
$post_array = array();
// simple way to set a task
$post_array[] = array(
   "keyword" => "logitech",
   "page_type" => array(
      "ecommerce",
      "news",
      "blogs",
      "message-boards",
      "organization"
   ),
   "internal_list_limit" => 3,
   "positive_connotation_threshold" => 0.5
);
try {
   // POST /v3/content_analysis/summary/live
   $result = $client->post('/v3/content_analysis/summary/live', $post_array);
   print_r($result);
   // do something with post result
} catch (RestClientException $e) {
   echo "n";
   print "HTTP code: {$e->getHttpCode()}n";
   print "Error code: {$e->getCode()}n";
   print "Message: {$e->getMessage()}n";
   print  $e->getTraceAsString();
   echo "n";
}
$client = null;
?>

The above command returns JSON structured like this:

{
    "version": "0.1.20220913",
    "status_code": 20000,
    "status_message": "Ok.",
    "time": "1.0290 sec.",
    "cost": 0.02003,
    "tasks_count": 1,
    "tasks_error": 0,
    "tasks": [
        {
            "id": "09131956-0696-0464-0000-25b5cb2c0157",
            "status_code": 20000,
            "status_message": "Ok.",
            "time": "0.9941 sec.",
            "cost": 0.02003,
            "result_count": 1,
            "path": [
                "v3",
                "content_analysis",
                "summary",
                "live"
            ],
            "data": {
                "api": "content_analysis",
                "function": "summary",
                "keyword": "logitech",
                "page_type": [
                    "ecommerce",
                    "news",
                    "blogs",
                    "message-boards",
                    "organization"
                ],
                "internal_list_limit": 8,
                "positive_connotation_threshold": 0.5
            },
            "result": [
                {
                    "type": "content_analysis_summary",
                    "total_count": 959052,
                    "rank": 586,
                    "top_domains": [
                        {
                            "domain": "nerdpart.com",
                            "count": 31783
                        },
                        {
                            "domain": "clubic.com",
                            "count": 12576
                        },
                        {
                            "domain": "logitech.com",
                            "count": 5918
                        },
                        {
                            "domain": "dateks.lv",
                            "count": 4100
                        },
                        {
                            "domain": "ovu.com.ua",
                            "count": 3460
                        },
                        {
                            "domain": "preissieger.info",
                            "count": 3309
                        }
                    ],
                    "sentiment_connotations": {
                        "anger": 0,
                        "happiness": 22868,
                        "love": 175266,
                        "sadness": 12076,
                        "share": 0,
                        "fun": 1309
                    },
                    "connotation_types": {
                        "positive": 261992,
                        "negative": 68043,
                        "neutral": 108682
                    },
                    "text_categories": [
                        {
                            "category": null,
                            "count": 272367
                        },
                        {
                            "category": [
                                10013,
                                10019,
                                10167
                            ],
                            "count": 66122
                        },
                        {
                            "category": [
                                10019,
                                10167,
                                10013
                            ],
                            "count": 62107
                        },
                        {
                            "category": [
                                10019,
                                10167,
                                10007,
                                13418
                            ],
                            "count": 40433
                        },
                        {
                            "category": [
                                10019,
                                10167,
                                10007,
                                10878,
                                13381,
                                12161,
                                13054
                            ],
                            "count": 25706
                        },
                        {
                            "category": [
                                10013,
                                10108
                            ],
                            "count": 24088
                        },
                        {
                            "category": [
                                10019,
                                10168,
                                10886,
                                12222,
                                12216
                            ],
                            "count": 21864
                        },
                        {
                            "category": [
                                10013,
                                10108,
                                13691
                            ],
                            "count": 20646
                        }
                    ],
                    "page_categories": [
                        {
                            "category": null,
                            "count": 247346
                        },
                        {
                            "category": [
                                10013,
                                10108,
                                10584
                            ],
                            "count": 14463
                        },
                        {
                            "category": [
                                10019,
                                10167,
                                10013
                            ],
                            "count": 14017
                        },
                        {
                            "category": [
                                10019,
                                10167,
                                10007,
                                10878,
                                13381,
                                12161,
                                13054
                            ],
                            "count": 13000
                        },
                        {
                            "category": [
                                10013,
                                10019,
                                10167
                            ],
                            "count": 12041
                        },
                        {
                            "category": [
                                10019,
                                10167,
                                10007,
                                13418
                            ],
                            "count": 11963
                        },
                        {
                            "category": [
                                10019,
                                10168,
                                10886,
                                12222,
                                12216
                            ],
                            "count": 11938
                        },
                        {
                            "category": [
                                10019,
                                10168,
                                10886,
                                12216,
                                12222
                            ],
                            "count": 7747
                        }
                    ],
                    "page_types": {
                        "blogs": 60789,
                        "organization": 27201,
                        "news": 270865,
                        "message-boards": 33883,
                        "ecommerce": 314434
                    },
                    "countries": {
                        "US": 88807,
                        "UA": 58655,
                        "UN": 40394,
                        "DE": 30334,
                        "FR": 27221,
                        "JP": 24619,
                        "VN": 20387,
                        "PL": 19671
                    },
                    "languages": {
                        "en": 351137,
                        "ja": 97085,
                        "ru": 83271,
                        "vi": 54182,
                        "de": 53040,
                        "fr": 45802,
                        "es": 43180,
                        "pl": 21421
                    }
                }
            ]
        }
    ]
}

All POST data should be sent in the JSON format (UTF-8 encoding). The task setting is done using the POST method. When setting a task, you should send all task parameters in the task array of the generic POST array. You can send up to 2000 API calls per minute.

You can specify the number of results you want to retrieve, filter and sort them.

Below you will find a detailed description of the fields you can use for setting a task.

Description of the fields for setting a task:

Field name Type Description
keyword string target keyword
required field
UTF-8 encoding
a keyword should be at least 3 characters long;
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

keyword_fields object 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"
}
page_type array target page types
optional field
use this parameter to filter the dataset by page types
possible values:
"ecommerce", "news", "blogs", "message-boards", "organization"
internal_list_limit integer 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
positive_connotation_threshold float 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
sentiments_connotation_threshold float 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
initial_dataset_filters array initial dataset filtering parameters
optional field
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
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

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

As a response of the API server, you will receive JSON-encoded data containing a tasks array with the information specific to the set tasks.

Description of the fields in the results array:

Field name Type Description
version string the current version of the API
status_code integer 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
status_message string general informational message
you can find the full list of general informational messages here
time string execution time, seconds
cost float total tasks cost, USD
tasks_count integer the number of tasks in the tasks array
tasks_error integer the number of tasks in the tasks array returned with an error
tasks array array of tasks
        id string task identifier
unique task identifier in our system in the UUID format
        status_code integer 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
        status_message string informational message of the task
you can find the full list of general informational messages here
        time string execution time, seconds
        cost float cost of the task, USD
        result_count integer number of elements in the result array
        path array URL path
        data object contains the same parameters that you specified in the POST request
        result array array of results
            type string type of element = ‘content_analysis_summary’
            total_count integer total amount of results in our database relevant to your request
            rank integer rank of all URLs citing the keyword
normalized sum of ranks of all URLs citing the target keyword
            top_domains array top domains citing the target keyword
contains objects with top domains citing the target keword and citation count per each domain
            sentiment_connotations object sentiment connotations
contains sentiments (emotional reactions) related to the target keyword citation and the number of citations per each sentiment
possible sentiment connotations: anger, happiness, love, sadness, share, fun
            connotation_types object connotation types
contains types of sentiments (sentiment polarity) related to the keyword citation and citation count per each sentiment type
possible sentiment connotation types: positive, negative, neutral
            text_categories array text categories
contains objects with text categories and citation count in each text category
to obtain a full list of available categories, refer to the Categories endpoint
            page_categories array 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
            page_types object page types
contains page types and citation count per each page type
            countries object countries
contains countries and citation count in each country
to obtain a full list of available countries, refer to the Locations endpoint
            languages object languages
contains languages and citation count in each language
to obtain a full list of available languages, refer to the Languages endpoint

‌‌