https://github.com/outdatedguy/search-trends
Trends search made with Google Trends API
https://github.com/outdatedguy/search-trends
chartjs google-trends google-trends-api trends
Last synced: 6 months ago
JSON representation
Trends search made with Google Trends API
- Host: GitHub
- URL: https://github.com/outdatedguy/search-trends
- Owner: OutdatedGuy
- License: bsd-3-clause
- Created: 2021-08-01T16:57:24.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-01-01T14:24:19.000Z (9 months ago)
- Last Synced: 2025-03-08T00:03:51.716Z (7 months ago)
- Topics: chartjs, google-trends, google-trends-api, trends
- Language: JavaScript
- Homepage: https://outdated-trends.outdatedguy.rocks
- Size: 157 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Search Trends
- Search trends with the help of [Google Trends](https://trends.google.com/trends/) API
- Compare multiple (upto 5) trends
- Get line and bar graphs(charts) drawn with [Chart.js](https://www.chartjs.org/)# Technologies Used
- [Chart.js](https://www.chartjs.org/)
- [google-trends-api](https://www.npmjs.com/package/google-trends-api)
- [express](https://expressjs.com/)# API
- An NPM package called [google-trends-api](https://www.npmjs.com/package/google-trends-api)
- Package is runned over the server sideSyntax:
```js
import googleTrends from "google-trends-api";googleTrends.interestOverTime({
keyword: "string",
});
```# Graphing
- Chart.js script called over [CDN](https://cdn.jsdelivr.net/npm/chart.js)
- Script is runned over the client sideSyntax:
```html
var ctx = document.getElementById("myChart").getContext("2d");
var myChart = new Chart(ctx, { configurations });```
# 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 `async` `await` for calling fetchExample:
```js
(async function getTrends() {
const word = {
word: ["some", "words"], // example
};const arg = {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(word),
};const res = await fetch("https://outdated-trends.outdatedguy.rocks/trends", arg);
const data = await res.json();
console.log(data);
})();
```