LoginSignup
0
0

More than 1 year has passed since last update.

g-trendsというGoogleトレンドのパッケージを使って、キーワードの出力。

Posted at

はじめに

g-trendsというGoogleトレンドのパッケージを使って、キーワードの出力してみました。

最終更新日

2023年4月26日

環境の情報

OS
Ubuntu2004

注意

最新の状態を確認して下さい。

参考さまはこちら

g-trends

g-trendsというGoogleトレンドのパッケージを使って、キーワードの出力してみました。

環境を作っていきます

nodeを確認します

$ node -v
v14.21.3
$ npm -v
9.6.0

バージョンが出てくれば問題ありません。

インストールします

$ npm install g-trends

作成します。

jsファイルを作りましょう。

main.js
const { ExploreTrendRequest } = require('g-trends')

const explorer = new ExploreTrendRequest()

explorer
.past30Days()
.addKeyword('なんかキーワード')
        .download().then( csv => {
            console.log('OK!!!!')
            console.log(csv)
        }).catch( error => {
            console.log('エラー',error)
        })

実行します。

$ node main.js

以下のようになれば問題ありません🎊
E2CA31F8-B603-458A-AFDC-68C61509A511.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0