参考ページ
https://pypi.org/project/pytrends/ https://github.com/GeneralMills/pytrends https://dev.classmethod.jp/articles/pytrends_introduction/
インストール
$ pip install pytrends
コード
from pytrends.request import TrendReq ## 日本時間に合わせるためにtzに540を指定する。tzは分の値を指定する pytrends = TrendReq(hl='ja-JP', tz=540) ## トレンドを検索したいワードを指定する kw_list = ['bootstrap','tailwindcss','Bulma','Materialize'] # googleにリクエストする。 pytrends.build_payload(kw_list=kw_list, timeframe='2021-02-02T00 2021-02-09T00', geo="JP") pytrends.interest_over_time()
実行結果
コード
- 県ごとのトレンド
from pytrends.request import TrendReq ## 日本時間に合わせるためにtzに540を指定する。tzは分の値を指定する pytrends = TrendReq(hl='ja-JP', tz=540) ## トレンドを検索したいワードを指定する kw_list = ['bootstrap','tailwindcss','Bulma','Materialize'] pytrends.build_payload(kw_list=kw_list, timeframe='2021-02-02T00 2021-02-09T00', geo="JP") pytrends.interest_by_region(resolution='COUNTRY', inc_low_vol=True, inc_geo_code=True)
実行結果
結果
- まだまだbootstrapは人気がある