#google-api #trend #web-api #web #google-trend

gtrend-rs

Unofficial client for interacting with Google Trend API

4 releases (1 stable)

Uses new Rust 2024

1.1.0 Sep 13, 2025
1.0.0 Sep 13, 2025
0.3.0 Aug 21, 2025
0.2.0 Aug 21, 2025
0.1.1 Aug 19, 2025

#1262 in Web programming

Download history 104/week @ 2025-08-13 220/week @ 2025-08-20 4/week @ 2025-08-27 5/week @ 2025-09-03 270/week @ 2025-09-10 36/week @ 2025-09-17 1/week @ 2025-09-24 21/week @ 2025-10-01 1/week @ 2025-10-08

70 downloads per month
Used in scuriolus

Apache-2.0

95KB
3.5K SLoC

gtrend-rs

A Rust client for Google Trends

Overview

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.

Features

  • Query Google Trends programmatically in Rust
  • Support for interest over time, regional breakdowns, and related topics
  • Example programs included in the examples/ directory

Installation

Add the dependency :

cargo add gtrend-rs

Usage

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.

Contributing

Contributions are welcome. Feel free to open issues or submit pull requests to improve the library.

License

This project is licensed under the Apache 2.0 License.

Dependencies

~8–22MB
~269K SLoC