Skip to content

Unofficial Rust API for interacting with Google Trend

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

shadawck/rust-trend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

845c4aa · Jun 20, 2023

History

78 Commits
Jul 20, 2022
Jul 27, 2021
Jun 17, 2023
Jul 19, 2021
Jun 17, 2023
Jun 20, 2023
Jul 18, 2021
Jul 18, 2021
Oct 27, 2022
Jul 19, 2021
Jul 19, 2021

Repository files navigation

rust-trend

rust-trend

Overview

Unofficial Rust API for interacting with Google Trend

Documentation

Example

First, add the dependency to your project:

cargo add rtrend

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

Roadmap

  • Write documentation & Doc Test [x] Release on crates.io
  • Add examples
  • Add "TOP" and "RISING" filter
  • 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

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.