#japan #transit #api-bindings

yxhoo-transit

A client for Yxhoo! Transit (Japan) unofficial API

11 unstable releases (3 breaking)

Uses new Rust 2024

new 0.4.5 Apr 19, 2026
0.4.4 Dec 25, 2025
0.3.0 Dec 19, 2025
0.2.1 Dec 19, 2025
0.1.1 Dec 19, 2025

#305 in HTTP client

Apache-2.0 and maybe LGPL-3.0

40KB
848 lines

yxhoo-transit

crates.io docs.rs downloads license CI

日本語 README

A Rust client for Yxhoo! Transit (Japan) unofficial API. This crate provides functions to suggest places and search for transit routes using Yxhoo! Transit.

Usage

Add this to your Cargo.toml:

[dependencies]
yxhoo-transit = "0.4"

Features

  • http-reqwest (default): Use reqwest as the HTTP client.
  • http-wreq: Use wreq as the HTTP client.
  • schemars: Enable JsonSchema derives for public types.

Example

use yxhoo_transit::{suggest_places, transit, args::{TransitArgs, DateKind}};

#[tokio::main]
async fn main() {
    // Suggest places
    let suggestions = suggest_places("新宿").await.unwrap();
    println!("{:?}", suggestions);

    // Transit search
    let args = TransitArgs {
        from: "新宿".into(),
        to: "渋谷".into(),
        date: chrono::Local::now().into(),
        date_kind: DateKind::DepartureTime,
        rank: 1,
        ..Default::default()
    };
    let result = transit(&args).await.unwrap();
    println!("{:?}", result);
}

License

Apache-2.0

Dependencies

~4–26MB
~406K SLoC