List Game Segments
curl --request GET \
--url https://api.uplift.ai/v1/games/{game_id}/segments \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.uplift.ai/v1/games/{game_id}/segments"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.uplift.ai/v1/games/{game_id}/segments', 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.uplift.ai/v1/games/{game_id}/segments",
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.uplift.ai/v1/games/{game_id}/segments"
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.uplift.ai/v1/games/{game_id}/segments")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.uplift.ai/v1/games/{game_id}/segments")
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{
"game_id": "6b1e0c2a-7d8f-4a51-9b0e-2f3c1d4e5a6b",
"run_id": "f2a91c3e-0b47-4d6a-8e15-7c9d2b3a4e5f",
"segment_count": 412,
"segments": [
{
"segment_id": "ph-0417",
"segment_type": "phase_of_play",
"segment_subtype": null,
"team_id": "t-0451",
"team_side": "home",
"player_id": null,
"period": 1,
"time_start_s": 58.2,
"time_end_s": 66.9,
"frame_start": 1746,
"frame_end": 2007,
"confidence": 0.74,
"confidence_tier": "medium",
"layer": "ball",
"attributes": {
"team_in_possession_phase_type": "create",
"team_out_of_possession_phase_type": "medium_block",
"previous_phase": "build_up",
"ended_with": "phase_change",
"team_possession_lead_to_shot": true,
"team_possession_lead_to_goal": false
}
}
]
}{
"error": "BadRequest",
"message": "The request parameters are invalid. Please review the request and try again."
}{
"error": "Unauthorized",
"message": "Bearer token is missing or invalid."
}{
"error": "Forbidden",
"message": "You do not have permission to access this resource."
}{
"error": "NotFound",
"message": "The specified game_id was not found."
}{
"error": "TooManyRequests",
"message": "The rate limit has been exceeded. Please wait and try again later."
}{
"error": "InternalServerError",
"message": "An unexpected error occurred on the server. Please try again later."
}Match Data
List Game Segments
Returns every phase of play, team possession, player possession, key moment, overload and dead ball in the game in one response.
GET
/
games
/
{game_id}
/
segments
List Game Segments
curl --request GET \
--url https://api.uplift.ai/v1/games/{game_id}/segments \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.uplift.ai/v1/games/{game_id}/segments"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.uplift.ai/v1/games/{game_id}/segments', 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.uplift.ai/v1/games/{game_id}/segments",
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.uplift.ai/v1/games/{game_id}/segments"
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.uplift.ai/v1/games/{game_id}/segments")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.uplift.ai/v1/games/{game_id}/segments")
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{
"game_id": "6b1e0c2a-7d8f-4a51-9b0e-2f3c1d4e5a6b",
"run_id": "f2a91c3e-0b47-4d6a-8e15-7c9d2b3a4e5f",
"segment_count": 412,
"segments": [
{
"segment_id": "ph-0417",
"segment_type": "phase_of_play",
"segment_subtype": null,
"team_id": "t-0451",
"team_side": "home",
"player_id": null,
"period": 1,
"time_start_s": 58.2,
"time_end_s": 66.9,
"frame_start": 1746,
"frame_end": 2007,
"confidence": 0.74,
"confidence_tier": "medium",
"layer": "ball",
"attributes": {
"team_in_possession_phase_type": "create",
"team_out_of_possession_phase_type": "medium_block",
"previous_phase": "build_up",
"ended_with": "phase_change",
"team_possession_lead_to_shot": true,
"team_possession_lead_to_goal": false
}
}
]
}{
"error": "BadRequest",
"message": "The request parameters are invalid. Please review the request and try again."
}{
"error": "Unauthorized",
"message": "Bearer token is missing or invalid."
}{
"error": "Forbidden",
"message": "You do not have permission to access this resource."
}{
"error": "NotFound",
"message": "The specified game_id was not found."
}{
"error": "TooManyRequests",
"message": "The rate limit has been exceeded. Please wait and try again later."
}{
"error": "InternalServerError",
"message": "An unexpected error occurred on the server. Please try again later."
}The Game Data API is in preview. Endpoints, fields and limits may change before release, and it is not yet available to call.