yelp-fusion-rs

Crates.ioyelp-fusion-rs
lib.rsyelp-fusion-rs
version
sourcesrc
created_at2022-09-08 06:46:41.844693+00
updated_at2025-02-22 23:11:25.588876+00
descriptionA Rust library for the Yelp Fusion API.
homepagehttps://www.toddgriffin.me/
repositoryhttps://github.com/goddtriffin/yelp-fusion-rs
max_upload_size
id660882
Cargo.toml error:TOML parse error at line 26, column 1 | 26 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Todd Griffin (goddtriffin)

documentation

README

yelp-fusion-rs

Version Docs

A Rust library for the Yelp Fusion API.

Features

Examples

Search for businesses based on custom criteria!

YELP_FUSION_API_KEY=<api_key> cargo run --example business_search

#[tokio::main]
async fn main() -> Result<(), Error> {
    let yelp_fusion_api_key = env::var("YELP_FUSION_API_KEY").expect("no Yelp Fusion API key");

    let yelp_fusion_client: YelpFusion = YelpFusion::new(yelp_fusion_api_key, None);
    let business_search_payload: BusinessSearchPayload = BusinessSearchPayload::builder()
            .coordinates(Coordinates::new(37.772_484, -122.396_68))
            .radius(1609)
            .categories(vec![String::from("mexican"), String::from("sandwiches")])
            .limit(50)
            .price(HashSet::from([
              PriceType::OneDollar, 
              PriceType::TwoDollar, 
              PriceType::ThreeDollar, 
              PriceType::FourDollar,
            ]))
            .open_now(false)
            .build()
            .unwrap();
    let business_search_response: BusinessSearchResponse = yelp_fusion_client
            .business_search(business_search_payload)
            .await?;
    
    println!(
        "{}",
        serde_json::to_string(&business_search_response).unwrap()
    );
    Ok(())
}

For more examples, check out the examples directory.

Developers

Project is under active maintenance - even if there are no recent commits! Please submit an issue / bug request if the library needs updating for any reason!

Feature Requests

Implement the rest of the features: Business, Event, Category endpoints

Currently, I only have a use-case for Yelp Fusion API's Business Search endpoint, so I haven't prioritized developing the rest of the Business, Event, and Category endpoints.

I fully intend to implement all of those features so that this library can do everything the Yelp Fusion API allows.

If you have a dire need for any of those endpoints, please ping me via an issue on Github and I'll know to prioritize that work. If you're feeling extra adventurous and/or REALLY need those endpoints implemented, please send a pull request :)

Commands

  • make lint
  • make test
  • make fix

Credits

Made with 🤬 and 🥲 by Todd Everett Griffin.

Commit count: 19

cargo fmt