Skip to content

Repository files navigation

Search Trends

  • Search trends with the help of Google Trends API
  • Compare multiple (upto 5) trends
  • Get line and bar graphs(charts) drawn with Chart.js

Technologies Used

API

Syntax:

importgoogleTrendsfrom"google-trends-api";googleTrends.interestOverTime({keyword: "string",});

Graphing

  • Chart.js script called over CDN
  • Script is runned over the client side

Syntax:

<canvasid="myChart" width="400" height="400"></canvas><script>varctx=document.getElementById("myChart").getContext("2d");varmyChart=newChart(ctx,{ configurations });</script>

Using my API

  • Link:- https://outdated-trends.outdatedguy.rocks/trends
  • Request Body:- Object with property word whose value is array of string(s) [i.e array of words to be searched]
  • Method:- POST
  • Content-Type: application/json
  • Function: Use asyncawait for calling fetch

Example:

(asyncfunctiongetTrends(){constword={word: ["some","words"],// example};constarg={method: "POST",headers: {"Content-Type": "application/json",},body: JSON.stringify(word),};constres=awaitfetch("https://outdated-trends.outdatedguy.rocks/trends",arg);constdata=awaitres.json();console.log(data);})();

About

Trends search made with Google Trends API

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Used by

Contributors

Languages