Get games
curl --request GET \
--url https://api.4casters.io/exchange/v2/getGames \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.4casters.io/exchange/v2/getGames"
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/v2/getGames', 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/v2/getGames",
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/v2/getGames"
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/v2/getGames")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.4casters.io/exchange/v2/getGames")
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": {
"games": [
{
"id": "<string>",
"parentGameID": "<string>",
"cheapDataUID": "<string>",
"league": "<string>",
"sport": "<string>",
"start": "2023-11-07T05:31:56Z",
"ended": true,
"live": true,
"featured": true,
"eventName": "<string>",
"tournamentName": "<string>",
"periodName": "<string>",
"isSpecials": true,
"participants": [
{
"id": "<string>",
"longName": "<string>",
"shortName": "<string>",
"mainPitcher": "<string>",
"rotationNumber": "<string>",
"futuresSide": "<string>",
"score": 123
}
]
}
]
}
}Markets
Get games
List active games for a league
GET
/
exchange
/
v2
/
getGames
Get games
curl --request GET \
--url https://api.4casters.io/exchange/v2/getGames \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.4casters.io/exchange/v2/getGames"
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/v2/getGames', 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/v2/getGames",
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/v2/getGames"
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/v2/getGames")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.4casters.io/exchange/v2/getGames")
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": {
"games": [
{
"id": "<string>",
"parentGameID": "<string>",
"cheapDataUID": "<string>",
"league": "<string>",
"sport": "<string>",
"start": "2023-11-07T05:31:56Z",
"ended": true,
"live": true,
"featured": true,
"eventName": "<string>",
"tournamentName": "<string>",
"periodName": "<string>",
"isSpecials": true,
"participants": [
{
"id": "<string>",
"longName": "<string>",
"shortName": "<string>",
"mainPitcher": "<string>",
"rotationNumber": "<string>",
"futuresSide": "<string>",
"score": 123
}
]
}
]
}
}Returns all active games for a league. The response does not include the orderbook or any prices — call Get orderbook for that.
Request
GET /exchange/v2/getGames
string
required
League code from Get leagues. Use the special value
upcoming to get all upcoming games across leagues.string
Optional sport filter.
curl "https://api.4casters.io/exchange/v2/getGames?league=NBA" \
-H "Authorization: Bearer YOUR_TOKEN"
Response
array
Show Game
Show Game
string
Game id.
string
Parent game id, if this is a child market (props, alternate periods).
string
Stable cross-system identifier for the game (used for line correlation).
string
string
string
ISO 8601 start time.
boolean
boolean
boolean
string
string
string
e.g.
Full Time, 1H, Set 1.boolean
true for futures and other specials markets.array
Two-element
[away, home] array. Each participant has id, longName, shortName, homeAway, mainPitcher, rotationNumber, futuresSide.Example
{
"data": {
"games": [
{
"id": "6266c12172aefcf0033374ce",
"parentGameID": null,
"cheapDataUID": "32620-79238-2022-04-26",
"league": "NHL",
"sport": "hockey",
"start": "2022-04-26T18:00:00.000Z",
"ended": false,
"live": false,
"featured": false,
"participants": [
{ "id": "60747bc471b5071a80ca0ac8", "longName": "Carolina Hurricanes", "shortName": "CAR", "homeAway": "away", "mainPitcher": null, "rotationNumber": "25", "futuresSide": "" },
{ "id": "607349daf6d3364eb69604f6", "longName": "New York Rangers", "shortName": "NEW", "homeAway": "home", "mainPitcher": null, "rotationNumber": "26", "futuresSide": "" }
]
}
]
}
}
Errors
| Status | Meaning |
|---|---|
400 | league is required. |
Authorizations
Pass your auth token in the Authorization header. The Bearer prefix is optional; the server also accepts a signed auth cookie or a token field in the request body.
Query Parameters
League code from GET /exchange/getLeagues. Use upcoming for all upcoming games across leagues.
Optional sport filter.
Response
Games list
Show child attributes
Show child attributes
Was this page helpful?
⌘I