curl --request GET \
--url https://api.sportquanta.com/v1/{league}/head-to-head \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sportquanta.com/v1/{league}/head-to-head"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sportquanta.com/v1/{league}/head-to-head', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sportquanta.com/v1/{league}/head-to-head",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sportquanta.com/v1/{league}/head-to-head"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sportquanta.com/v1/{league}/head-to-head")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sportquanta.com/v1/{league}/head-to-head")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"competitionId": "<string>",
"teamA": {
"teamId": "<string>",
"name": "<string>",
"shortName": "<string>",
"abbreviation": "<string>"
},
"teamB": {
"teamId": "<string>",
"name": "<string>",
"shortName": "<string>",
"abbreviation": "<string>"
},
"found": true,
"asOf": "<string>",
"record": {
"record": {
"wins": 123,
"draws": 123,
"losses": 123
},
"streak": {
"type": "<string>",
"length": 123
}
},
"matches": [
{
"matchId": "<string>",
"kickoffDate": "<string>",
"competitionId": "<string>",
"stage": "<string>",
"season": "<string>",
"isHome": true,
"goalsFor": 123,
"goalsAgainst": 123,
"totalGoals": 123,
"margin": 123,
"result": "<string>",
"btts": true,
"cleanSheet": true,
"failedToScore": true,
"opponent": {
"teamId": "<string>",
"name": "<string>",
"shortName": "<string>",
"abbreviation": "<string>"
}
}
],
"context": {
"asOf": "<string>",
"sampleSize": 123,
"staleness": "<string>",
"scopeApplied": "<string>"
}
},
"_meta": {
"request_id": "<string>",
"served_from": "live",
"cache_ttl_seconds": 123,
"provenance": {},
"availability": {}
}
}Head-to-head
Soccer-only. The completed meetings between teamA and teamB
in the resolved competition, projected from teamA’s side, with
teamA’s W-D-L record and current streak. Unknown team ids are
not an error: the response carries found: false and refs with
null names.
Season-blind. A league with no loaded competition answers 200
with { "available": false, ... }. Returns 404
endpoint_not_for_sport for baseball / basketball leagues; note
/v1/kbl/head-to-head is a separate static basketball route.
Requires the stats entitlement (a paid plan). See Responses & Errors for the success envelope and availability rules.
curl --request GET \
--url https://api.sportquanta.com/v1/{league}/head-to-head \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sportquanta.com/v1/{league}/head-to-head"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sportquanta.com/v1/{league}/head-to-head', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sportquanta.com/v1/{league}/head-to-head",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sportquanta.com/v1/{league}/head-to-head"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sportquanta.com/v1/{league}/head-to-head")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sportquanta.com/v1/{league}/head-to-head")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"competitionId": "<string>",
"teamA": {
"teamId": "<string>",
"name": "<string>",
"shortName": "<string>",
"abbreviation": "<string>"
},
"teamB": {
"teamId": "<string>",
"name": "<string>",
"shortName": "<string>",
"abbreviation": "<string>"
},
"found": true,
"asOf": "<string>",
"record": {
"record": {
"wins": 123,
"draws": 123,
"losses": 123
},
"streak": {
"type": "<string>",
"length": 123
}
},
"matches": [
{
"matchId": "<string>",
"kickoffDate": "<string>",
"competitionId": "<string>",
"stage": "<string>",
"season": "<string>",
"isHome": true,
"goalsFor": 123,
"goalsAgainst": 123,
"totalGoals": 123,
"margin": 123,
"result": "<string>",
"btts": true,
"cleanSheet": true,
"failedToScore": true,
"opponent": {
"teamId": "<string>",
"name": "<string>",
"shortName": "<string>",
"abbreviation": "<string>"
}
}
],
"context": {
"asOf": "<string>",
"sampleSize": 123,
"staleness": "<string>",
"scopeApplied": "<string>"
}
},
"_meta": {
"request_id": "<string>",
"served_from": "live",
"cache_ttl_seconds": 123,
"provenance": {},
"availability": {}
}
}Authorizations
Send a workspace API token in the Authorization: Bearer <token> header.
Path Parameters
Soccer league ID, such as epl, laliga, or worldcup. See Soccer coverage.
epl, laliga, bundesliga, seriea, ligue1, eredivisie, ligaportugal, championship, superettan, laliga2, bundesliga2, serieb, ligue2, eerstedivisie, ligaportugal2, ucl, uel, uecl, facup, copadelrey, dfbpokal, coppaitalia, coupedefrance, knvbbeker, tacaportugal, koreanfacup, usopencup, kleague1, kleague2, jleague1, jleague2, mls, uslchampionship, worldcup, euro, copaamerica, goldcup, asiancup, emperorscup Query Parameters
1 <= x <= 60Response
Head-to-head record, meetings and context, or the honest-empty availability envelope.
- Option 1
- Option 2
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Data as-of timestamp, nullable when unavailable.
Number of contributing matches.
Freshness classification for the contributing sample.
Competition/stage scope applied to the result.
Hide child attributes
Hide child attributes
live, cache Response cache TTL; independent of source freshness. Omitted when zero.
Endpoint-specific availability context, including soccer roster coverage.