Keyword trend is a powerful tool for analyzing the popularity of search queries across different regions over time. By providing insights into search trends, this tool helps digital marketers and content creators explore and compare the popularity of specific search queries over time and identify geographical areas with the highest interest.
As you know, Google Trends is the most popular search trend analysis tool. However, its limited functionality and uptime issues encourage demanding users to look elsewhere for a more stable solution. Using DataForSEO APIs, you can offer them a working alternative.
We wrote this development guide to help you build a robust keyword trends tool with DataForSEO APIs. It’s based on the DataForSEO Trends Tool, so you can check how these solutions work in real life.
Analyzing and comparing search trends over time is the core feature of any Keyword Trends tool. DataForSEO Trends is represented by a line graph with two axes: timeline on the horizontal axis and keyword popularity on the vertical one.
Let’s consider an example with four new Olympic sports: “surfing,” “sport climbing,” “skateboarding,” and “breakdance.” With DataForSEO Trends API, we’ll then analyze which query has been more popular on the web in the United Kingdom over the past 30 days.
To obtain data for the “Interest over time” graph, you should use the Explore endpoint of DataForSEO Trends API.
Example request
POST https://api.dataforseo.com/v3/keywords_data/dataforseo_trends/explore/live
[
{
"keywords": [
"surfing",
"sport climbing",
"skateboarding",
"breakdance"
],
"location_name": "United Kingdom",
"date_from": "2024-07-01",
"date_to": "2024-07-30",
"type": "web"
}
]
The response contains the items array, which includes the dataforseo_trends_graph element with trends data for the keywords you specified. Each element contains the date_from, date_to, and timestamp fields to help you identify the exact point on the timescale, as well as the popularity values in the corresponding order.
{
"version": "0.1.20240801",
"status_code": 20000,
"status_message": "Ok.",
"time": "6.3844 sec.",
"cost": 0.001,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "08051938-1535-0570-0000-56f2b1ff5778",
"status_code": 20000,
"status_message": "Ok.",
"time": "6.3236 sec.",
"cost": 0.001,
"result_count": 1,
"path": [
"v3",
"keywords_data",
"dataforseo_trends",
"explore",
"live"
],
"data": {
"api": "keywords_data",
"function": "explore",
"se": "dataforseo_trends",
"keywords": [
"surfing",
"sport climbing",
"skateboarding",
"breakdance"
],
"location_name": "United Kingdom",
"date_from": "2024-07-01",
"date_to": "2024-07-30",
"type": "web"
},
"result": [
{
"keywords": [
"surfing",
"sport climbing",
"skateboarding",
"breakdance"
],
"type": "trends",
"location_code": 2826,
"language_code": null,
"datetime": "2024-08-05 16:38:26 +00:00",
"items_count": 1,
"items": [
{
"position": 1,
"type": "dataforseo_trends_graph",
"keywords": [
"surfing",
"sport climbing",
"skateboarding",
"breakdance"
],
"data": [
{
"date_from": "2024-07-01",
"date_to": "2024-07-01",
"timestamp": 1719792000,
"values": [
1,
0,
1,
0
]
},
{
"date_from": "2024-07-02",
"date_to": "2024-07-02",
"timestamp": 1719878400,
"values": [
2,
0,
1,
0
]
},
{
"date_from": "2024-07-03",
"date_to": "2024-07-03",
"timestamp": 1719964800,
"values": [
1,
0,
1,
0
]
},
{
"date_from": "2024-07-04",
"date_to": "2024-07-04",
"timestamp": 1720051200,
"values": [
2,
0,
2,
0
]
},
{
"date_from": "2024-07-05",
"date_to": "2024-07-05",
"timestamp": 1720137600,
"values": [
1,
0,
1,
0
]
},
{
"date_from": "2024-07-06",
"date_to": "2024-07-06",
"timestamp": 1720224000,
"values": [
1,
0,
1,
0
]
},
{
"date_from": "2024-07-07",
"date_to": "2024-07-07",
"timestamp": 1720310400,
"values": [
2,
0,
1,
0
]
},
{
"date_from": "2024-07-08",
"date_to": "2024-07-08",
"timestamp": 1720396800,
"values": [
1,
0,
1,
0
]
},
{
"date_from": "2024-07-09",
"date_to": "2024-07-09",
"timestamp": 1720483200,
"values": [
1,
0,
1,
0
]
},
{
"date_from": "2024-07-10",
"date_to": "2024-07-10",
"timestamp": 1720569600,
"values": [
1,
0,
1,
0
]
},
{
"date_from": "2024-07-11",
"date_to": "2024-07-11",
"timestamp": 1720656000,
"values": [
1,
0,
1,
0
]
},
{
"date_from": "2024-07-12",
"date_to": "2024-07-12",
"timestamp": 1720742400,
"values": [
1,
0,
2,
0
]
},
{
"date_from": "2024-07-13",
"date_to": "2024-07-13",
"timestamp": 1720828800,
"values": [
1,
0,
1,
0
]
},
{
"date_from": "2024-07-14",
"date_to": "2024-07-14",
"timestamp": 1720915200,
"values": [
1,
0,
2,
1
]
},
{
"date_from": "2024-07-15",
"date_to": "2024-07-15",
"timestamp": 1721001600,
"values": [
1,
0,
1,
0
]
},
{
"date_from": "2024-07-16",
"date_to": "2024-07-16",
"timestamp": 1721088000,
"values": [
2,
0,
2,
0
]
},
{
"date_from": "2024-07-17",
"date_to": "2024-07-17",
"timestamp": 1721174400,
"values": [
1,
0,
1,
0
]
},
{
"date_from": "2024-07-18",
"date_to": "2024-07-18",
"timestamp": 1721260800,
"values": [
1,
0,
1,
0
]
},
{
"date_from": "2024-07-19",
"date_to": "2024-07-19",
"timestamp": 1721347200,
"values": [
1,
0,
1,
0
]
},
{
"date_from": "2024-07-20",
"date_to": "2024-07-20",
"timestamp": 1721433600,
"values": [
2,
0,
1,
0
]
},
{
"date_from": "2024-07-21",
"date_to": "2024-07-21",
"timestamp": 1721520000,
"values": [
2,
0,
3,
0
]
},
{
"date_from": "2024-07-22",
"date_to": "2024-07-22",
"timestamp": 1721606400,
"values": [
2,
0,
2,
0
]
},
{
"date_from": "2024-07-23",
"date_to": "2024-07-23",
"timestamp": 1721692800,
"values": [
1,
0,
3,
0
]
},
{
"date_from": "2024-07-24",
"date_to": "2024-07-24",
"timestamp": 1721779200,
"values": [
2,
0,
3,
0
]
},
{
"date_from": "2024-07-25",
"date_to": "2024-07-25",
"timestamp": 1721865600,
"values": [
2,
0,
5,
0
]
},
{
"date_from": "2024-07-26",
"date_to": "2024-07-26",
"timestamp": 1721952000,
"values": [
3,
0,
7,
0
]
},
{
"date_from": "2024-07-27",
"date_to": "2024-07-27",
"timestamp": 1722038400,
"values": [
5,
1,
100,
0
]
},
{
"date_from": "2024-07-28",
"date_to": "2024-07-28",
"timestamp": 1722124800,
"values": [
7,
0,
18,
0
]
},
{
"date_from": "2024-07-29",
"date_to": "2024-07-30",
"timestamp": 1722211200,
"values": [
4,
1,
11,
0
]
}
],
"averages": [
2,
0,
6,
0
]
}
]
}
]
}
]
}
Knowing keyword popularity over time is important, but you should bear in mind that it might drastically change across different subregions of the same country.
The “Interest by subregion” feature of the Keyword Trends Tool is designed to display subregions within the specified country, highlighting the most popular keyword in each subregion.
If one keyword is specified, the popularity values from this section will be based on the highest popularity value for the relevant keywords across all locations.
On the contrary, if you specify multiple keywords, the popularity is determined as the popularity rate of each keyword, which is a percentage of the highest keyword popularity rate.
Overall, the combination of the map and cumulative bar charts is designed to provide a clear view of geographical differences in keyword popularity. You can implement this feature in your tool by leveraging the Subregion Interest endpoint of DataForSEO Trends API. Alternatively, you can get subregion interest and demographic popularity information in the Merged Data endpoint.
For example, let’s use the Subregion interest endpoint to get the UK regional distribution data for the new Olympic sports in the past 30 days.
POST https://api.dataforseo.com/v3/keywords_data/dataforseo_trends/subregion_interests/live
[
{
"keywords": [
"surfing",
"sport climbing",
"skateboarding",
"breakdance"
],
"date_from": "2024-07-01",
"date_to": "2024-07-30",
"type": "web",
"location_name": "United Kingdom"
}
]
In the items array of the response, you will find the subregion_interests element, which contains subregional keyword popularity data for each specified term, as well as the names of the corresponding subregions.
{
"version": "0.1.20240801",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.3645 sec.",
"cost": 0.002,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "08062013-1535-0573-0000-61fbfb5f0ddb",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.2959 sec.",
"cost": 0.002,
"result_count": 1,
"path": [
"v3",
"keywords_data",
"dataforseo_trends",
"subregion_interests",
"live"
],
"data": {
"api": "keywords_data",
"function": "subregion_interests",
"se": "dataforseo_trends",
"keywords": [
"surfing",
"sport climbing",
"skateboarding",
"breakdance"
],
"date_from": "2024-07-01",
"date_to": "2024-07-30",
"type": "web",
"location_name": "United Kingdom"
},
"result": [
{
"keywords": [
"surfing",
"sport climbing",
"skateboarding",
"breakdance"
],
"type": "trends",
"location_code": 2826,
"language_code": null,
"datetime": "2024-08-06 17:13:36 +00:00",
"items_count": 1,
"items": [
{
"position": 1,
"type": "subregion_interests",
"keywords": [
"surfing",
"sport climbing",
"skateboarding",
"breakdance"
],
"interests": [
{
"keyword": "surfing",
"values": [
{
"geo_id": null,
"geo_name": "England",
"value": 73
},
{
"geo_id": null,
"geo_name": "Northern Ireland",
"value": 71
},
{
"geo_id": null,
"geo_name": "Scotland",
"value": 58
},
{
"geo_id": null,
"geo_name": "Wales",
"value": 100
}
]
},
{
"keyword": "sport climbing",
"values": [
{
"geo_id": null,
"geo_name": "England",
"value": 77
},
{
"geo_id": null,
"geo_name": "Northern Ireland",
"value": 0
},
{
"geo_id": null,
"geo_name": "Scotland",
"value": 100
},
{
"geo_id": null,
"geo_name": "Wales",
"value": 0
}
]
},
{
"keyword": "skateboarding",
"values": [
{
"geo_id": null,
"geo_name": "England",
"value": 79
},
{
"geo_id": null,
"geo_name": "Northern Ireland",
"value": 100
},
{
"geo_id": null,
"geo_name": "Scotland",
"value": 68
},
{
"geo_id": null,
"geo_name": "Wales",
"value": 100
}
]
},
{
"keyword": "breakdance",
"values": [
{
"geo_id": null,
"geo_name": "England",
"value": 55
},
{
"geo_id": null,
"geo_name": "Northern Ireland",
"value": 0
},
{
"geo_id": null,
"geo_name": "Scotland",
"value": 92
},
{
"geo_id": null,
"geo_name": "Wales",
"value": 100
}
]
}
],
"interests_comparison": {
"items": [
{
"geo_id": null,
"geo_name": "England",
"values": [
27,
2,
69,
3
]
},
{
"geo_id": null,
"geo_name": "Northern Ireland",
"values": [
23,
0,
77,
0
]
},
{
"geo_id": null,
"geo_name": "Scotland",
"values": [
24,
2,
68,
5
]
},
{
"geo_id": null,
"geo_name": "Wales",
"values": [
29,
0,
68,
4
]
}
],
"absolute_items": [
{
"geo_id": null,
"geo_name": "England",
"values": [
31,
2,
79,
3
]
},
{
"geo_id": null,
"geo_name": "Northern Ireland",
"values": [
30,
0,
100,
0
]
},
{
"geo_id": null,
"geo_name": "Scotland",
"values": [
24,
2,
68,
5
]
},
{
"geo_id": null,
"geo_name": "Wales",
"values": [
42,
0,
100,
5
]
}
]
}
}
]
}
]
}
]
}
Apart from search interest data by subregion and over time, it would also be helpful to know the demographic distribution by age and gender.
The demographic differences in the Keyword Trends tool consist of two parts: distribution by gender and age.
The Demography feature is based on the Demography endpoint of DataForSEO Trends API. Alternatively, you can use the Merged Data endpoint, which combines demographic and geographic keyword trends data, so it might be easier to work with.
Let’s make a request to the Merged Data endpoint and get the required demographic data.
POST https://api.dataforseo.com/v3/keywords_data/dataforseo_trends/merged_data/live
[
{
"keywords": [
"surfing",
"sport climbing",
"skateboarding",
"breakdance"
],
"date_from": "2024-07-01",
"date_to": "2024-07-30",
"type": "web",
"location_name": "United Kingdom"
}
]
In the API response, look for the demography object containing the values for each keyword, age, and gender group. You may also find it useful to implement the data from the demography_comparison object to calculate aggregated values for all keywords.
{
"version": "0.1.20240801",
"status_code": 20000,
"status_message": "Ok.",
"time": "7.3577 sec.",
"cost": 0.005,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "08071607-1535-0575-0000-8fd89a69bfa0",
"status_code": 20000,
"status_message": "Ok.",
"time": "7.2910 sec.",
"cost": 0.005,
"result_count": 1,
"path": [
"v3",
"keywords_data",
"dataforseo_trends",
"merged_data",
"live"
],
"data": {
"api": "keywords_data",
"function": "merged_data",
"se": "dataforseo_trends",
"keywords": [
"surfing",
"sport climbing",
"skateboarding",
"breakdance"
],
"date_from": "2024-07-01",
"date_to": "2024-07-30",
"type": "web",
"location_name": "United Kingdom"
},
"result": [
{
"keywords": [
"surfing",
"sport climbing",
"skateboarding",
"breakdance"
],
"type": "trends",
"location_code": 2826,
"language_code": null,
"datetime": "2024-08-07 13:07:38 +00:00",
"items_count": 3,
"items": [
{
"position": 1,
"type": "dataforseo_trends_graph",
"keywords": [
"surfing",
"sport climbing",
"skateboarding",
"breakdance"
],
"data": [
{
"date_from": "2024-07-01",
"date_to": "2024-07-01",
"timestamp": 1719792000,
"values": [
1,
0,
1,
0
]
},
{
"date_from": "2024-07-02",
"date_to": "2024-07-02",
"timestamp": 1719878400,
"values": [
2,
0,
1,
0
]
},
{
"date_from": "2024-07-03",
"date_to": "2024-07-03",
"timestamp": 1719964800,
"values": [
1,
0,
1,
0
]
},
{
"date_from": "2024-07-04",
"date_to": "2024-07-04",
"timestamp": 1720051200,
"values": [
2,
0,
1,
0
]
},
{
"date_from": "2024-07-05",
"date_to": "2024-07-05",
"timestamp": 1720137600,
"values": [
1,
0,
1,
0
]
},
{
"date_from": "2024-07-06",
"date_to": "2024-07-06",
"timestamp": 1720224000,
"values": [
1,
0,
1,
0
]
},
{
"date_from": "2024-07-07",
"date_to": "2024-07-07",
"timestamp": 1720310400,
"values": [
2,
0,
1,
0
]
},
{
"date_from": "2024-07-08",
"date_to": "2024-07-08",
"timestamp": 1720396800,
"values": [
1,
0,
1,
0
]
},
{
"date_from": "2024-07-09",
"date_to": "2024-07-09",
"timestamp": 1720483200,
"values": [
1,
0,
1,
0
]
},
{
"date_from": "2024-07-10",
"date_to": "2024-07-10",
"timestamp": 1720569600,
"values": [
1,
0,
1,
0
]
},
{
"date_from": "2024-07-11",
"date_to": "2024-07-11",
"timestamp": 1720656000,
"values": [
1,
0,
1,
0
]
},
{
"date_from": "2024-07-12",
"date_to": "2024-07-12",
"timestamp": 1720742400,
"values": [
1,
0,
2,
0
]
},
{
"date_from": "2024-07-13",
"date_to": "2024-07-13",
"timestamp": 1720828800,
"values": [
1,
0,
1,
0
]
},
{
"date_from": "2024-07-14",
"date_to": "2024-07-14",
"timestamp": 1720915200,
"values": [
1,
0,
2,
1
]
},
{
"date_from": "2024-07-15",
"date_to": "2024-07-15",
"timestamp": 1721001600,
"values": [
1,
0,
1,
0
]
},
{
"date_from": "2024-07-16",
"date_to": "2024-07-16",
"timestamp": 1721088000,
"values": [
2,
0,
2,
0
]
},
{
"date_from": "2024-07-17",
"date_to": "2024-07-17",
"timestamp": 1721174400,
"values": [
1,
0,
1,
0
]
},
{
"date_from": "2024-07-18",
"date_to": "2024-07-18",
"timestamp": 1721260800,
"values": [
1,
0,
1,
0
]
},
{
"date_from": "2024-07-19",
"date_to": "2024-07-19",
"timestamp": 1721347200,
"values": [
1,
0,
1,
0
]
},
{
"date_from": "2024-07-20",
"date_to": "2024-07-20",
"timestamp": 1721433600,
"values": [
2,
0,
1,
0
]
},
{
"date_from": "2024-07-21",
"date_to": "2024-07-21",
"timestamp": 1721520000,
"values": [
2,
0,
3,
0
]
},
{
"date_from": "2024-07-22",
"date_to": "2024-07-22",
"timestamp": 1721606400,
"values": [
2,
0,
2,
0
]
},
{
"date_from": "2024-07-23",
"date_to": "2024-07-23",
"timestamp": 1721692800,
"values": [
1,
0,
3,
0
]
},
{
"date_from": "2024-07-24",
"date_to": "2024-07-24",
"timestamp": 1721779200,
"values": [
2,
0,
4,
0
]
},
{
"date_from": "2024-07-25",
"date_to": "2024-07-25",
"timestamp": 1721865600,
"values": [
2,
0,
5,
0
]
},
{
"date_from": "2024-07-26",
"date_to": "2024-07-26",
"timestamp": 1721952000,
"values": [
3,
0,
6,
0
]
},
{
"date_from": "2024-07-27",
"date_to": "2024-07-27",
"timestamp": 1722038400,
"values": [
5,
1,
100,
0
]
},
{
"date_from": "2024-07-28",
"date_to": "2024-07-28",
"timestamp": 1722124800,
"values": [
7,
0,
18,
0
]
},
{
"date_from": "2024-07-29",
"date_to": "2024-07-30",
"timestamp": 1722211200,
"values": [
4,
1,
11,
0
]
}
],
"averages": [
2,
0,
6,
0
]
},
{
"position": 2,
"type": "subregion_interests",
"keywords": [
"surfing",
"sport climbing",
"skateboarding",
"breakdance"
],
"interests": [
{
"keyword": "surfing",
"values": [
{
"geo_id": null,
"geo_name": "England",
"value": 73
},
{
"geo_id": null,
"geo_name": "Northern Ireland",
"value": 71
},
{
"geo_id": null,
"geo_name": "Scotland",
"value": 58
},
{
"geo_id": null,
"geo_name": "Wales",
"value": 100
}
]
},
{
"keyword": "sport climbing",
"values": [
{
"geo_id": null,
"geo_name": "England",
"value": 77
},
{
"geo_id": null,
"geo_name": "Northern Ireland",
"value": 0
},
{
"geo_id": null,
"geo_name": "Scotland",
"value": 100
},
{
"geo_id": null,
"geo_name": "Wales",
"value": 0
}
]
},
{
"keyword": "skateboarding",
"values": [
{
"geo_id": null,
"geo_name": "England",
"value": 79
},
{
"geo_id": null,
"geo_name": "Northern Ireland",
"value": 100
},
{
"geo_id": null,
"geo_name": "Scotland",
"value": 68
},
{
"geo_id": null,
"geo_name": "Wales",
"value": 100
}
]
},
{
"keyword": "breakdance",
"values": [
{
"geo_id": null,
"geo_name": "England",
"value": 55
},
{
"geo_id": null,
"geo_name": "Northern Ireland",
"value": 0
},
{
"geo_id": null,
"geo_name": "Scotland",
"value": 92
},
{
"geo_id": null,
"geo_name": "Wales",
"value": 100
}
]
}
],
"interests_comparison": {
"items": [
{
"geo_id": null,
"geo_name": "England",
"values": [
27,
2,
69,
3
]
},
{
"geo_id": null,
"geo_name": "Northern Ireland",
"values": [
23,
0,
77,
0
]
},
{
"geo_id": null,
"geo_name": "Scotland",
"values": [
24,
2,
68,
5
]
},
{
"geo_id": null,
"geo_name": "Wales",
"values": [
29,
0,
68,
4
]
}
],
"absolute_items": [
{
"geo_id": null,
"geo_name": "England",
"values": [
31,
2,
79,
3
]
},
{
"geo_id": null,
"geo_name": "Northern Ireland",
"values": [
30,
0,
100,
0
]
},
{
"geo_id": null,
"geo_name": "Scotland",
"values": [
24,
2,
68,
5
]
},
{
"geo_id": null,
"geo_name": "Wales",
"values": [
42,
0,
100,
5
]
}
]
}
},
{
"position": 3,
"type": "demography",
"keywords": [
"surfing",
"sport climbing",
"skateboarding",
"breakdance"
],
"demography": {
"age": [
{
"keyword": "surfing",
"values": [
{
"type": "18-24",
"value": 38
},
{
"type": "25-34",
"value": 92
},
{
"type": "35-44",
"value": 75
},
{
"type": "45-54",
"value": 100
}
]
},
{
"keyword": "sport climbing",
"values": [
{
"type": "18-24",
"value": 0
},
{
"type": "25-34",
"value": 100
},
{
"type": "35-44",
"value": 71
},
{
"type": "45-54",
"value": 0
}
]
},
{
"keyword": "skateboarding",
"values": [
{
"type": "18-24",
"value": 73
},
{
"type": "25-34",
"value": 100
},
{
"type": "35-44",
"value": 77
},
{
"type": "45-54",
"value": 58
}
]
},
{
"keyword": "breakdance",
"values": [
{
"type": "18-24",
"value": 0
},
{
"type": "25-34",
"value": 63
},
{
"type": "35-44",
"value": 100
},
{
"type": "45-54",
"value": 0
}
]
}
],
"gender": [
{
"keyword": "surfing",
"values": [
{
"type": "female",
"value": 100
},
{
"type": "male",
"value": 91
}
]
},
{
"keyword": "sport climbing",
"values": [
{
"type": "female",
"value": 84
},
{
"type": "male",
"value": 100
}
]
},
{
"keyword": "skateboarding",
"values": [
{
"type": "female",
"value": 84
},
{
"type": "male",
"value": 100
}
]
},
{
"keyword": "breakdance",
"values": [
{
"type": "female",
"value": 0
},
{
"type": "male",
"value": 100
}
]
}
]
},
"demography_comparison": {
"age": {
"18-24": [
17,
0,
83,
0
],
"25-34": [
25,
3,
71,
2
],
"35-44": [
26,
2,
69,
3
],
"45-54": [
40,
0,
60,
0
]
},
"gender": {
"female": [
30,
2,
68,
0
],
"male": [
24,
2,
70,
3
]
}
}
}
]
}
]
}
]
}