Zmalski / NHL-API-Reference

Unofficial reference for the NHL API endpoints.
MIT License
262 stars 20 forks source link

Highlight/Recap ID mappings #11

Closed minter closed 9 months ago

minter commented 9 months ago

Within the game landing page, there are numeric IDs for things like goal highlights, game recaps, and condensed games. Do you know how to turn those into URLs to view the actual content?

        "goals": [
          {
            "situationCode": "1551",
            "strength": "ev",
            "playerId": 8477960,
            "firstName": {
              "default": "Adrian"
            },
            "lastName": {
              "default": "Kempe"
            },
            "name": {
              "default": "A. Kempe"
            },
            "teamAbbrev": {
              "default": "LAK"
            },
            "headshot": "https://assets.nhle.com/mugs/nhl/20232024/LAK/8477960.png",
            "highlightClip": 6345776353112,
            "highlightClipFr": 6345777136112,
    "gameVideo": {
      "threeMinRecap": 6345743026112,
      "condensedGame": 6345743402112
    }
Zmalski commented 9 months ago

I was able to find (what I believe to be) the actual URL structure for what the condensed games looks like. Here's an example:

https://www.nhl.com/video/condensed-game-kings-at-blues-1-28-24-6345782742112

Looks like it has to include the teams, date and then the ID that's present in that JSON sample.

Wasn't able to see anything obvious for the other categories, but they might be similar. Hope that helps for now.

Zmalski commented 9 months ago

Actually, it looks like highlights are similar, but it might be tough to determine what the URLs are programmatically:

https://www.nhl.com/video/topic/highlights/lak-stl-danault-scores-goal-against-joel-hofer-6345781435112

Notice the ID at the end of that URL.

minter commented 9 months ago

Rats - I was hoping there was a URL link somewhere in the API. I appreciate you checking!