https://github.com/shadawck/rust-trend
Unofficial Rust API for interacting with Google Trend
https://github.com/shadawck/rust-trend
google-trends google-trends-api library rust
Last synced: about 1 year ago
JSON representation
Unofficial Rust API for interacting with Google Trend
- Host: GitHub
- URL: https://github.com/shadawck/rust-trend
- Owner: shadawck
- License: apache-2.0
- Created: 2021-07-03T08:27:01.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2023-06-20T12:58:37.000Z (about 3 years ago)
- Last Synced: 2024-10-31T11:57:52.407Z (over 1 year ago)
- Topics: google-trends, google-trends-api, library, rust
- Language: Rust
- Homepage: https://docs.rs/rtrend
- Size: 408 KB
- Stars: 5
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# rust-trend

## Overview
Unofficial Rust API for interacting with Google Trend
## Documentation
- [Examples Repository](./examples)
- [API Documentation](https://docs.rs/rtrend)
## Example
First, add the dependency to your project:
```sh
cargo add rtrend
```
Then build a client and send the *reqwest* you want :
```rust
use rtrend::{Keywords, Country, Client, RegionInterest};
let country = Country::US;
let keywords = Keywords::new(vec!["Instagram","Facebook"]);
let client = Client::new(keywords, country).build();
// Then select the data you want. The interest of your keywords filtered by region for example:
let region_interest = RegionInterest::new(client).get();
println!("{}", region_interest);
// Result :
//{
// "default": {
// "geoMapData": [
// {
// "formattedValue": [
// "100"
// ],
// "geoCode": "US-CA",
// "geoName": "California",
// "hasData": [
// true
// ],
// "maxValueIndex": 0,
// "value": [
// 100
// ]
// },
//
// ...
//
// {
// "formattedValue": [
// "46"
// ],
// "geoCode": "US-SD",
// "geoName": "South Dakota",
// "hasData": [
// true
// ],
// "maxValueIndex": 0,
// "value": [
// 46
// ]
// }
// ]
// }
//}
```
### More example
- [Simple](./examples/simple.rs)
- [Region Interest](./examples/region_interest.rs)
- [Search Interest](./examples/search_interest.rs)
- [Related Queries](./examples/related_queries.rs)
- [Related Topics](./examples/related_topics.rs)
- [Use filters](./examples/filter.rs)
- [Get response for specific keyword](./examples/select_keyword.rs)
### Roadmap
- [x] Write documentation & Doc Test
[x] Release on crates.io
- [x] Add examples
- [x] Add "TOP" and "RISING" filter
- [x] Add REGION and CITY filter
- [ ] Add METRO filter for country like USA or France
- [ ] Write more tests
- [ ] Make async feature (currently using Reqwest::blocking)
### License
Licensed under either of
- Apache License, Version 2.0
([LICENSE-APACHE](LICENSE-APACHE) or )
- MIT license
([LICENSE-MIT](LICENSE-MIT) or )
at your option.
### Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
dual licensed as above, without any additional terms or conditions.