Nhl.Api
1.0.1
All versions of this NuGet prior to version 3.0.0 no longer work due to the NHL removing their original REST API and replacing it with a new one. Please use version 3.0.0 for the latest API and features.
See the version list below for details.
dotnet add package Nhl.Api --version 1.0.1
NuGet\Install-Package Nhl.Api -Version 1.0.1
<PackageReference Include="Nhl.Api" Version="1.0.1" />
paket add Nhl.Api --version 1.0.1
#r "nuget: Nhl.Api, 1.0.1"
// Install Nhl.Api as a Cake Addin #addin nuget:?package=Nhl.Api&version=1.0.1 // Install Nhl.Api as a Cake Tool #tool nuget:?package=Nhl.Api&version=1.0.1
The Official Unofficial .NET NHL API 🏒
A C# .NET Standard 2.0 library for the .NET NHL API
Installing Nhl.Api 🏗
You should install Nhl.Api with NuGet:
Install-Package Nhl.Api
Or via the .NET Core command line interface:
dotnet add package Nhl.Api
Either commands, from Package Manager Console or .NET Core CLI, will download and install all required dependencies.
Implementation 🚀
If you are using any type of a inversion of control or dependency injection library such as the built in library within .NET Core, Unity, or AutoFac. It's very simple to implement, or you can create an instance of the NhlApi
class and use the API as you would like.
.NET Core
builder.Services.AddTransient<INhlApi, NhlApi>();
Unity
container.RegisterType<INhlApi, NhlApi>();
AutoFac
builder.RegisterType<NhlApi>().As<INhlApi>();
Simple Object Creation
var nhlApi = new NhlApi();
Documentation 📖
Once registered using your dependency injection library of choice or just using the simple instance of the NHL API. Explore the API and see the all the possibilities.
Contents
<a name='T-Nhl-Api-INhlApi'></a>
NhlApi type
Namespace
Nhl.Api
Summary
The Unofficial NHL API providing various NHL information about players, teams, conferences, divisions, statistics and more
<a name='M-Nhl-Api-INhlApi-GetActiveFranchisesAsync'></a>
GetActiveFranchisesAsync() method
Summary
Returns all active NHL franchises
Returns
A collection of all active NHL franchises, see Franchise for more information
Parameters
This method has no parameters.
<a name='M-Nhl-Api-INhlApi-GetActiveTeamsAsync'></a>
GetActiveTeamsAsync() method
Summary
Returns all active NHL teams
Returns
A collection of all active NHL teams, see Team for more information
Parameters
This method has no parameters.
<a name='M-Nhl-Api-INhlApi-GetConferenceByIdAsync-System-Int32-'></a>
GetConferenceByIdAsync(conferenceId) method
Summary
Returns all of the NHL conferences
Returns
An NHL conference, see Conference for more information
Parameters
Name | Type | Description |
---|---|---|
conferenceId | System.Int32 | The NHL conference id, Example: 6 - Eastern Conference |
<a name='M-Nhl-Api-INhlApi-GetConferencesAsync'></a>
GetConferencesAsync() method
Summary
Returns all of the NHL conferences
Returns
A collection of all the NHL conferences, see Conference for more information
Parameters
This method has no parameters.
<a name='M-Nhl-Api-INhlApi-GetDivisionByIdAsync-System-Int32-'></a>
GetDivisionByIdAsync(divisionId) method
Summary
Returns an NHL division by the division id
Returns
Returns an NHL division, see Division for more information
Parameters
Name | Type | Description |
---|---|---|
divisionId | System.Int32 | The NHL division id, Example: 17 - Atlantic divison |
<a name='M-Nhl-Api-INhlApi-GetDivisionsAsync'></a>
GetDivisionsAsync() method
Summary
Returns all of the NHL divisions
Returns
A collection of all the NHL divisions, see Division for more information
Parameters
This method has no parameters.
<a name='M-Nhl-Api-INhlApi-GetDraftByYear-System-String-'></a>
GetDraftByYear(year) method
Summary
Returns the NHL league draft based on a specific year based on the 4 character draft year, see DraftYear for more information. Some NHL draft years responses provide very large JSON payloads
Returns
The NHL league draft, which includes draft rounds, player information and more, see LeagueDraft for more information
Parameters
Name | Type | Description |
---|---|---|
year | System.String | The specified year of the NHL draft, see DraftYear for all NHL draft years |
<a name='M-Nhl-Api-INhlApi-GetEventTypesAsync'></a>
GetEventTypesAsync() method
Summary
Return's all the event types within the NHL
Returns
A collection of event types within the NHL, see EventType for more information
Parameters
This method has no parameters.
<a name='M-Nhl-Api-INhlApi-GetFranchiseByIdAsync-System-Int32-'></a>
GetFranchiseByIdAsync() method
Summary
Returns an NHL franchise by the franchise id
Returns
An NHL franchise, see Franchise for more information
Parameters
This method has no parameters.
<a name='M-Nhl-Api-INhlApi-GetFranchisesAsync'></a>
GetFranchisesAsync() method
Summary
Returns all NHL franchises, including information such as team name, location and more
Returns
A collection of all NHL franchises, see Franchise for more information
Parameters
This method has no parameters.
<a name='M-Nhl-Api-INhlApi-GetGameScheduleByDateAsnyc-System-Nullable{System-DateTime}-'></a>
GetGameScheduleByDateAsnyc(date) method
Summary
Return's the NHL game schedule based on the provided DateTime. If the date is null, it will provide today's current NHL game schedule
Returns
NHL game schedule, see GameSchedule for more information
Parameters
Name | Type | Description |
---|---|---|
date | System.Nullable{System.DateTime} | The requested date for the NHL game schedule |
<a name='M-Nhl-Api-INhlApi-GetGameScheduleByDateAsnyc-System-Int32,System-Int32,System-Int32-'></a>
GetGameScheduleByDateAsnyc(year,month,day) method
Summary
Return's the NHL game schedule based on the provided year, month and day
Returns
NHL game schedule, see GameSchedule for more information
Parameters
Name | Type | Description |
---|---|---|
year | System.Int32 | The requested year for the NHL game schedule |
month | System.Int32 | The requested month for the NHL game schedule |
day | System.Int32 | The requested day for the NHL game schedule |
<a name='M-Nhl-Api-INhlApi-GetGameStatusesAsync'></a>
GetGameStatusesAsync() method
Summary
Returns all of the valid NHL game statuses of an NHL game
Returns
A collection of NHL game statues, see GameStatus for more information
Parameters
This method has no parameters.
<a name='M-Nhl-Api-INhlApi-GetGameTypesAsync'></a>
GetGameTypesAsync() method
Summary
Returns all of the NHL game types within a season and within special events
Returns
A collection of NHL and other sporting event game types, see GameType for more information
Parameters
This method has no parameters.
<a name='M-Nhl-Api-INhlApi-GetInactiveFranchisesAsync'></a>
GetInactiveFranchisesAsync() method
Summary
Returns all inactive NHL franchises
Returns
A collection of all inactive NHL franchises, see Franchise for more information
Parameters
This method has no parameters.
<a name='M-Nhl-Api-INhlApi-GetInactiveTeamsAsync'></a>
GetInactiveTeamsAsync() method
Summary
Returns all inactive NHL teams
Returns
A collection of all active NHL teams, see Team for more information
Parameters
This method has no parameters.
<a name='M-Nhl-Api-INhlApi-GetLeagueAwardByIdAsync-System-Int32-'></a>
GetLeagueAwardByIdAsync(leagueAwardId) method
Summary
Returns an NHL award by the award id
Example: 1 - Stanley Cup
Returns
A collection of all the NHL awards, see Award for more information
Parameters
Name | Type | Description |
---|---|---|
leagueAwardId | System.Int32 | The NHL league award identifier |
<a name='M-Nhl-Api-INhlApi-GetLeagueAwardsAsync'></a>
GetLeagueAwardsAsync() method
Summary
Returns all of the NHL awards, including the description, history, and images
Returns
A collection of all the NHL awards, see Award for more information
Parameters
This method has no parameters.
<a name='M-Nhl-Api-INhlApi-GetLeagueProspectByIdAsync-System-Int32-'></a>
GetLeagueProspectByIdAsync() method
Summary
Returns an NHL prospect profile by their prospect id
Returns
An NHL prospect, see ProspectProfile for more information
Parameters
This method has no parameters.
<a name='M-Nhl-Api-INhlApi-GetLeagueProspectsAsync'></a>
GetLeagueProspectsAsync() method
Summary
Returns all the NHL league prospects The NHL prospects response provides a very large JSON payload
Returns
A collection of all the NHL prospects, see ProspectProfile for more information
Parameters
This method has no parameters.
<a name='M-Nhl-Api-INhlApi-GetLeagueStandingTypesAsync'></a>
GetLeagueStandingTypesAsync() method
Summary
Returns all of the NHL league standing types, this includes playoff and preseason standings
Returns
A collection of all the NHL standing types, see LeagueStandingType for more information
Parameters
This method has no parameters.
<a name='M-Nhl-Api-INhlApi-GetLeagueStandingsAsync-System-Nullable{System-DateTime}-'></a>
GetLeagueStandingsAsync(date) method
Summary
Returns the standings of every team in the NHL for the provided date, if the date is null it will provide the current NHL league standings
Returns
A collection of all the leauge standings
Parameters
Name | Type | Description |
---|---|---|
date | System.Nullable{System.DateTime} | The NHL league standings date for the request NHL standings |
<a name='M-Nhl-Api-INhlApi-GetLeagueVenueByIdAsync-System-Int32-'></a>
GetLeagueVenueByIdAsync(venueId) method
Summary
Returns an NHL venue by the venue id
Example: 5058 - Canada Life Centre
Returns
A collection of NHL stadiums and arenas, see LeagueVenue for more information
Parameters
Name | Type | Description |
---|---|---|
venueId | System.Int32 | The specified id of an NHL venue, |
<a name='M-Nhl-Api-INhlApi-GetLeagueVenuesAsync'></a>
GetLeagueVenuesAsync() method
Summary
Returns all of the NHL venue's, including arenas and stadiums This is not a comprehnsive list of all NHL stadiums and arenas
Returns
A collection of NHL stadiums and arenas, see LeagueVenue for more information
Parameters
This method has no parameters.
<a name='M-Nhl-Api-INhlApi-GetPlayTypesAsync'></a>
GetPlayTypesAsync() method
Summary
Returns a collection of all the play types within the duration of an NHL game
Returns
A collection of distinct play types, see PlayType for more information
Parameters
This method has no parameters.
<a name='M-Nhl-Api-INhlApi-GetPlayerByIdAsync-System-Int32-'></a>
GetPlayerByIdAsync(playerId) method
Summary
Returns an NHL player by their player id, includes information such as age, weight, position and more
Returns
An NHL player profile, see Player for more information
Parameters
Name | Type | Description |
---|---|---|
playerId | System.Int32 | An NHL player id, Example: 8478402 - Connor McDavid |
<a name='M-Nhl-Api-INhlApi-GetPlayoffTournamentTypesAsync'></a>
GetPlayoffTournamentTypesAsync() method
Summary
Returns a collection of all the different types of playoff tournaments in the NHL
Returns
A collection of tournament types, see PlayoffTournamentType for more information
Parameters
This method has no parameters.
<a name='M-Nhl-Api-INhlApi-GetSeasonByYearAsync-System-String-'></a>
GetSeasonByYearAsync(seasonYear) method
Summary
Returns the NHL season information based on the provided season years
Returns
An NHL season based on the provided season year, Example - "20172018"
Parameters
Name | Type | Description |
---|---|---|
seasonYear | System.String | See SeasonYear for all valid season year arguments |
<a name='M-Nhl-Api-INhlApi-GetSeasonsAsync'></a>
GetSeasonsAsync() method
Summary
Returns all of the NHL seasons since the inception of the league in 1917-1918
Returns
A collection of seasons since the inception of the NHL
Parameters
This method has no parameters.
<a name='M-Nhl-Api-INhlApi-GetStatisticTypesAsync'></a>
GetStatisticTypesAsync() method
Summary
Returns all distinct types of NHL statistics types
Returns
A collection of all the various NHL statistics types, see StatisticTypes for more information
Parameters
This method has no parameters.
<a name='M-Nhl-Api-INhlApi-GetTeamByIdAsync-System-Int32-'></a>
GetTeamByIdAsync(teamId) method
Summary
Returns an NHL team by the team id
Returns
An NHL team with information including name, location, division and more, see Team for more information
Parameters
Name | Type | Description |
---|---|---|
teamId | System.Int32 | The NHL team id, Example: 10 - Toronto Maple Leafs |
<a name='M-Nhl-Api-INhlApi-GetTeamStatisticsByIdAsync-System-Int32,System-String-'></a>
GetTeamStatisticsByIdAsync(teamId,seasonYear) method
Summary
Returns a specified NHL team's statistics for the the specified season, the most recent season statistics will be returned
Returns
A collection of all the specified NHL team statistics for the specified season
Parameters
Name | Type | Description |
---|---|---|
teamId | System.Int32 | The NHL team id, example: Toronto Maple Leafs - 10 |
seasonYear | System.String | The NHL season year, see SeasonYear for all valid seasons, example: 20202021 |
<a name='M-Nhl-Api-INhlApi-GetTeamsAsync'></a>
GetTeamsAsync() method
Summary
Returns all active and inactive NHL teams
Returns
A collection of all NHL teams, see Team for more information
Parameters
This method has no parameters.
<a name='M-Nhl-Api-INhlApi-GetTournamentTypesAsync'></a>
GetTournamentTypesAsync() method
Summary
Returns a collection of all the different types of tournaments in the hockey
Returns
A collection of tournament types, see TournamentType for more information
Parameters
This method has no parameters.
Bugs 🐛
If you have any issues with the library or suggestions, please feel free to create an issue and it will be adressed as soon as possible 😃
Feature Backlog 📈
Here are some of the future items I would like to add and are currently in the backlog:
- Content Feed for Live Games
- Player Search within the NHL league
- Add additional API functionality for ease of searching for various NHL entities
- Add NHL player enum dynamically generated by T4 runtime templates
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Newtonsoft.Json (>= 13.0.1)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Nhl.Api:
Package | Downloads |
---|---|
Nhl.Api.Extensions.Microsoft.DependencyInjection
The Microsoft .NET dependency injection library extension for the official unofficial .NET NHL API |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated | |
---|---|---|---|
3.6.0 | 158 | 11/5/2024 | |
3.5.0 | 503 | 9/30/2024 | |
3.4.2 | 477 | 8/9/2024 | |
3.4.1 | 203 | 3/28/2024 | |
3.4.0 | 166 | 3/8/2024 | |
3.3.0 | 259 | 2/24/2024 | |
3.2.2 | 162 | 1/30/2024 | |
3.2.1 | 128 | 1/30/2024 | |
3.2.0 | 152 | 1/24/2024 | |
3.1.0 | 208 | 1/5/2024 | |
3.0.0 | 202 | 12/31/2023 | |
2.2.1 | 2,655 | 10/9/2023 | |
2.2.0 | 5,180 | 9/1/2023 | |
2.1.0 | 13,410 | 10/18/2022 | |
2.0.0 | 1,812 | 7/28/2022 | |
1.9.2 | 706 | 3/17/2022 | |
1.9.1 | 697 | 2/20/2022 | |
1.9.0 | 735 | 1/28/2022 | |
1.8.0 | 391 | 12/30/2021 | |
1.7.0 | 415 | 12/21/2021 | |
1.6.1 | 461 | 12/12/2021 | |
1.6.0 | 621 | 12/11/2021 | |
1.5.1 | 2,036 | 11/26/2021 | |
1.5.0 | 1,925 | 11/26/2021 | |
1.4.0 | 1,242 | 11/15/2021 | |
1.3.0 | 532 | 10/28/2021 | |
1.2.0 | 328 | 10/14/2021 | |
1.1.3 | 355 | 10/8/2021 | |
1.1.2 | 346 | 10/8/2021 | |
1.1.1 | 315 | 10/8/2021 | |
1.1.0 | 349 | 10/8/2021 | |
1.0.2 | 338 | 9/30/2021 | |
1.0.1 | 353 | 9/30/2021 | |
1.0.0 | 424 | 9/30/2021 |