Expand description
§rust-trend
This lib is a work in progress
§Overview
Unofficial Rust API for interacting with Google Trend
§Documentation
§Example
First, add the dependency to your cargo.toml
:
[dependencies]
rtrend = "0.1.3"
Then build a client and send the reqwest you want :
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
- Region Interest
- Search Interest
- Related Queries
- Related Topics
- Use filters
- Get response for specific keyword
§Roadmap
- Write documentation & Doc Test
- Release on crates.io
- Add examples
- Add “TOP” and “RISING” filter
- Write more tests
-
Make async feature (currently using
Reqwest::blocking
)
§License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
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.
Re-exports§
pub use category::Category;
pub use client::Client;
pub use country::Country;
pub use keywords::Keywords;
pub use lang::Lang;
pub use period::Period;
pub use property::Property;
pub use region_interest::RegionInterest;
pub use related_queries::RelatedQueries;
pub use related_topics::RelatedTopics;
pub use search_interest::SearchInterest;
Modules§
- category
- Represent Google Trend Categories.
- client
- Client used to initialize everything needed by the Google Trend API.
- country
- Represent Google Trend Country.
- keywords
- A list of keywords to query on Google Trend Keywords is limited to a maximum of 5 keywords.
- lang
- Represent all langage supported by google.
- period
- Represent period predefined by Google Trend.
- property
- Represent a Google Trend Property
- region_
interest - Represent Google Trend geo maps.
- related_
queries - Represent Google Trend Related Queries list.
- related_
topics - Represent Google Trend Related Topics list.
- search_
interest - Represent keywords interest over time.