Crates.io | gtrend-rs |
lib.rs | gtrend-rs |
version | 0.3.0 |
created_at | 2025-08-19 14:31:00.180947+00 |
updated_at | 2025-08-21 19:00:40.155262+00 |
description | Unofficial client for interacting with Google Trend API |
homepage | |
repository | https://www.github.com/LafCorentin/gtrend-rs |
max_upload_size | |
id | 1802041 |
size | 155,750 |
A Rust client for Google Trends
gtrend-rs is a Rust crate providing a convenient way to access Google Trends data programmatically. It aims to offer a simple and idiomatic API to fetch search trends, including interest over time, regional data, and related topics.
Add the dependency :
cargo add gtrend-rs
The google API works by first sending a Request
containing keywords, period of time etc. Then it returns accesses to widgets containing the interesting data. This first return is represented in the crate as ExploreClient
, from which one can access the widgets.
let client: TrendsClient = TrendsClient::try_default().await.unwrap();
let explore_client: ExploreClient = client.explore(simple_request).await.unwrap();
let timeseries : Timeseries = explore_client
.get_timeseries(WidgetKeyword::All)
.await
.unwrap();
Each widget has its own struct
, but can also be acceeded as serde_json::Value
in case anyone need to access raw data.
Note: The Google Trends API is not officially public. This crate does not yet provide authentication. Excessive queries may result in temporary rate limiting or blocking by Google.
Contributions are welcome. Feel free to open issues or submit pull requests to improve the library.
This project is licensed under the Apache 2.0 License.