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 match 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. 17838627
|
teamIdTworequired
|
number |
No description in the spec.e.g. 17838662
|
Request
curl --request GET \
--url 'https://cricket.highlightly.net/head-2-head?teamIdOne=17838627&teamIdTwo=17838662' \
--header 'x-rapidapi-key: YOUR_API_KEY'
const params = new URLSearchParams({
teamIdOne: '17838627',
teamIdTwo: '17838662'
})
const response = await fetch(`https://cricket.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://cricket.highlightly.net/head-2-head',
params={
'teamIdOne': '17838627',
'teamIdTwo': '17838662',
},
headers={
'x-rapidapi-key': os.environ['HIGHLIGHTLY_API_KEY'],
},
timeout=10,
)
response.raise_for_status()
data = response.json()
Response
idstringrequired
endDatestringrequired
startDatestringrequired
startTimestring
countryCricketCountryResponserequired3 fields
codestringrequiredCountry code specified by the ISO 3166 standard.
namestringrequired
logostringrequired
awayTeamCricketTeamResponserequired4 fields
idstringrequired
logostring
namestringrequired
abbreviationstringrequired
homeTeamCricketTeamResponserequired4 fields
idstringrequired
logostring
namestringrequired
abbreviationstringrequired
leagueCricketMatchLeagueResponserequired4 fields
idstringrequired
seasonnumberrequired
namestringrequired
logostring
formatstringCricket match format, e.g. T20, ODI, TEST
dayTypestringInformation that tells us whether the match will be played across multiple
daysSINGLEMULTI
stateCricketMatchStateResponserequired9 fields
descriptionstringrequiredState of the match.FinishedUnknownNo live coverageIn playStumpsLunchInnings breakDrinksTimeoutTeaScheduledMatch delayedCancelledAbandonedPostponed
reportstringDescriptive report of the match based on the match status.
teamsCricketMatchScoreTeamsrequired6 fields
awayCricketMatchScoreTeamAwayrequired2 fields
infostring
scorestring
homeCricketMatchScoreTeamHomerequired2 fields
infostring
scorestring
Example response
[
{
"id": "48514657",
"endDate": "2024-01-13T00:00:00.000Z",
"startDate": "2024-01-13T00:00:00.000Z",
"startTime": "2024-01-13T14:30:00.000Z",
"country": {
"code": "AU",
"name": "Australia",
"logo": "https://example.com/logos/country/AU.png"
},
"awayTeam": {
"id": "17838627",
"logo": "https://example.com/logos/team/17838627.png",
"name": "Melbourne Stars",
"abbreviation": "MS"
},
"homeTeam": {
"id": "17838627",
"logo": "https://example.com/logos/team/17838627.png",
"name": "Melbourne Stars",
"abbreviation": "MS"
},
"league": {
"id": "48513362",
"season": 2023,
"name": "Big Bash League",
"logo": "https://example.com/logos/league/48513362.png"
},
"format": "T20",
"dayType": "SINGLE",
"state": {
"description": "Finished",
"report": "Renegades won by 6 wickets (with 16 balls remaining)",
"teams": {
"away": {
"info": "17.2/20 ov, T:138",
"score": "139/4"
},
"home": {
"info": null,
"score": "137/8"
}
}
}
}
]
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. |