Content Analysis – Category Trends API


This endpoint will provide you with data on all citations in the target category for the indicated date range.

Historical data is available from 2022-10-31.

checked POST
Pricing

Your account will be charged for each request.
The cost can be calculated on the Pricing page.

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, each Live API call can contain only one task. The maximum number of calls that can be sent simultaneously is limited to 30.

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 nameTypeDescription
category_codeinteger

target category code
required field
to obtain a full list of available categories, refer to the Categories endpoint

page_typearray

target page types
optional field
use this parameter to filter the dataset by page types
possible values:
"ecommerce", "news", "blogs", "message-boards", "organization"

search_modestring

results grouping type
optional field
possible grouping types:
as_is - returns data on all citations for the target category_code
one_per_domain - returns data on one citation of the category_code per domain
default value: as_is

internal_list_limitinteger

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

date_fromstring

starting date of the time range
required field
minimum value: 2022-10-31
date format: "yyyy-mm-dd"
example:
"2019-01-15"

date_tostring

ending date of the time range
optional field
if you don't specify this field, today's date will be used by default
date format: "yyyy-mm-dd"
example:
"2019-01-15"

date_groupstring

time range which will be used to group the results
optional field
default value: month
possible values: day, week, month

initial_dataset_filtersarray

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.

rank_scalestring

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

tagstring

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 nameTypeDescription
versionstring

the current version of the API

status_codeinteger

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_messagestring

general informational message
you can find the full list of general informational messages here

timestring

execution time, seconds

costfloat

total tasks cost, USD

tasks_countinteger

the number of tasks in the tasks array

tasks_errorinteger

the number of tasks in the tasks array returned with an error

tasksarray

array of tasks

    idstring

task identifier
unique task identifier in our system in the UUID format

    status_codeinteger

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_messagestring

informational message of the task
you can find the full list of general informational messages here

    timestring

execution time, seconds

    costfloat

cost of the task, USD

    result_countinteger

number of elements in the result array

    patharray

URL path

    dataobject

contains the same parameters that you specified in the POST request

    resultarray

array of results

        typestring

type of element='content_analysis_trends'n

        datestring

date for which the data is provided

        total_countinteger

total number of results in our database relevant to your request

        rankinteger

rank of all URLs citing the keyword
normalized sum of ranks of all URLs citing the target keyword for the given date

        top_domainsarray

top domains citing the target keyword
contains objects with top domains citing the target category and citation count per each domain

        sentiment_connotationsobject

sentiment connotations
contains sentiments (emotional reactions) related to the target category citation and the number of citations per each sentiment
possible connotations: "anger", "fear", "happiness", "love", "sadness", "share", "neutral", "fun"

        connotation_typesobject

connotation types
contains types of sentiments (sentiment polarity) related to the category citation and citation count per each sentiment type
possible connotation types: "positive", "negative", "neutral"

        text_categoriesarray

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_categoriesarray

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_typesobject

page types
contains page types and citation count per each page type

        countriesobject

countries
contains countries and citation count in each country
to obtain a full list of available countries, refer to the Locations endpoint

        languagesobject

languages
contains languages and citation count in each language
to obtain a full list of available languages, refer to the Languages endpoint

‌‌

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

