How to get sentiment trends in a certain category?
To get sentiment trends in a certain category you’ll need to call the Category Trends endpoint. In the API request, define the necessary category, which is a required field. You can also add optional fields like date range and time range for grouping (by day, week, or month).
Here is an example of the request to obtain trends for the category:
[
{
"category_code": 10994,
"search_mode": "as_is",
"date_from": "2021-07-10",
"date_group_mode": "month"
}
]
If you need data on several categories, make a new API call with the relevant category code for each section.
You can get the full list of available category codes and review category names by using the free Categories endpoint.
The API response will return data on all citations in the target category for the indicated date range:
{
"version": "0.1.20220819",
"status_code": 20000,
"status_message": "Ok.",
"time": "28.8089 sec.",
"cost": 0.02054,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "12121730-4426-0468-0000-9e8a690d1c37",
"status_code": 20000,
"status_message": "Ok.",
"time": "28.7504 sec.",
"cost": 0.02054,
"result_count": 18,
"path": [
"v3",
"content_analysis",
"category_trends",
"live"
],
"data": {
"api": "content_analysis",
"function": "category_trends",
"category_code": 10994,
"search_mode": "as_is",
"date_from": "2021-07-10"
},
"result": [
{
"type": "content_analysis_trends",
"date": "2021-07-01",
"total_count": 463563,
"rank": 642,
"top_domains": [
{
"domain": "dailion.com",
"count": 40696
},
{
"domain": "cheercitytt.com",
"count": 25812
},
{
"domain": "sos-parts.com",
"count": 4885
},
{
"domain": "alisuperdeals.com",
"count": 4689
},
{
"domain": "tekyedek.net",
"count": 4318
},
{
"domain": "romanceuniversity.org",
"count": 3672
},
{
"domain": "chiptuners.in",
"count": 3629
},
{
"domain": "altgradauto.ro",
"count": 2979
},
{
"domain": "racechip.es",
"count": 2553
},
{
"domain": "reportsandmarkets.com",
"count": 2526
}
],
"sentiment_connotations": {
"anger": 1376,
"happiness": 20055,
"love": 29027,
"sadness": 1888,
"share": 32019,
"fun": 771
},
"connotation_types": {
"positive": 163138,
"negative": 143627,
"neutral": 179865
},
"text_categories": [
{
"category": [
10001,
10026,
10209,
10994,
12272,
13131,
10019,
10167,
10872,
13402,
13401
],
"count": 42718
},
{
"category": [
10002,
10030,
10236,
10016,
10141,
11029,
10001,
10026,
10209,
10994,
12271
],
"count": 16311
},
{
"category": [
10001,
10026,
10209,
10994,
12271,
10009,
10406
],
"count": 9510
},
{
"category": [
10001,
10026,
10209,
10994
],
"count": 9462
},
{
"category": [
10001,
10024,
10185,
10954,
10026,
10209,
10994,
12271
],
"count": 8246
},
{
"category": [
10001,
10026,
10209,
10994,
10024,
10185
],
"count": 6257
},
{
"category": [
10001,
10026,
10209,
10994,
12270,
10010,
10081,
10009,
10419
],
"count": 6003
},
{
"category": [
10001,
10024,
10182,
10026,
10204,
10209,
10994,
12271
],
"count": 5875
},
{
"category": [
10001,
10026,
10209,
10994,
12271,
10204,
10024,
10182
],
"count": 5345
},
{
"category": [
10001,
10026,
10209,
10993,
12268,
10994,
12271,
10004,
13804
],
"count": 5328
}
],
"page_categories": [
{
"category": null,
"count": 103720
},
{
"category": [
10009,
10412,
11527,
11564,
12795
],
"count": 2191
},
{
"category": [
10001,
10024,
10182,
10026,
10204,
10181,
10946
],
"count": 1860
},
{
"category": [
10005,
10014,
10123,
10666,
10122
],
"count": 1388
},
{
"category": [
10001,
10026,
10209,
10994
],
"count": 1094
},
{
"category": [
10001,
10024,
10185,
10019,
10167,
10954
],
"count": 1072
},
{
"category": [
10001,
10026,
10209,
10994,
10024,
10185,
13655,
13656
],
"count": 974
},
{
"category": [
10001,
10024,
10185,
13655,
13656,
13714
],
"count": 914
},
{
"category": [
10009,
10412,
11564,
12795,
11527
],
"count": 874
},
{
"category": [
10001,
10024,
10182,
10181,
10946,
10026,
10204
],
"count": 846
}
],
"page_types": {
"blogs": 202702,
"organization": 99464,
"news": 8902,
"message-boards": 9094,
"ecommerce": 96060
},
"countries": {
"US": 116317,
"ID": 26251,
"ES": 19001,
"GB": 15143,
"DE": 11892,
"WW": 10406,
"IN": 10121,
"FR": 6809,
"RO": 5954,
"AU": 4991
},
"languages": {
"en": 323654,
"es": 70308,
"de": 25876,
"fr": 16055,
"pt": 6004,
"ru": 4731,
"ro": 4713,
"sv": 3584,
"tr": 1952,
"tl": 1531
}
},
{
"type": "content_analysis_trends",
"date": "2021-08-01",
"total_count": 728683,
"rank": 603,
"top_domains": [
{
"domain": "thenormalcompany.co.uk",
"count": 61834
},
{
"domain": "motoconcept.ca",
"count": 58241
},
{
"domain": "gbd.no",
"count": 36523
},
{
"domain": "oticanamoda.com.br",
"count": 14222
},
{
"domain": "altgradauto.ro",
"count": 10580
},
{
"domain": "fisheriessupply.com",
"count": 9371
},
{
"domain": "greenlandmx.co.uk",
"count": 8881
},
{
"domain": "greenlandmx.es",
"count": 7985
},
{
"domain": "septiczone.com",
"count": 7275
},
{
"domain": "greenlandmx.com",
"count": 6476
}
],
"sentiment_connotations": {
"anger": 3123,
"happiness": 62325,
"love": 3545,
"sadness": 7130,
"share": 30691,
"fun": 1163
},
"connotation_types": {
"positive": 195431,
"negative": 119568,
"neutral": 422180
},
"text_categories": [
{
"category": [
10001,
10026,
10209,
10994
],
"count": 91145
},
{
"category": [
10016,
10141,
10763,
10001,
10026,
10209,
10994,
12271,
10004,
10305,
11103,
12400
],
"count": 61734
},
{
"category": [
10108,
10011,
10089,
10001,
10026,
10209,
10994
],
"count": 14790
},
{
"category": [
10001,
10026,
10209,
10994,
12271
],
"count": 9554
},
{
"category": [
10001,
10026,
10209,
10994,
10024,
10185
],
"count": 9379
},
{
"category": [
10001,
10024,
10185,
10026,
10209,
10994,
10182
],
"count": 9231
},
{
"category": [
10001,
10024,
10185,
10952,
10026,
10209,
10994,
12271,
10011,
10085,
10464,
11690
],
"count": 8566
},
{
"category": [
10001,
10024,
10185,
10182,
10026,
10209,
10994
],
"count": 8220
},
{
"category": [
10001,
13655,
13656,
10024,
10185,
10026,
10209,
10994
],
"count": 7263
},
{
"category": [
10001,
10026,
10209,
10994,
10024,
10185,
13655,
13656
],
"count": 6852
}
],
"page_categories": [
{
"category": null,
"count": 152777
},
{
"category": [
10001,
10024,
10182,
10026,
10204,
10181,
10946
],
"count": 8819
},
{
"category": [
10011,
10085,
10460,
12866,
10021,
10178,
10936,
12261
],
"count": 4449
},
{
"category": [
10001,
10026,
10209,
10994
],
"count": 3639
},
{
"category": [
10001,
10024,
10182,
10181,
10946,
10026,
10204
],
"count": 3636
},
{
"category": [
10021,
10178,
10936,
12261,
10011,
10085,
10460,
12866
],
"count": 2789
},
{
"category": [
10001,
10026,
10209,
10994,
10024,
10185
],
"count": 2181
},
{
"category": [
10021,
10178,
10936,
12261,
10011,
10085,
10460,
12866,
10171,
10899
],
"count": 1994
},
{
"category": [
10001,
10026,
10204,
10024,
10182
],
"count": 1910
},
{
"category": [
10001,
10024,
10182,
10026,
10204
],
"count": 1875
}
],
"page_types": {
"blogs": 356958,
"organization": 249215,
"news": 9942,
"message-boards": 12890,
"ecommerce": 212501
},
"countries": {
"US": 146526,
"GB": 88254,
"CA": 62378,
"NO": 36640,
"ES": 26388,
"DE": 22246,
"RO": 20581,
"AU": 18611,
"BR": 16615,
"WW": 15728
},
"languages": {
"en": 535134,
"es": 61224,
"de": 37471,
"pt": 37066,
"ro": 22446,
"fr": 19253,
"ru": 5365,
"tr": 1463,
"tl": 1236,
"af": 929
}
}
]
}
]
}