!pip install pytrends pip install pytrends import pandas as pd from pytrends.request import TrendReq pytrend = TrendReq() pytrend.build_payload(kw_list=['Taylor Swift']) # Interest by Region df = pytrend.interest_by_region() df.head(10) df.reset_index().plot(x='geoName', y='Taylor Swift', figsize=(120, 10), kind ='bar') # Get Google Hot Trends data df = pytrend.trending_searches(pn='united_states') df.head() df = pytrend.today_searches(pn='US') # Get Google Top Charts df = pytrend.top_charts(2019, hl='en-US', tz=300, geo='GLOBAL') df.head() # Get Google Keyword Suggestions keywords = pytrend.suggestions(keyword='Mercedes Benz') df = pd.DataFrame(keywords) df.drop(columns= 'mid') # This column makes no sense pytrend.build_payload(kw_list=['Coronavirus']) # Related Queries, returns a dictionary of dataframes related_queries = pytrend.related_queries() related_queries.values() # Related Topics, returns a dictionary of dataframes related_topic = pytrend.related_topics() related_topic.values()