Step7750
Registered User
After going through the network traffic of NHL's services, I have compiled a list of URLs that the NHL uses to obtain stats for certain players, teams, standings, etc... Best of all, all of this data is free and does not require any sort of API Key or anything of that nature.
This data came from the network traffic of NHL.com on a PC, NHL Gamecenter App on an iPhone, and TSN's iPhone App. There is no HTML/Web scraping involved
To make the data more readable, please use www.jsonlint.com to parse it.
JSON/JSONP Data > HTML Scraping
http://nhlwc.cdnak.neulion.com/fs1/nhl/league/teamroster/ANA/iphone/clubroster.json
Change the team name (ex. ANA) to the wanted team; returns most current roster
http://nhlwc.cdnak.neulion.com/fs1/nhl/league/clubschedule/CGY/2014/02/iphone/clubschedule.json
Change CGY to the wanted team abbreviation, 2014 to the wanted year and 02 to the wanted month.
ex. http://nhlwc.cdnak.neulion.com/fs1/...ne/20132014/2/ANA/iphone/playerstatsline.json
From the Gamecenter App - Simple Structure, change the season and team as wanted
http://nhlwc.cdnak.neulion.com/fs1/...ne/20132014/3/PIT/iphone/playerstatsline.json
Simple Structure, change the season and team as wanted, the 3 stands for Playoffs
You can either loop through the club roster and "player stats line" URL's above or get it from TSN:
http://www.tsn.ca/mobile/bbcard.aspx?hub=NHL&name=Sidney+Crosby
XML Data!
Just change the player name as desired.
There are a couple of URL's for this data, the most common that NHL.com uses are:
Structure: "http://live.nhle.com/GameData/" + Year (ex 20132014) + "/" + Gameid (ex 2013020821) + "/gc/" + Data Wanted (gcsb, gcbx etc...) + ".jsonp"
http://live.nhle.com/GameData/20132014/2013020821/gc/gcsb.jsonp
- Updates way quicker than the data for the specified day (http://live.nhle.com/GameData/GCScor...13-01-31.jsonp) and contains Team ID's, Player's currently on the ice (gives their jersey numbers), Shots and goals for each team separated by the total or by period, current game time (in seconds in the sr listing), most recent event/play.
http://live.nhle.com/GameData/20132014/2013020758/gc/gcbx.jsonp
- Recommended for in depth recent in-game plays and player stats. Contains recent events (it does not contain all of the events!), goal summary (goal scorer, assists, time, id, teams involved, type of play (you can find the alphabetical equivalents that correspond to the numbers on a script the NHL has which will be discussed below), penalty summary, and the only way to obtain the game stats for each player in the game according to their jersey number (the NHL.com Player ID is not necessary).
- For each player it includes their Assists, Goals, PIM, Plus Minus, Shots, and Time On Ice for that game
PlayByPlay.jsonp is not used by the NHL.com at this current time but contains all of the plays of the game, and goal info; I don't know whether NHL.com will continue to update it in the future.
http://nhlwc.cdnak.neulion.com/fs1/nhl/league/leagueleaders/iphone/leagueleaders.json
http://nhlwc.cdnak.neulion.com/fs1/nhl/league/leagueleaders/iphone/points/leagueleaders.json
http://nhlwc.cdnak.neulion.com/fs1/nhl/league/leagueleaders/iphone/goals/leagueleaders.json
http://nhlwc.cdnak.neulion.com/fs1/nhl/league/leagueleaders/iphone/assists/leagueleaders.json
http://nhlwc.cdnak.neulion.com/fs1/nhl/league/leagueleaders/iphone/plusminus/leagueleaders.json
http://nhlwc.cdnak.neulion.com/fs1/nhl/league/leagueleaders/iphone/wins/leagueleaders.json
http://nhlwc.cdnak.neulion.com/fs1/nhl/league/leagueleaders/iphone/gaa/leagueleaders.json
http://nhlwc.cdnak.neulion.com/fs1/nhl/league/leagueleaders/iphone/savepercentage/leagueleaders.json
http://nhlwc.cdnak.neulion.com/fs1/nhl/league/leagueleaders/iphone/shutouts/leagueleaders.json
http://app.cgy.nhl.yinzcam.com/V2/Stats/Standings
XML Data!
NHL Game Center requires an "auth" code in order to obtain team standings, this URL is extracted from the same data and doesn't require authentication.
or TSN's Standings:
http://www.tsn.ca/datafiles/XML/NHL/standings.xml
Also XML
http://nhlwc.cdnak.neulion.com/fs1/nhl/league/news/NHL/iphone/1/news.json
You need the id of the player in order to access this which can be obtained from their team roster:
URL: http://3.cdn.nhle.com/photos/mugs/thumb/8476822.jpg
Self explanatory, just change the ending to the desired player id.
Default Image: http://3.cdn.nhle.com/photos/mugs/thumb/default.jpg
UPDATE: Thanks to aksun for the following info:
I found transparent high-quality player pictures from TSN site.
Example picture
API workaround:
So it's pretty easy to use it, just change the [name] to your player's name. There is a couple of things to keep in mind while using this system.
PHP for replacing work:
http://www.nhl.com/gamecenter/en/ajax/gamecalendarjson.htm?month=4&year=2011
http://live.nhle.com/GameData/GCScoreboard/2013-02-01.jsonp
This gives a good outlook on the games happening that day and also provides the Game ID's.
Thanks to meetc for the following info!
The returned JSON object can contain the following fields, some of them are not present prior to the start of the game.
For its web services, each game in the NHL is assigned a GameID which is needed in order to obtain/maintain data for that game. Here are a couple examples of GameIDs and their structure:
Thanks to meetc for the following info!
First 4 digits indicate the year which the season begins
Digits 5,6 indicate the part of the season. 01 is pre-season, 02 is regular season, 03 is playoffs, 09 was used for the Sochi Olympics for the Mens Hockey
Digits 7-10 are the game number for that part of the season. In pre-season and regular season, these are mostly sequential based on the date and time the game starts.
In the playoffs digit 7 is always 0, digit 8 is the round of games (eg 1 preliminary, 2 quarters, 3 conference, 4 finals), digit 9 is a team matchup for that round, and digit 10 is the game number in that series.
NOTE: For Neulion's Video Highlight service (which the NHL uses to manage NHL Game Center), you use the significant digits of the Game Code specified above. So if the game code is 0815, then in the video highlight URL, it will be 815.
This does not require the Game Center Live subscription!
NHL.com requires you to have NHL GameCenter Live in order to view highlights, but the video is just an MP4 so you can easily track it down.
UPDATE: 3/31/2014
Well, you can now find the highlight video URL really easily.
http://live.nhle.com/GameData/20132014/2013021122/gc/gcgm.jsonp
Replace 2013021122 with the specified game id and 20132014 with the year of that game.
This will return the highlight id's for each video, once you have the id, go to:
http://video.nhl.com/videocenter/servlets/playlist?ids=2013021122-60-h&format=json
Replace 2013021122-60-h with the your highlight id.
It will look something like this:
Which includes everything you'll need to obtain the video source and info!
Ex. Highlight Video URL: http://e1.cdnak.neulion.com/nhl/vod...js_cgy_1314_h_discrete_CGY475_goal_1_1600.mp4
The URL can be accessed without any credentials, let me explain the structure for the URL to view any highlight from a game.
Base URL: http://e1.cdnak.neulion.com/nhl/vod/
/2014/ - Year of the game
/01/ - Month of the game
/30/ - Day of the game
/815/ - Game code (last 3 digits of the gameid)
2_ - It is a static value, always 2
815_ - Game code (last 3 digits of the gameid)
sjs_ - Away team (San Jose Sharks)
cgy_ - Home team (Calgary Flames)
1314_ - Game season (2013 - 2014)
h_discrete_ - Static value
CGY - Home team (Calgary Flames)
475_ - Highlight ID (You can obtain this from PlayByPlay.jsonp, gcbx.jsonp, gcsb.jsonp etc...)
goal_ - Type of highlight (Goal, save, hit etc...)
1_ - I don't really know what this value stands for, it is either 1 or 2
1600 - Bitrate of the highlight (This is the only bitrate available)
http://mapi.sochi2014.com/v1/en/olympic/medal/rating
http://mapi.sochi2014.com/v1/en/olympic/results/IHSNR
http://mapi.sochi2014.com/v1/en/olympic/news?page=1&pagesize=24&sport=IH
http://mapi.sochi2014.com/v1/en/olympic/gamescalendar/?date=2014-02-06
Just change the date parameter YYYY/MM/DD
This data came from the network traffic of NHL.com on a PC, NHL Gamecenter App on an iPhone, and TSN's iPhone App. There is no HTML/Web scraping involved
To make the data more readable, please use www.jsonlint.com to parse it.
JSON/JSONP Data > HTML Scraping
All URLs are subject to change but based upon the previous URLs, the NHL will post the new URL when you call the old one
Team Roster:
http://nhlwc.cdnak.neulion.com/fs1/nhl/league/teamroster/ANA/iphone/clubroster.json
Change the team name (ex. ANA) to the wanted team; returns most current roster
Team Schedule Per Month
http://nhlwc.cdnak.neulion.com/fs1/nhl/league/clubschedule/CGY/2014/02/iphone/clubschedule.json
Change CGY to the wanted team abbreviation, 2014 to the wanted year and 02 to the wanted month.
Player Stats for the Entire Specified Team:
ex. http://nhlwc.cdnak.neulion.com/fs1/...ne/20132014/2/ANA/iphone/playerstatsline.json
From the Gamecenter App - Simple Structure, change the season and team as wanted
Playoff Player Stats for the Entire Specified Team:
http://nhlwc.cdnak.neulion.com/fs1/...ne/20132014/3/PIT/iphone/playerstatsline.json
Simple Structure, change the season and team as wanted, the 3 stands for Playoffs
Stats for an Individual Player:
You can either loop through the club roster and "player stats line" URL's above or get it from TSN:
http://www.tsn.ca/mobile/bbcard.aspx?hub=NHL&name=Sidney+Crosby
XML Data!
Just change the player name as desired.
Stats for Games:
There are a couple of URL's for this data, the most common that NHL.com uses are:
Structure: "http://live.nhle.com/GameData/" + Year (ex 20132014) + "/" + Gameid (ex 2013020821) + "/gc/" + Data Wanted (gcsb, gcbx etc...) + ".jsonp"
http://live.nhle.com/GameData/20132014/2013020821/gc/gcsb.jsonp
- Updates way quicker than the data for the specified day (http://live.nhle.com/GameData/GCScor...13-01-31.jsonp) and contains Team ID's, Player's currently on the ice (gives their jersey numbers), Shots and goals for each team separated by the total or by period, current game time (in seconds in the sr listing), most recent event/play.
http://live.nhle.com/GameData/20132014/2013020758/gc/gcbx.jsonp
- Recommended for in depth recent in-game plays and player stats. Contains recent events (it does not contain all of the events!), goal summary (goal scorer, assists, time, id, teams involved, type of play (you can find the alphabetical equivalents that correspond to the numbers on a script the NHL has which will be discussed below), penalty summary, and the only way to obtain the game stats for each player in the game according to their jersey number (the NHL.com Player ID is not necessary).
- For each player it includes their Assists, Goals, PIM, Plus Minus, Shots, and Time On Ice for that game
PlayByPlay.jsonp is not used by the NHL.com at this current time but contains all of the plays of the game, and goal info; I don't know whether NHL.com will continue to update it in the future.
"League Leaders" Overview Stats
http://nhlwc.cdnak.neulion.com/fs1/nhl/league/leagueleaders/iphone/leagueleaders.json
"League Leaders" In Points
http://nhlwc.cdnak.neulion.com/fs1/nhl/league/leagueleaders/iphone/points/leagueleaders.json
"League Leaders" In Goals
http://nhlwc.cdnak.neulion.com/fs1/nhl/league/leagueleaders/iphone/goals/leagueleaders.json
"League Leaders" In Assists
http://nhlwc.cdnak.neulion.com/fs1/nhl/league/leagueleaders/iphone/assists/leagueleaders.json
"League Leaders" In Plus/Minus
http://nhlwc.cdnak.neulion.com/fs1/nhl/league/leagueleaders/iphone/plusminus/leagueleaders.json
"League Leaders" In Wins
http://nhlwc.cdnak.neulion.com/fs1/nhl/league/leagueleaders/iphone/wins/leagueleaders.json
"League Leaders" In GAA
http://nhlwc.cdnak.neulion.com/fs1/nhl/league/leagueleaders/iphone/gaa/leagueleaders.json
"League Leaders" In Save Percentage
http://nhlwc.cdnak.neulion.com/fs1/nhl/league/leagueleaders/iphone/savepercentage/leagueleaders.json
"League Leaders" In Shutouts
http://nhlwc.cdnak.neulion.com/fs1/nhl/league/leagueleaders/iphone/shutouts/leagueleaders.json
Team Standings:
http://app.cgy.nhl.yinzcam.com/V2/Stats/Standings
XML Data!
NHL Game Center requires an "auth" code in order to obtain team standings, this URL is extracted from the same data and doesn't require authentication.
or TSN's Standings:
http://www.tsn.ca/datafiles/XML/NHL/standings.xml
Also XML
NHL News:
http://nhlwc.cdnak.neulion.com/fs1/nhl/league/news/NHL/iphone/1/news.json
Player Mug Pictures
You need the id of the player in order to access this which can be obtained from their team roster:
URL: http://3.cdn.nhle.com/photos/mugs/thumb/8476822.jpg
Self explanatory, just change the ending to the desired player id.
Default Image: http://3.cdn.nhle.com/photos/mugs/thumb/default.jpg
UPDATE: Thanks to aksun for the following info:
I found transparent high-quality player pictures from TSN site.
Example picture
API workaround:
Code:
GET http://tsnimages.tsn.ca/ImageProvider/PlayerHeadshot?seoId=[B][name][/B]
So it's pretty easy to use it, just change the [name] to your player's name. There is a couple of things to keep in mind while using this system.
- Latin alphabets only
- replace spaces with hyphens(-)
- replace aphostrophes(') and dots(.) with nothing
PHP for replacing work:
PHP:
$name = str_replace(array(" ", "'", "."), array("-", "", ""), $originalName);
NHL Game Calendar
http://www.nhl.com/gamecenter/en/ajax/gamecalendarjson.htm?month=4&year=2011
Games on the Specified Day
http://live.nhle.com/GameData/GCScoreboard/2013-02-01.jsonp
This gives a good outlook on the games happening that day and also provides the Game ID's.
Thanks to meetc for the following info!
The returned JSON object can contain the following fields, some of them are not present prior to the start of the game.
PHP:
field datatype descriptipon
ata char(3) Away team acronym, 3 letter short name
atc text Before: blank During: "progress" After: "winner" if away team wins
atcommon text away team common name
atn text away team city name
ats int away team score
atsog int Before: null During and After: away team shots on goal
bs time/text Before: start time (unsure if local or EST) During: 05:10 2nd, eg After: "FINAL", "FINAL OT" etc
bsc text Before: blank During: "progress" After: "final"
canationalbroadcasts text Canadian TV broadcasters, comma separated list
gcl Bool gamecenter live?
gcll bool gamecenter live?
gs int game status? 1=secheduled, 3= in progress, 5=finished
hta char(3) home team acronym
htc text Before: blank During: "progress" After: "winner" if home team wins
htcommon text home team common name
htn text home team city name
hts int home team score
htsog int Before: null During and After: home team shots on goal
id int game ID
rl Bool true after game completed
usnationalbroadcasts text US tv broadcasters, comma separated list
Game ID Explained:
For its web services, each game in the NHL is assigned a GameID which is needed in order to obtain/maintain data for that game. Here are a couple examples of GameIDs and their structure:
Thanks to meetc for the following info!
First 4 digits indicate the year which the season begins
Digits 5,6 indicate the part of the season. 01 is pre-season, 02 is regular season, 03 is playoffs, 09 was used for the Sochi Olympics for the Mens Hockey
Digits 7-10 are the game number for that part of the season. In pre-season and regular season, these are mostly sequential based on the date and time the game starts.
In the playoffs digit 7 is always 0, digit 8 is the round of games (eg 1 preliminary, 2 quarters, 3 conference, 4 finals), digit 9 is a team matchup for that round, and digit 10 is the game number in that series.
NOTE: For Neulion's Video Highlight service (which the NHL uses to manage NHL Game Center), you use the significant digits of the Game Code specified above. So if the game code is 0815, then in the video highlight URL, it will be 815.
Neulion Highlights
This does not require the Game Center Live subscription!
NHL.com requires you to have NHL GameCenter Live in order to view highlights, but the video is just an MP4 so you can easily track it down.
UPDATE: 3/31/2014
Well, you can now find the highlight video URL really easily.
http://live.nhle.com/GameData/20132014/2013021122/gc/gcgm.jsonp
Replace 2013021122 with the specified game id and 20132014 with the year of that game.
This will return the highlight id's for each video, once you have the id, go to:
http://video.nhl.com/videocenter/servlets/playlist?ids=2013021122-60-h&format=json
Replace 2013021122-60-h with the your highlight id.
It will look something like this:
[**
"id":"2013021122-60-h",
"name":"Corey Crawford Save on Beau Bennett (02:00/1st)",
"trackName":"Corey Crawford Save on Beau Bennett (02:00/1st)",
"description":"Home broadcast - Chicago Blackhawks at Pittsburgh Penguins - March 30, 2014",
"image":"www/thumbs/2014/03/30/591215_es.jpg",
"bigImage":"www/thumbs/2014/03/30/591215_eb.jpg",
"publishPoint":"http://e1.cdnak.neulion.com/nhl/vod/2014/03/30/1122/2_1122_chi_pit_1314_h_discrete_PIT60_save_1_1600.mp4?eid=590676&pid=591215&gid=3000&pt=1",
"formats":"0",
"shareable":true,
"releaseDate":"2014-03-30T19:30:00.000",
"runtime":"0:14","duration":"14"
}]
Which includes everything you'll need to obtain the video source and info!
Ex. Highlight Video URL: http://e1.cdnak.neulion.com/nhl/vod...js_cgy_1314_h_discrete_CGY475_goal_1_1600.mp4
The URL can be accessed without any credentials, let me explain the structure for the URL to view any highlight from a game.
Base URL: http://e1.cdnak.neulion.com/nhl/vod/
/2014/ - Year of the game
/01/ - Month of the game
/30/ - Day of the game
/815/ - Game code (last 3 digits of the gameid)
2_ - It is a static value, always 2
815_ - Game code (last 3 digits of the gameid)
sjs_ - Away team (San Jose Sharks)
cgy_ - Home team (Calgary Flames)
1314_ - Game season (2013 - 2014)
h_discrete_ - Static value
CGY - Home team (Calgary Flames)
475_ - Highlight ID (You can obtain this from PlayByPlay.jsonp, gcbx.jsonp, gcsb.jsonp etc...)
goal_ - Type of highlight (Goal, save, hit etc...)
1_ - I don't really know what this value stands for, it is either 1 or 2
1600 - Bitrate of the highlight (This is the only bitrate available)
Sochi 2014 Olympic Stats:
Medals for each country:
http://mapi.sochi2014.com/v1/en/olympic/medal/rating
Ice Hockey Schedule:
http://mapi.sochi2014.com/v1/en/olympic/results/IHSNR
Ice Hockey Olympic News:
http://mapi.sochi2014.com/v1/en/olympic/news?page=1&pagesize=24&sport=IH
Olympic Games Schedule for Specified Day:
http://mapi.sochi2014.com/v1/en/olympic/gamescalendar/?date=2014-02-06
Just change the date parameter YYYY/MM/DD
Last edited: