Get leagues
curl --request GET \
--url https://api.4casters.io/exchange/getLeagues \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.4casters.io/exchange/getLeagues"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.4casters.io/exchange/getLeagues', 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.4casters.io/exchange/getLeagues",
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.4casters.io/exchange/getLeagues"
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.4casters.io/exchange/getLeagues")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.4casters.io/exchange/getLeagues")
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": {
"availableLeagues": [
"NBA",
"NHL",
"PREMIER-LEAGUE",
"PGA"
]
}
}Mercados
Obter ligas
Lista ligas com mercados ativos
GET
/
exchange
/
getLeagues
Get leagues
curl --request GET \
--url https://api.4casters.io/exchange/getLeagues \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.4casters.io/exchange/getLeagues"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.4casters.io/exchange/getLeagues', 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.4casters.io/exchange/getLeagues",
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.4casters.io/exchange/getLeagues"
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.4casters.io/exchange/getLeagues")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.4casters.io/exchange/getLeagues")
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": {
"availableLeagues": [
"NBA",
"NHL",
"PREMIER-LEAGUE",
"PGA"
]
}
}Retorna cada liga com mercados ativos na exchange. Use os códigos de liga deste endpoint para obter eventos (
/exchange/v2/getGames) e livros de ordens (/exchange/v2/getOrderbook).
Se a resposta contiver um nome de liga com LIVE (além das ligas ao vivo por esporte NFL-LIVE, NBA-LIVE, NCAAF-LIVE, NCAAB-LIVE), o valor "LIVE" é adicionado como alias de “todos os eventos em andamento”.
Requisição
GET /exchange/getLeagues
Filtro opcional de esporte (
basketball, baseball, hockey, football, soccer, golf, tennis, mma, etc.). Quando sport=soccer ou sport=golf, o valor "all" é adicionado à lista.curl https://api.4casters.io/exchange/getLeagues \
-H "Authorization: Bearer YOUR_TOKEN"
Resposta
Exemplo
{
"data": {
"availableLeagues": [
"CHAMPIONS-LEAGUE",
"NBA",
"NHL",
"BUNDESLIGA",
"PREMIER-LEAGUE",
"PGA",
"LA-LIGA",
"NON-UFC",
"SERIE-A",
"MLS",
"UFCMMA"
]
}
}
Autorizações
Parâmetros de consulta
Esta página foi útil?