Head to head

GET https://soccer.highlightly.net/head-2-head Football API
GET https://sports.highlightly.net/football/head-2-head All Sports API

Retrieve the last ten head to head games between two teams.

Pagination
Not paginated

Specify teamIdOne and teamIdTwo, both from teams. The order does not matter, so you do not need to work out which side is at home before calling.

Use it to compare two teams on their past match results. For each team's recent form independent of the opponent, use last five games.

A head to head comparison between two teams

Parameters

Parameter Type Description
teamIdOnerequired number No description in the spec.e.g. 314803
teamIdTworequired number No description in the spec.e.g. 5700782

Request

curl --request GET \
  --url 'https://soccer.highlightly.net/head-2-head?teamIdOne=314803&teamIdTwo=5700782' \
  --header 'x-rapidapi-key: YOUR_API_KEY'
const params = new URLSearchParams({
  teamIdOne: '314803',
  teamIdTwo: '5700782'
})
const response = await fetch(`https://soccer.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://soccer.highlightly.net/head-2-head',
    params={
        'teamIdOne': '314803',
        'teamIdTwo': '5700782',
    },
    headers={
        'x-rapidapi-key': os.environ['HIGHLIGHTLY_API_KEY'],
    },
    timeout=10,
)

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

Response

idnumberrequired
roundstringrequired
datestringrequired
countryCountryResponserequired3 fields
codestringrequiredCountry code specified by the ISO 3166 standard.
namestringrequired
logostringrequired
awayTeamTeamResponserequired4 fields
idnumberrequired
logostring
namestringrequired
typestringclubnational
homeTeamTeamResponserequired4 fields
idnumberrequired
logostring
namestringrequired
typestringclubnational
leagueMatchLeagueResponserequired4 fields
idnumberrequired
seasonnumberrequired
namestringrequired
logostring
stateMatchStateResponserequired5 fields
descriptionstringrequiredState of the match.To be announcedNot startedFirst halfHalf timeSecond halfExtra timeBreak timePenaltiesSuspendedInterruptedFinishedFinished after penaltiesFinished after extra timePostponedCancelledAbandonedAwardedIn progressUnknown
clocknumberCurrent minute of the match.
scoreMatchScoreResponserequired2 fields
currentstringHome - Away score up to penalties.
penaltiesstringHome - Away team score after the penalties phase.

Example response

200 application/json
[
  {
    "id": 489389,
    "round": "Regular Season - 32",
    "date": "2023-05-20T15:30:00.000Z",
    "country": {
      "code": "FR",
      "name": "France",
      "logo": "https://example.com/logos/country/FR.png"
    },
    "awayTeam": {
      "id": 553,
      "logo": "https://example.com/logos/team/553.png",
      "name": "Montpellier",
      "type": "club"
    },
    "homeTeam": {
      "id": 553,
      "logo": "https://example.com/logos/team/553.png",
      "name": "Montpellier",
      "type": "club"
    },
    "league": {
      "id": 133,
      "season": 2023,
      "name": "Ligue 1",
      "logo": "https://example.com/logos/league/133.png"
    },
    "state": {
      "description": "Second half",
      "clock": 67,
      "score": {
        "current": "3 - 1",
        "penalties": "6 - 4"
      }
    }
  }
]

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.