Rust client for using the NHL Stats API.
Both reqwest
and hyper
clients are avaialable by default, and behind feature flags sync
and async
, respectively.
```rust use nhlstats::sync::configuration::Configuration; use nhlstats::sync::*; use std::rc::Rc;
fn main() -> Result<(), Error> { let config = Rc::from(Configuration::default()); let teams_client = TeamsApiClient::new(config);
// First parameter is expand={modifier}, this can be left blank
// Second parameter is season (both years included)
let teams = teams_client.get_teams("", "20192020")?;
for team in teams.teams.unwrap() {
println!("{:#?}", team);
}
Ok(())
} ```
This API client was generated by the OpenAPI Generator project. By using the openapi-spec from a remote server, you can easily generate an API client.
All URIs are relative to https://statsapi.web.nhl.com/api/v1
| Class | Method | HTTP request | Description | | ---------------- | ----------------------------------------------------------------------- | -------------------------------------- | ------------------------------------------------------------------- | | ConferencesApi | getconference | Get /conferences/{id} | Get an NHL conference. | | *ConferencesApi* | getconferences | Get /conferences | Get all current NHL conferences. | | DivisionsApi | getdivision | Get /divisions/{id} | Get an NHL division. | | *DivisionsApi* | getdivisions | Get /divisions | Get all current NHL divisions. | | DraftApi | getdraft | Get /draft | Get round-by-round data for current year's NHL Entry Draft. | | *DraftApi* | getdraftbyyear | Get /draft/{year} | Get round-by-round data for a specific year's NHL Entry Draft. | | DraftApi | getdraftprospect | Get /draft/prospects/{id} | Get an NHL Entry Draft prospect. | | DraftApi | getdraftprospects | Get /draft/prospects | Get all NHL Entry Draft prospects. | | GamesApi | getgame | Get /game/{id}/feed/live | Get all available data for an NHL game. | | *GamesApi* | getgameboxscore | Get /game/{id}/boxscore | Get the boxscore for an NHL game. | | *GamesApi* | getgamecontent | Get /game/{id}/content | Get editorials, video replays and photo highlights for an NHL game. | | *GamesApi* | getgamediff | Get /game/{id}/feed/live/diffPatch | Get all available data for an NHL game after a specific time. | | *PlayersApi* | getplayer | Get /people/{id} | Get an NHL player. | | PlayersApi | getplayerstats | Get /people/{id}/stats | Get specific statistics for an NHL player. | | ScheduleApi | getschedule | Get /schedule | Get the NHL game schedule. | | *StandingsApi* | getstandingtypes | Get /standingsTypes | Get all available NHL standing types. | | *StandingsApi* | getstandings | Get /standings | Get NHL division standings. | | StandingsApi | getstandingsbytype | Get /standings/{type} | Get NHL standings for a specific standing type. | | *StatsApi* | getstattypes | Get /statTypes | Get all available NHL statistic types. | | *TeamsApi* | getteam | Get /teams/{id} | Get an NHL team. | | TeamsApi | getteamroster | Get /teams/{id}/roster | Get an NHL team's roster. | | TeamsApi | getteamstats | Get /teams/{id}/stats | Get all statistics for an NHL team. | | TeamsApi | get_teams | Get /teams | Get all NHL teams. |