Nhl.Api 1.1.1

Additional Details

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.

There is a newer version of this package available.
See the version list below for details.
dotnet add package Nhl.Api --version 1.1.1                
NuGet\Install-Package Nhl.Api -Version 1.1.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Nhl.Api" Version="1.1.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Nhl.Api --version 1.1.1                
#r "nuget: Nhl.Api, 1.1.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Nhl.Api as a Cake Addin
#addin nuget:?package=Nhl.Api&version=1.1.1

// Install Nhl.Api as a Cake Tool
#tool nuget:?package=Nhl.Api&version=1.1.1                

Build/Test Build/Test NuGet Issues License Maintenance

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-NhlApi'></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-NhlApi-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-NhlApi-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-NhlApi-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: Eastern Conference is the number 6

<a name='M-Nhl-Api-NhlApi-GetConferenceByIdAsync-Nhl-Api-Models-Enumerations-Conference-ConferenceEnum-'></a>

GetConferenceByIdAsync(conference) method

Summary

Returns the NHL conference by the conference enumeration Example: Eastern

Returns

An NHL conference, see Conference for more information

Parameters
Name Type Description
conference Nhl.Api.Models.Enumerations.Conference.ConferenceEnum The NHL conference id, Example: 6 - Eastern Conference, see ConferenceEnum for more information on NHL conferences

<a name='M-Nhl-Api-NhlApi-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-NhlApi-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: Atlantic division is the number 17

<a name='M-Nhl-Api-NhlApi-GetDivisionByIdAsync-Nhl-Api-Models-Enumerations-Division-DivisionEnum-'></a>

GetDivisionByIdAsync(division) method

Summary

Returns an NHL division by the division enumeration Example: Atlantic

Returns

Returns an NHL division, see Division for more information

Parameters
Name Type Description
division Nhl.Api.Models.Enumerations.Division.DivisionEnum The NHL division id, Example: 17 - Atlantic division, see DivisionEnum for more information on NHL divisions

<a name='M-Nhl-Api-NhlApi-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-NhlApi-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 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-NhlApi-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-NhlApi-GetFranchiseByIdAsync-System-Int32-'></a>

GetFranchiseByIdAsync(franchiseId) method

Summary

Returns an NHL franchise by the franchise id

Returns

An NHL franchise, see Franchise for more information

Parameters
Name Type Description
franchiseId System.Int32 The NHL franchise id, example: MontrΓ©al Canadiens - 1

<a name='M-Nhl-Api-NhlApi-GetFranchiseByIdAsync-Nhl-Api-Domain-Enumerations-Franchise-FranchiseEnum-'></a>

GetFranchiseByIdAsync(franchise) method

Summary

Returns an NHL franchise by the franchise id Example: LosAngelesKings

Returns

An NHL franchise, see Franchise for more information

Parameters
Name Type Description
franchise Nhl.Api.Domain.Enumerations.Franchise.FranchiseEnum The NHL team id, Example: 10 - Toronto Maple Leafs, see FranchiseEnum for more information on NHL franchises

<a name='M-Nhl-Api-NhlApi-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-NhlApi-GetGameScheduleByDateAsync-System-Nullable{System-DateTime}-'></a>

