Head to head

GET https://hockey.highlightly.net/head-2-head Hockey API
GET https://sports.highlightly.net/hockey/head-2-head All Sports API

Retrieve the last ten games played between two teams.

Pagination
Not paginated

Both teamIdOne and teamIdTwo are required, and both come from teams. The order does not matter, so the same pair returns the same games either way round.

Each meeting comes back in the same shape as a match on matches, including the full state with the period by period score, so the record between the two sides can be rendered without a second request.

Pair this with last five games for the usual pre match comparison, one side showing form and the other showing history.

A head to head comparison between two teams

Parameters

Parameter Type Description
teamIdOnerequired number No description in the spec.e.g. 214385
teamIdTworequired number No description in the spec.e.g. 223746

Request

curl --request GET \
  --url 'https://hockey.highlightly.net/head-2-head?teamIdOne=214385&teamIdTwo=223746' \
  --header 'x-rapidapi-key: YOUR_API_KEY'
const params = new URLSearchParams({
  teamIdOne: '214385',
  teamIdTwo: '223746'
})
const response = await fetch(`https://hockey.highlightly.net/head-2-head?${params}`, {
  headers: {
    'x-rapidapi-key': process.env.HIGHLIGHTLY_API_KEY
  }
})

if (!response.ok) {
  throw new Error(`Highlightly responded ${response.status}`)
}

const data = await response.json()
import os
import requests

response = requests.get(
    'https://hockey.highlightly.net/head-2-head',
    params={
        'teamIdOne': '214385',
        'teamIdTwo': '223746',
    },
    headers={
        'x-rapidapi-key': os.environ['HIGHLIGHTLY_API_KEY'],
    },
    timeout=10,
)

response.raise_for_status()
data = response.json()

Response

idnumberrequired
weekstring
datestringrequired
countryHockeyCountryResponserequired3 fields
codestringrequiredCountry code specified by the ISO 3166 standard.
namestringrequired
logostringrequired
awayTeamHockeyTeamResponserequired3 fields
idnumberrequired
logostring
namestringrequired
homeTeamHockeyTeamResponserequired3 fields
idnumberrequired
logostring
namestringrequired
leagueHockeyMatchLeagueResponserequired4 fields
idnumberrequired
seasonnumberrequired
namestringrequired
logostring
stateHockeyMatchStateResponserequired8 fields
descriptionstringrequiredCurrent state of the game.Not started1st period2nd period3rd periodOver timePenaltiesBreak timeAwardedPostponedCancelledInterruptedAbandonedFinishedTo be announcedFinished after penaltiesFinished after over timeUnknown
scoreHockeyMatchScoreResponserequired6 fields
currentstringHome - Away score for the match.
overTimestringHome - Away score in overtime.
penaltiesstringHome - Away score in penalties.
firstPeriodstringHome - Away score in 1st period.
secondPeriodstringHome - Away score in 2nd period.
thirdPeriodstringHome - Away score in 3rd period.

Example response

200 application/json
[
  {
    "id": 291869956,
    "week": "1",
    "date": "2023-10-13T17:30:00.000Z",
    "country": {
      "code": "DE",
      "name": "Germany",
      "logo": "https://example.com/logos/country/DE.png"
    },
    "awayTeam": {
      "id": 223746,
      "logo": "https://example.com/logos/team/223746.png",
      "name": "Frankfurt Lowen"
    },
    "homeTeam": {
      "id": 223746,
      "logo": "https://example.com/logos/team/223746.png",
      "name": "Frankfurt Lowen"
    },
    "league": {
      "id": 16953,
      "season": 2023,
      "name": "DEL",
      "logo": "https://example.com/logos/league/16953.png"
    },
    "state": {
      "description": "1st period",
      "score": {
        "current": "4 - 4",
        "overTime": "6 - 4",
        "penalties": "17 - 33",
        "firstPeriod": "2 - 0",
        "secondPeriod": "2 - 1",
        "thirdPeriod": "5 - 2"
      }
    }
  }
]

Values are the examples declared in the OpenAPI spec, not a captured live response.

Errors

Status Description
400 Bad request descriptive error.
500 Internal server error.