Head to head
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, with the full
state and the quarter by quarter 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.
Parameters
| Parameter | Type | Description |
|---|---|---|
teamIdOnerequired
|
number |
No description in the spec.e.g. 1635
|
teamIdTworequired
|
number |
No description in the spec.e.g. 7592
|
Request
curl --request GET \
--url 'https://basketball.highlightly.net/head-2-head?teamIdOne=1635&teamIdTwo=7592' \
--header 'x-rapidapi-key: YOUR_API_KEY'
const params = new URLSearchParams({
teamIdOne: '1635',
teamIdTwo: '7592'
})
const response = await fetch(`https://basketball.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://basketball.highlightly.net/head-2-head',
params={
'teamIdOne': '1635',
'teamIdTwo': '7592',
},
headers={
'x-rapidapi-key': os.environ['HIGHLIGHTLY_API_KEY'],
},
timeout=10,
)
response.raise_for_status()
data = response.json()
Response
idnumberrequired
weekstring
stagestringrequired
datestringrequired
countryBasketballCountryResponserequired3 fields
codestringrequiredCountry code specified by the ISO 3166 standard.
namestringrequired
logostringrequired
awayTeamBasketballTeamResponserequired3 fields
idnumberrequired
logostring
namestringrequired
homeTeamBasketballTeamResponserequired3 fields
idnumberrequired
logostring
namestringrequired
leagueBasketballMatchLeagueResponserequired4 fields
idnumberrequired
seasonnumberrequired
namestringrequired
logostring
stateBasketballMatchStateResponserequired9 fields
descriptionstringrequiredState of the match.Not startedFirst quarterSecond quarterThird quarterFourth quarterOver timeBreak timeHalf timeFinishedFinished after over timePostponedCancelledSuspendedAwardedAbandonedUnknownTo be announced
clocknumberCurrent minute of the current period.
scoreBasketballMatchScoreResponserequired6 fields
currentstringHome - Away score for the match. Includes overtime as well.
q1stringHome - Away score in 1st quarter.
q2stringHome - Away score in 2nd quarter.
q3stringHome - Away score in 3rd quarter.
q4stringHome - Away score in 4th quarter.
overTimestringHome - Away score in overtime.
Example response
[
{
"id": 489389,
"week": "1",
"stage": "Final",
"date": "2023-10-01T03:00:00.000Z",
"country": {
"code": "AU",
"name": "Australia",
"logo": "https://example.com/logos/country/AU.png"
},
"awayTeam": {
"id": 7592,
"logo": "https://example.com/logos/team/7592.png",
"name": "Adelaide"
},
"homeTeam": {
"id": 7592,
"logo": "https://example.com/logos/team/7592.png",
"name": "Adelaide"
},
"league": {
"id": 1635,
"season": 2023,
"name": "NBL",
"logo": "https://example.com/logos/league/1635.png"
},
"state": {
"description": "Finished",
"clock": 9,
"score": {
"current": "105 - 104",
"q1": "22 - 15",
"q2": "17 - 33",
"q3": "11 - 27",
"q4": "33 - 14",
"overTime": "22 - 15"
}
}
}
]
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. |