GetGameScheduleByDateAsync(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-NhlApi-GetGameScheduleByDateAsync-System-Int32,System-Int32,System-Int32-'></a>

GetGameScheduleByDateAsync(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-NhlApi-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-NhlApi-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-NhlApi-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-NhlApi-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-NhlApi-GetLeagueAwardByIdAsync-System-Int32-'></a>

GetLeagueAwardByIdAsync(awardId) method

Summary

Returns an NHL award by id

Returns

An NHL award, see Award for more information

Parameters
Name Type Description
awardId System.Int32 The identifier for the NHL award, Example: Ted Lindsay Award - 13

<a name='M-Nhl-Api-NhlApi-GetLeagueAwardByIdAsync-Nhl-Api-Models-Enumerations-Award-AwardEnum-'></a>

GetLeagueAwardByIdAsync(leagueAward) method

Summary

Returns an NHL award by the award id Example: StanleyCup

Returns

An NHL award, see Award for more information

Parameters
Name Type Description
leagueAward Nhl.Api.Models.Enumerations.Award.AwardEnum The NHL league award identifier, see AwardEnum for more information on NHL awards

<a name='M-Nhl-Api-NhlApi-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-NhlApi-GetLeagueProspectByIdAsync-System-Int32-'></a>

GetLeagueProspectByIdAsync(prospectId) method

Summary

Returns an NHL prospect profile by their prospect id

Returns

An NHL prospect, see ProspectProfile for more information

Parameters
Name Type Description
prospectId System.Int32 The NHL prospect id, Example: 86515 - Francesco Pinelli

<a name='M-Nhl-Api-NhlApi-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-NhlApi-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-NhlApi-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 league 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-NhlApi-GetLeagueTeamRosterMembersAsync'></a>

GetLeagueTeamRosterMembersAsync() method

Summary

Returns all of the active NHL players

Returns

A collection of all NHL players

Parameters

This method has no parameters.

<a name='M-Nhl-Api-NhlApi-GetLeagueVenueByIdAsync-System-Int32-'></a>

GetLeagueVenueByIdAsync(venueId) method

Summary

Returns an NHL venue by the venue id Example: 5058 - Canada Life Centre

Returns

An NHL venue, see LeagueVenue for more information

Parameters
Name Type Description
venueId System.Int32 The specified id of an NHL venue,

<a name='M-Nhl-Api-NhlApi-GetLeagueVenueByIdAsync-Nhl-Api-Domain-Enumerations-Venue-VenueEnum-'></a>

GetLeagueVenueByIdAsync(venue) method

Summary

Returns an NHL venue by the venue enumeration Example: EnterpriseCenter

Returns

An NHL venue, see LeagueVenue for more information

Parameters
Name Type Description
venue Nhl.Api.Domain.Enumerations.Venue.VenueEnum The specified NHL venue, see VenueEnum for more information on NHL venues

<a name='M-Nhl-Api-NhlApi-GetLeagueVenuesAsync'></a>

GetLeagueVenuesAsync() method

Summary

Returns all of the NHL venue's, including arenas and stadiums This is not a comprehensive 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-NhlApi-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-NhlApi-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 is Connor McDavid

<a name='M-Nhl-Api-NhlApi-GetPlayerByIdAsync-Nhl-Api-Models-Enumerations-Player-PlayerEnum-'></a>

GetPlayerByIdAsync(player) 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
player Nhl.Api.Models.Enumerations.Player.PlayerEnum An NHL player id, Example: 8478402 - Connor McDavid, see PlayerEnum for more information on NHL players

<a name='M-Nhl-Api-NhlApi-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-NhlApi-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-NhlApi-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-NhlApi-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-NhlApi-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: Toronto Maple Leafs - 10

<a name='M-Nhl-Api-NhlApi-GetTeamByIdAsync-Nhl-Api-Models-Enumerations-Team-TeamEnum-'></a>

GetTeamByIdAsync(team) method

Summary

Returns an NHL team by the team enumeration Example: SeattleKraken

Returns

An NHL team with information including name, location, division and more, see Team for more information on teams

Parameters
Name Type Description
team Nhl.Api.Models.Enumerations.Team.TeamEnum The NHL team id, Example: 10 - Toronto Maple Leafs, see TeamEnum for more information on NHL teams

<a name='M-Nhl-Api-NhlApi-GetTeamStatisticsByIdAsync-System-Int32,System-String-'></a>

GetTeamStatisticsByIdAsync(teamId,seasonYear) method

Summary

Returns a specified NHL team's statistics for 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-NhlApi-GetTeamStatisticsByIdAsync-Nhl-Api-Models-Enumerations-Team-TeamEnum,System-String-'></a>

GetTeamStatisticsByIdAsync(team,seasonYear) method

Summary

Returns a specified NHL team's statistics for 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
team Nhl.Api.Models.Enumerations.Team.TeamEnum The NHL team id, example: AnaheimDucks
seasonYear System.String The NHL season year, see SeasonYear for all valid seasons, example: 20202021

<a name='M-Nhl-Api-NhlApi-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-NhlApi-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.

<a name='M-Nhl-Api-NhlApi-SearchLeagueTeamRosterMembersAsync-System-String-'></a>

SearchLeagueTeamRosterMembersAsync(query) method

Summary

Returns all of the active NHL players based on the search query provided

Returns

A collection of all NHL players based on the search query provided

Parameters
Name Type Description
query System.String An search term to find NHL players, Example: "Auston Matthews" or "Carey Pr.." or "John C"

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:

  • 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
  • Content Feed for Live Games
Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.1 142 11/25/2024
3.6.0 232 11/5/2024
3.5.0 507 9/30/2024
3.4.2 517 8/9/2024
3.4.1 205 3/28/2024
3.4.0 168 3/8/2024
3.3.0 261 2/24/2024
3.2.2 164 1/30/2024
3.2.1 132 1/30/2024
3.2.0 154 1/24/2024
3.1.0 210 1/5/2024
3.0.0 204 12/31/2023
2.2.1 2,657 10/9/2023 2.2.1 is deprecated because it has critical bugs.
2.2.0 5,182 9/1/2023 2.2.0 is deprecated because it has critical bugs.
2.1.0 13,412 10/18/2022 2.1.0 is deprecated because it has critical bugs.
2.0.0 1,814 7/28/2022 2.0.0 is deprecated because it has critical bugs.
1.9.2 708 3/17/2022 1.9.2 is deprecated because it has critical bugs.
1.9.1 699 2/20/2022 1.9.1 is deprecated because it has critical bugs.
1.9.0 737 1/28/2022 1.9.0 is deprecated because it has critical bugs.
1.8.0 393 12/30/2021 1.8.0 is deprecated because it has critical bugs.
1.7.0 417 12/21/2021 1.7.0 is deprecated because it has critical bugs.
1.6.1 463 12/12/2021 1.6.1 is deprecated because it has critical bugs.
1.6.0 623 12/11/2021 1.6.0 is deprecated because it has critical bugs.
1.5.1 2,038 11/26/2021 1.5.1 is deprecated because it has critical bugs.
1.5.0 1,927 11/26/2021 1.5.0 is deprecated because it has critical bugs.
1.4.0 1,244 11/15/2021 1.4.0 is deprecated because it has critical bugs.
1.3.0 534 10/28/2021 1.3.0 is deprecated because it has critical bugs.
1.2.0 330 10/14/2021 1.2.0 is deprecated because it has critical bugs.
1.1.3 357 10/8/2021 1.1.3 is deprecated because it has critical bugs.
1.1.2 348 10/8/2021 1.1.2 is deprecated because it has critical bugs.
1.1.1 319 10/8/2021 1.1.1 is deprecated because it has critical bugs.
1.1.0 351 10/8/2021 1.1.0 is deprecated because it has critical bugs.
1.0.2 340 9/30/2021 1.0.2 is deprecated because it has critical bugs.
1.0.1 355 9/30/2021 1.0.1 is deprecated because it has critical bugs.
1.0.0 426 9/30/2021 1.0.0 is deprecated because it has critical bugs.