Input/Output
Search Timewise
Gather data for google searches over time.
- param searchwords
Lookup each input word and return the (normalized) frequency of google searches. Example: [‘Corona’,’earth quake’]
- type searchwords
list
- param geo
Filter on geographical locations. ‘NL’ (only netherlands) [‘NL’,’germany’,’IT’]
- type geo
list, optional
- param date_start
String: Start date for counting.
- type date_start
str [dd-mm-yyyy]
- param date_stop
String: Stop date for counting. If nothing is filled in, date of today is used.
- type date_stop
str [dd-mm-yyyy], optional
- param method
Type of google search. The default is ‘news’. Choose on of those: ‘images’,’news’,’youtube’,’froogle’
- type method
str, optional
- param verbose
Print message to screen. The default is 3.
- type verbose
int, optional
- raises Exception
code 429: Too Many google requests in a given amount of time (“rate limiting”).
- returns
method (str) : Type of method.
dict of dataframes : Per country the counts for searchwords.
geo (list): The abrevations of the country names.
geo_names (list): The full name of hte countries.
searchwords (list): The input searchwords.
date_range (str): The date: [from To].
- rtype
dict containing results.
Examples
>>> result = googletrends.temporal(['bitcoin','ethereum'], geo=['nl', 'united states'], date_start='01-12-2019')
>>> googletrends.plot(result)
Search Geographically
Gather data for google searches over geographical locations and time.
- param searchwords
Lookup each input word and return the (normalized) frequency of google searches. Example: [‘Corona’,’earth quake’]
- type searchwords
list
- param geo
Filter on geographical locations. ‘NL’ (only netherlands) [‘NL’,’germany’,’IT’]
- type geo
list, optional
- param date_start
String: Start date for counting.
- type date_start
str [dd-mm-yyyy]
- param date_stop
String: Stop date for counting. If nothing is filled in, date of today is used.
- type date_stop
str [dd-mm-yyyy], optional
- param method
Type of google search. The default is ‘news’. Choose on of those: ‘images’,’news’,’youtube’,’froogle’
- type method
str, optional
- param include_suggestions
Include suggestions. The default is False.
- type include_suggestions
bool, optional
- param verbose
Print message to screen. The default is 3.
- type verbose
int, optional
- raises Exception
code 429: Too Many google requests in a given amount of time (“rate limiting”).
- returns
- Each input country has the following keys:
method (str) : Type of method.
dict of dataframes : Per country the counts for searchwords.
geo (list): The abrevations of the country names.
geo_names (list): The full name of the countries.
searchwords (list): The input searchwords.
date_range (str): The date: [from To].
- rtype
dict containing results.
Examples
>>> result = googletrends.spatio(['bitcoin','ethereum'], geo=['nl','italy'], date_start='01-12-2012')
>>> googletrends.plot(result)
Search Trending
Trending google searches.
Description
If you choose a time period that is 3 months or shorter you get daily data, otherwise you get weekly data. If the time period is 3 years or longer, the monthly data is plotted, otherwise it is weekly data.
- param searchwords
Lookup each input word and return the (normalized) frequency of google searches. Example: [‘Corona’,’earth quake’]
- type searchwords
list
- param geo
Filter on geographical locations. ‘NL’ (only netherlands), [‘NL’,’germany’,’IT’], ‘world’ to examine all countries
- type geo
list, optional
- param date_start
String: Start date for counting.
- type date_start
str [dd-mm-yyyy]
- param date_stop
String: Stop date for counting. If nothing is filled in, date of today is used.
- type date_stop
str [dd-mm-yyyy], optional
- param method
Type of google search. The default is ‘news’. Choose on of those: ‘images’,’news’,’youtube’,’froogle’
- type method
str, optional
- param verbose
Print message to screen. The default is 3.
- type verbose
int, optional
- raises Exception
code 429: Too Many google requests in a given amount of time (“rate limiting”).
- rtype
dict containing results.
Examples
>>> result = googletrends.spatio(['bitcoin','ethereum'], geo=['nl','italy'], date_start='01-12-2012')
>>> googletrends.plot(result)
>>> # Plot only on the worldmap
>>> googletrends.plot_worldmap(result)