Head to head
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 results, which is the usual companion to a game preview. For each team's recent form independent of the opponent, use last five games.
Parameters
| Parameter | Type | Description |
|---|---|---|
teamIdOnerequired
|
number |
No description in the spec.e.g. 92730
|
teamIdTworequired
|
number |
No description in the spec.e.g. 92731
|
Request
curl --request GET \
--url 'https://american-football.highlightly.net/head-2-head?teamIdOne=92730&teamIdTwo=92731' \
--header 'x-rapidapi-key: YOUR_API_KEY'
const params = new URLSearchParams({
teamIdOne: '92730',
teamIdTwo: '92731'
})
const response = await fetch(`https://american-football.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://american-football.highlightly.net/head-2-head',
params={
'teamIdOne': '92730',
'teamIdTwo': '92731',
},
headers={
'x-rapidapi-key': os.environ['HIGHLIGHTLY_API_KEY'],
},
timeout=10,
)
response.raise_for_status()
data = response.json()
Response
idnumberrequired
roundstringrequired
datestringrequired
leaguestringrequired
seasonnumberrequired
awayTeamAmericanFootballMatchTeamResponserequired5 fields
idnumberrequired
logostring
namestring
displayNamestringrequired
abbreviationstringrequired
homeTeamAmericanFootballMatchTeamResponserequired5 fields
idnumberrequired
logostring
namestring
displayNamestringrequired
abbreviationstringrequired
stateAmericanFootballMatchStateResponserequired12 fields
periodnumberCurrent in play period.
clocknumberCurrent minute of the in play period.
descriptionstringrequiredCurrent status/description of the match.SuspendedPostponedCancelledAbandonedFinishedIn progressEnd periodHalf timeUnknownScheduled
scoreAmericanFootballMatchScoreResponserequired7 fields
currentstringHome - Away score for the match.
firstPeriodstringHome - Away score in 1st period.
secondPeriodstringHome - Away score in 2nd period.
thirdPeriodstringHome - Away score in 3rd period.
fourthPeriodstringHome - Away score in 4th period.
firstOvertimePeriodstringHome - Away score in the first overtime period.
secondOvertimePeriodstringHome - Away score in the second overtime period.
reportstringAdditional description of the match state.
Example response
[
{
"id": 1,
"round": "Regular Season - 32",
"date": "2023-05-20T15:30:00.000Z",
"league": "NFL",
"season": 2023,
"awayTeam": {
"id": 1,
"logo": "https://example.com/logos/team/111.png",
"name": "Saints",
"displayName": "New Orleans Saints",
"abbreviation": "NO"
},
"homeTeam": {
"id": 1,
"logo": "https://example.com/logos/team/111.png",
"name": "Saints",
"displayName": "New Orleans Saints",
"abbreviation": "NO"
},
"state": {
"period": 2,
"clock": 8,
"description": "In progress",
"score": {
"current": "21 - 7",
"firstPeriod": "0 - 0",
"secondPeriod": "7 - 7",
"thirdPeriod": "7 - 0",
"fourthPeriod": "7 - 0",
"firstOvertimePeriod": "7 - 0",
"secondOvertimePeriod": "7 - 0"
},
"report": "Final"
}
}
]
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. |