Head to head
Retrieve the games played between two teams.
- Pagination
- Not paginated
Both teamIdOne and teamIdTwo are required, and both come from
teams.
Each meeting comes back in the same shape as a match on
matches, with the state and
its score, so the record between the two sides can be rendered without a
second request.
Every meeting also names its league, including the season,
which matters where two sides meet in more than one competition. A club can face the
same opponent in a domestic league and a continental cup in the same year, and reading
the league is what separates the two runs of results.
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. 385436
|
teamIdTworequired
|
number |
No description in the spec.e.g. 384585
|
Request
curl --request GET \
--url 'https://rugby.highlightly.net/head-2-head?teamIdOne=385436&teamIdTwo=384585' \
--header 'x-rapidapi-key: YOUR_API_KEY'
const params = new URLSearchParams({
teamIdOne: '385436',
teamIdTwo: '384585'
})
const response = await fetch(`https://rugby.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://rugby.highlightly.net/head-2-head',
params={
'teamIdOne': '385436',
'teamIdTwo': '384585',
},
headers={
'x-rapidapi-key': os.environ['HIGHLIGHTLY_API_KEY'],
},
timeout=10,
)
response.raise_for_status()
data = response.json()
Response
idnumberrequired
weekstring
datestringrequired
countryRugbyCountryResponserequired3 fields
codestringrequiredCountry code specified by the ISO 3166 standard.
namestringrequired
logostringrequired
awayTeamRugbyTeamResponserequired3 fields
idnumberrequired
logostring
namestringrequired
homeTeamRugbyTeamResponserequired3 fields
idnumberrequired
logostring
namestringrequired
leagueRugbyMatchLeagueResponserequired4 fields
idnumberrequired
seasonnumberrequired
namestringrequired
logostring
stateRugbyMatchStateResponserequired2 fields
descriptionstringrequiredState of the match.Not startedFirst halfHalf timeSecond halfExtra timeBreak timePenaltiesSuspendedInterruptedFinishedFinished after extra timePostponedCancelledAbandonedAwardedUnknownTo be announced
scorestringHome - Away match score.
Example response
[
{
"id": 36224450,
"week": "4",
"date": "2024-03-08T19:15:00.000Z",
"country": {
"code": "EU",
"name": "Europe",
"logo": "https://example.com/logos/country/EU.png"
},
"awayTeam": {
"id": 384585,
"logo": "https://example.com/logos/team/90990.png",
"name": "Italy U20"
},
"homeTeam": {
"id": 384585,
"logo": "https://example.com/logos/team/90990.png",
"name": "Italy U20"
},
"league": {
"id": 48440,
"season": 2024,
"name": "Six Nations U20",
"logo": "https://example.com/logos/league/48440.png"
},
"state": {
"description": "Finished",
"score": "47 - 14"
}
}
]
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. |