# Instead of 'login' and 'password' use your credentials from https://app.dataforseo.com/api-access 
login="login" 
password="password" 
cred="$(printf ${login}:${password} | base64)" 
curl --location --request POST "https://api.dataforseo.com/v3/content_analysis/category_trends/live" 
--header "Authorization: Basic ${cred}"  
--header "Content-Type: application/json" 
--data-raw '[
    {
        "category_code": 10994,
        "search_mode": "as_is",
        "date_from": "2022-09-01",
        "date_group": "month"
    }
]'
<?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-access
$client = new RestClient($api_url, null, 'login', 'password');
$post_array = array();
// simple way to set a task
$post_array[] = array(
   "category_code" => 10994,
   "search_mode" => "as_is",
   "date_from" => "2022-09-01",
   "date_group" => "month"
);
try {
   // POST /v3/content_analysis/category_trends/live
   $result = $client->post('/v3/content_analysis/category_trends/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;
?>
const post_array = [];

post_array.push({
        "category_code": 10994,
        "search_mode": "as_is",
        "date_from": "2022-09-01",
        "date_group": "month"
});

const axios = require('axios');

axios({
  method: 'post',
  url: 'https://api.dataforseo.com/v3/content_analysis/category_trends/live',
  auth: {
    username: 'login',
    password: 'password'
  },
  data: post_array,
  headers: {
    'content-type': 'application/json'
  }
}).then(function (response) {
  var result = response['data']['tasks'];
  // Result data
  console.log(result);
}).catch(function (error) {
  console.log(error);
});
from client import RestClient
# You can download this file from here https://cdn.dataforseo.com/v3/examples/python/python_Client.zip
client = RestClient("login", "password")
post_data = dict()
# simple way to set a task
post_data[len(post_data)] = dict(
    category_code=10994,
    search_mode="as_is",
    date_from="2022-09-01",
    date_group="month"
)
# POST /v3/content_analysis/category_trends/live
response = client.post("/v3/content_analysis/category_trends/live", post_data)
# you can find the full list of the response codes here https://docs.dataforseo.com/v3/appendix/errors
if response["status_code"] == 20000:
    print(response)
    # do something with result
else:
    print("error. Code: %d Message: %s" % (response["status_code"], response["status_message"]))
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
namespace DataForSeoDemos
{
    public static partial class Demos
    {
        public static async Task content_analysis_category_trends_live()
        {
            var httpClient = new HttpClient
            {
                BaseAddress = new Uri("https://api.dataforseo.com/"),
                // Instead of 'login' and 'password' use your credentials from https://app.dataforseo.com/api-access
                DefaultRequestHeaders = { Authorization = new AuthenticationHeaderValue("Basic", Convert.ToBase64String(Encoding.ASCII.GetBytes("login:password"))) }
            };
            var postData = new List<object>();
            postData.Add(new
            {
                category_code = 10994,
                search_mode = "as_is",
                date_from = "2022-09-01",
                date_group = "month"
            });
            // POST /v3/content_analysis/category_trends/live
            // the full list of possible parameters is available in documentation
            var taskPostResponse = await httpClient.PostAsync("/v3/content_analysis/category_trends/live", new StringContent(JsonConvert.SerializeObject(postData)));
            var result = JsonConvert.DeserializeObject<dynamic>(await taskPostResponse.Content.ReadAsStringAsync());
            // you can find the full list of the response codes here https://docs.dataforseo.com/v3/appendix/errors
            if (result.status_code == 20000)
            {
                // do something with result
                Console.WriteLine(result);
            }
            else
                Console.WriteLine($"error. Code: {result.status_code} Message: {result.status_message}");
        }
    }
}

The above command returns JSON structured like this:

{
    "version": "0.1.20220819",
    "status_code": 20000,
    "status_message": "Ok.",
    "time": "19.4363 sec.",
    "cost": 0.02009,
    "tasks_count": 1,
    "tasks_error": 0,
    "tasks": [
        {
            "id": "11091159-1535-0467-0000-7de6f8a2cd19",
            "status_code": 20000,
            "status_message": "Ok.",
            "time": "19.3880 sec.",
            "cost": 0.02009,
            "result_count": 3,
            "path": [
                "v3",
                "content_analysis",
                "phrase_trends",
                "live"
            ],
            "data": {
                "api": "content_analysis",
                "function": "phrase_trends",
                "keyword": "logitech",
                "search_mode": "as_is",
                "date_from": "2022-09-01",
                "date_group": "month"
            },
            "result": [
                {
                    "type": "content_analysis_trends",
                    "date": "2022-09-01",
                    "total_count": 1159252,
                    "rank": 590,
                    "top_domains": [
                        {
                            "domain": "xsplit.com",
                            "count": 53678
                        },
                        {
                            "domain": "englishsteps.net",
                            "count": 26359
                        },
                        {
                            "domain": "wireless1.com.au",
                            "count": 13768
                        },
                        {
                            "domain": "16bars.de",
                            "count": 8075
                        },
                        {
                            "domain": "bcoolmagazin.hu",
                            "count": 7615
                        },
                        {
                            "domain": "maistecnologia.com",
                            "count": 6352
                        },
                        {
                            "domain": "seattlestreetcar.org",
                            "count": 5923
                        },
                        {
                            "domain": "dutchcreativeindustry.com",
                            "count": 5891
                        },
                        {
                            "domain": "reviewsguide.org",
                            "count": 4195
                        }
                    ],
                    "sentiment_connotations": {
                        "anger": 33,
                        "happiness": 32457,
                        "love": 4976,
                        "sadness": 290,
                        "share": 33841,
                        "fun": 1212
                    },
                    "connotation_types": {
                        "positive": 390289,
                        "negative": 135916,
                        "neutral": 589516
                    },
                    "text_categories": [
                        {
                            "category": null,
                            "count": 138579
                        },
                        {
                            "category": [
                                10013,
                                10019,
                                10167
                            ],
                            "count": 112695
                        },
                        {
                            "category": [
                                10019,
                                10167,
                                10007,
                                13418
                            ],
                            "count": 55421
                        },
                        {
                            "category": [
                                10019,
                                10167,
                                10013
                            ],
                            "count": 50413
                        },
                        {
                            "category": [
                                10013,
                                10108,
                                13691
                            ],
                            "count": 47466
                        },
                        {
                            "category": [
                                10013,
                                10004
                            ],
                            "count": 31977
                        },
                        {
                            "category": [
                                10013,
                                10108
                            ],
                            "count": 29651
                        },
                        {
                            "category": [
                                10013,
                                10108,
                                10584
                            ],
                            "count": 20540
                        },
                        {
                            "category": [
                                10108,
                                13691,
                                10013,
                                10103,
                                10556
                            ],
                            "count": 19429
                        },
                        {
                            "category": [
                                10004,
                                10013
                            ],
                            "count": 16576
                        }
                    ],
                    "page_categories": [
                        {
                            "category": null,
                            "count": 297216
                        },
                        {
                            "category": [
                                10014,
                                10114,
                                10108
                            ],
                            "count": 54264
                        },
                        {
                            "category": [
                                10013,
                                10108,
                                10584
                            ],
                            "count": 24245
                        },
                        {
                            "category": [
                                10013,
                                10019,
                                10167
                            ],
                            "count": 12532
                        },
                        {
                            "category": [
                                10108,
                                10584,
                                10013
                            ],
                            "count": 11249
                        },
                        {
                            "category": [
                                10019,
                                10167,
                                10013
                            ],
                            "count": 9711
                        },
                        {
                            "category": [
                                10019,
                                10167,
                                10009,
                                10404
                            ],
                            "count": 7441
                        },
                        {
                            "category": [
                                10013,
                                10108
                            ],
                            "count": 7435
                        },
                        {
                            "category": [
                                10108,
                                10013
                            ],
                            "count": 6574
                        },
                        {
                            "category": [
                                10013,
                                10021,
                                10176,
                                13779
                            ],
                            "count": 6109
                        }
                    ],
                    "page_types": {
                        "blogs": 622032,
                        "organization": 118086,
                        "news": 230980,
                        "message-boards": 18590,
                        "ecommerce": 96451
                    },
                    "countries": {
                        "US": 86504,
                        "WW": 56826,
                        "DE": 30522,
                        "IN": 21831,
                        "VN": 20049,
                        "AU": 19544,
                        "BR": 16685,
                        "JP": 16651,
                        "GB": 16405,
                        "ES": 15335
                    },
                    "languages": {
                        "en": 712751,
                        "ja": 114912,
                        "de": 63841,
                        "es": 60616,
                        "fr": 53833,
                        "it": 27394,
                        "vi": 23817,
                        "ru": 16528,
                        "pt": 11518,
                        "hu": 8393
                    }
                },
                {
                    "type": "content_analysis_trends",
                    "date": "2022-10-01",
                    "total_count": 1430023,
                    "rank": 613,
                    "top_domains": [
                        {
                            "domain": "vdsitsolutions.com",
                            "count": 341567
                        },
                        {
                            "domain": "dutchcreativeindustry.com",
                            "count": 34616
                        },
                        {
                            "domain": "wireless1.com.au",
                            "count": 25600
                        },
                        {
                            "domain": "richardcastle.net",
                            "count": 8217
                        },
                        {
                            "domain": "edenred.mx",
                            "count": 8196
                        },
                        {
                            "domain": "private-sextreffen.cc",
                            "count": 7867
                        },
                        {
                            "domain": "parkkitchen.com",
                            "count": 7406
                        },
                        {
                            "domain": "16bars.de",
                            "count": 7337
                        },
                        {
                            "domain": "x-kom.pl",
                            "count": 7001
                        },
                        {
                            "domain": "kreativdesign1.de",
                            "count": 6131
                        }
                    ],
                    "sentiment_connotations": {
                        "anger": 9,
                        "happiness": 36007,
                        "love": 4062,
                        "sadness": 128,
                        "share": 52651,
                        "fun": 971
                    },
                    "connotation_types": {
                        "positive": 735206,
                        "negative": 175341,
                        "neutral": 468693
                    },
                    "text_categories": [
                        {
                            "category": [
                                10019,
                                10167,
                                10168,
                                10883,
                                12184,
                                10007,
                                11506,
                                12168
                            ],
                            "count": 262712
                        },
                        {
                            "category": null,
                            "count": 119642
                        },
                        {
                            "category": [
                                10019,
                                10167,
                                10872,
                                10007,
                                11506,
                                12168
                            ],
                            "count": 66173
                        },
                        {
                            "category": [
                                10001,
                                10024,
                                10185,
                                10952,
                                13573
                            ],
                            "count": 31464
                        },
                        {
                            "category": [
                                10013,
                                10019,
                                10167
                            ],
                            "count": 22904
                        },
                        {
                            "category": [
                                10013,
                                10019,
                                10167,
                                10108,
                                13691
                            ],
                            "count": 22363
                        },
                        {
                            "category": [
                                10013,
                                10108,
                                13691
                            ],
                            "count": 21340
                        },
                        {
                            "category": [
                                10019,
                                10168,
                                10886,
                                12222,
                                12216,
                                10108
                            ],
                            "count": 19754
                        },
                        {
                            "category": [
                                10108,
                                10001,
                                13655,
                                13656,
                                10016,
                                10139,
                                10746
                            ],
                            "count": 19439
                        },
                        {
                            "category": [
                                10019,
                                10167,
                                10013,
                                10007,
                                13418
                            ],
                            "count": 17741
                        }
                    ],
                    "page_categories": [
                        {
                            "category": null,
                            "count": 213366
                        },
                        {
                            "category": [
                                10108,
                                13647,
                                10013,
                                10105,
                                13536,
                                10566,
                                13897,
                                13700
                            ],
                            "count": 24725
                        },
                        {
                            "category": [
                                10013,
                                10108,
                                10584
                            ],
                            "count": 18093
                        },
                        {
                            "category": [
                                10009,
                                10404,
                                10004,
                                13804
                            ],
                            "count": 9602
                        },
                        {
                            "category": [
                                10108,
                                10584,
                                10013
                            ],
                            "count": 8787
                        },
                        {
                            "category": [
                                10108,
                                13647,
                                13700
                            ],
                            "count": 7707
                        },
                        {
                            "category": [
                                10013,
                                10019,
                                10167
                            ],
                            "count": 7074
                        },
                        {
                            "category": [
                                10019,
                                10167,
                                10013
                            ],
                            "count": 6302
                        },
                        {
                            "category": [
                                10009,
                                10404,
                                10019,
                                10167,
                                10017,
                                10142,
                                10769,
                                12067
                            ],
                            "count": 5648
                        },
                        {
                            "category": [
                                10019,
                                10167,
                                10007,
                                10878,
                                13381,
                                12161,
                                13054
                            ],
                            "count": 5625
                        }
                    ],
                    "page_types": {
                        "blogs": 809466,
                        "organization": 44189,
                        "news": 256351,
                        "message-boards": 26910,
                        "ecommerce": 137036
                    },
                    "countries": {
                        "BE": 344693,
                        "US": 90030,
                        "WW": 68847,
                        "DE": 42458,
                        "AU": 32590,
                        "VN": 24763,
                        "PL": 21004,
                        "IN": 19569,
                        "BR": 18502,
                        "MX": 14819
                    },
                    "languages": {
                        "en": 963542,
                        "ja": 112659,
                        "de": 82151,
                        "es": 80681,
                        "fr": 57705,
                        "vi": 33349,
                        "it": 25147,
                        "pl": 9751,
                        "nl": 6994,
                        "nb": 6684
                    }
                },
                {
                    "type": "content_analysis_trends",
                    "date": "2022-11-01",
                    "total_count": 130203,
                    "rank": 462,
                    "top_domains": [
                        {
                            "domain": "vdsitsolutions.com",
                            "count": 42547
                        },
                        {
                            "domain": "dutchcreativeindustry.com",
                            "count": 3444
                        },
                        {
                            "domain": "maistecnologia.com",
                            "count": 3342
                        },
                        {
                            "domain": "wireless1.com.au",
                            "count": 2942
                        },
                        {
                            "domain": "gamersco.com",
                            "count": 1604
                        },
                        {
                            "domain": "edenred.mx",
                            "count": 1031
                        },
                        {
                            "domain": "dateks.lv",
                            "count": 792
                        },
                        {
                            "domain": "insidecee.pl",
                            "count": 640
                        },
                        {
                            "domain": "1001buonisconto.it",
                            "count": 595
                        },
                        {
                            "domain": "qasgk.com",
                            "count": 504
                        }
                    ],
                    "sentiment_connotations": {
                        "anger": 0,
                        "happiness": 6607,
                        "love": 236,
                        "sadness": 8,
                        "share": 4486,
                        "fun": 1595
                    },
                    "connotation_types": {
                        "positive": 76016,
                        "negative": 20227,
                        "neutral": 24780
                    },
                    "text_categories": [
                        {
                            "category": [
                                10019,
                                10167,
                                10168,
                                10883,
                                12184,
                                10007,
                                11506,
                                12168
                            ],
                            "count": 42547
                        },
                        {
                            "category": null,
                            "count": 11482
                        },
                        {
                            "category": [
                                10013,
                                10019,
                                10168,
                                10886,
                                12216,
                                10167
                            ],
                            "count": 3365
                        },
                        {
                            "category": [
                                10007,
                                13418,
                                10019,
                                10167,
                                10873,
                                12138,
                                10168,
                                10885,
                                12204
                            ],
                            "count": 3132
                        },
                        {
                            "category": [
                                10019,
                                10168,
                                10883,
                                12187,
                                10167,
                                10886,
                                12216
                            ],
                            "count": 2938
                        },
                        {
                            "category": [
                                10019,
                                10168,
                                10886,
                                12216,
                                12222,
                                10007,
                                13418
                            ],
                            "count": 1610
                        },
                        {
                            "category": [
                                10013,
                                10019,
                                10167,
                                10108,
                                13691
                            ],
                            "count": 1609
                        },
                        {
                            "category": [
                                10013,
                                10108,
                                13691
                            ],
                            "count": 1335
                        },
                        {
                            "category": [
                                10019,
                                10167,
                                10013,
                                10007,
                                13418
                            ],
                            "count": 1276
                        },
                        {
                            "category": [
                                10019,
                                10167,
                                10013,
                                10108,
                                13691
                            ],
                            "count": 1219
                        }
                    ],
                    "page_categories": [
                        {
                            "category": null,
                            "count": 23050
                        },
                        {
                            "category": [
                                10108,
                                13647,
                                10013,
                                10105,
                                13536,
                                10566,
                                13897,
                                13700
                            ],
                            "count": 3444
                        },
                        {
                            "category": [
                                10108,
                                10756,
                                10013
                            ],
                            "count": 1607
                        },
                        {
                            "category": [
                                10019,
                                10167,
                                10013,
                                10007,
                                13418
                            ],
                            "count": 834
                        },
                        {
                            "category": [
                                10009,
                                10404,
                                10004,
                                13804
                            ],
                            "count": 627
                        },
                        {
                            "category": [
                                10013,
                                10108,
                                10584
                            ],
                            "count": 578
                        },
                        {
                            "category": [
                                13575,
                                13441,
                                13860
                            ],
                            "count": 470
                        },
                        {
                            "category": [
                                10108,
                                13691,
                                10013,
                                10103,
                                10556
                            ],
                            "count": 446
                        },
                        {
                            "category": [
                                10009,
                                10404,
                                10019,
                                10167,
                                10017,
                                10142,
                                10769,
                                12067
                            ],
                            "count": 386
                        },
                        {
                            "category": [
                                10013,
                                10019,
                                10167,
                                10007,
                                13418
                            ],
                            "count": 375
                        }
                    ],
                    "page_types": {
                        "blogs": 78908,
                        "organization": 6034,
                        "news": 18164,
                        "message-boards": 5147,
                        "ecommerce": 12120
                    },
                    "countries": {
                        "BE": 42874,
                        "WW": 9893,
                        "US": 5008,
                        "AU": 3524,
                        "DE": 1722,
                        "IN": 1630,
                        "PL": 1570,
                        "FR": 1482,
                        "MX": 1457,
                        "VN": 1441
                    },
                    "languages": {
                        "en": 90074,
                        "es": 7246,
                        "ja": 5861,
                        "de": 5095,
                        "pt": 4022,
                        "vi": 3981,
                        "fr": 3344,
                        "pl": 2044,
                        "it": 1927,
                        "nb": 1311
                    }
                }
            ]
        }
    ]
}