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