[PYTHON] Get and visualize google search trends



from pytrends.request import TrendReq
import plotly.graph_objects as go
import pandas as pd

pytrend = TrendReq(hl='ja-jp',tz=540)

kw_list = ['Nike','Adidas','ASICS','Hummel']

pytrend.build_payload(kw_list=kw_list, timeframe='2020-1-1 2020-12-31', geo="JP")

df = pytrend.interest_over_time()

df.to_csv("./brand.csv")

df = pd.read_csv("./brand.csv", engine="python")

go.Figure(
    [
        go.Scatter(x=df["date"], y=df["Nike"], name="Nike"),
        go.Scatter(x=df["date"], y=df["Adidas"], name="Adidas"),
        go.Scatter(x=df["date"], y=df["ASICS"], name="ASICS"),
        go.Scatter(x=df["date"], y=df["Hummel"], name="Hummel"),
    ]
)


Recommended Posts

Get and visualize google search trends
visualize binary search
Get Twitter Trends
Get Google Image Search images in original size
Google App Engine Datastore and Search API integration
Get AKB48 Google+ Posts
[Python] Get Qiita trends
Get the image of "Suzu Hirose" by Google image search.
Scraping google search (image)
Beginners get Qiita tag information and visualize and consider the TOP10.
Search for variables in pandas.DataFrame and get the corresponding row.
Get a global IP and export it to Google Spreadsheets
WordNet structure and synonym search
[python] Get quotient and remainder
[Python] Depth-first search and breadth-first search
Get conversions and revenue with Google Analytics API and report to Slack
Get Keyword Planner Search Volume / CPC / Competitiveness with Google Ads API