Everything needed to open every orderbook of a game
curl --request GET \
--url https://api.vatic.trading/api/v1/games/{id}/streams \
--header 'x-api-key: <api-key>'import requests
url = "https://api.vatic.trading/api/v1/games/{id}/streams"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.vatic.trading/api/v1/games/{id}/streams', 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.vatic.trading/api/v1/games/{id}/streams",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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.vatic.trading/api/v1/games/{id}/streams"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
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.vatic.trading/api/v1/games/{id}/streams")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vatic.trading/api/v1/games/{id}/streams")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"game_id": "<string>",
"markets_scope": "<string>",
"venues": [
{
"source": "<string>",
"redistributable": "<string>",
"refs": [
"<string>"
],
"book_semantics": "every_outcome_has_its_own_book",
"socket": {
"url": "<string>",
"protocol": "json",
"auth": {},
"heartbeat": {},
"frames": "<string>",
"note": "<string>"
},
"subscribe": [
{}
]
}
],
"markets": [
{
"id": "polymarket:0x9f1a...",
"game_id": "<string>",
"source": "<string>",
"event_external_id": "<string>",
"title": "<string>",
"raw_type": "<string>",
"canonical": {
"key": "1x2",
"period": "<string>",
"line": 123,
"includes_overtime": true
},
"redistributable": "yes",
"active": true,
"closed": true,
"venue_meta": {},
"outcomes": [
{
"idx": 123,
"label": "<string>",
"canonical_outcome": "<string>",
"team_id": "<string>",
"book": {
"type": "polymarket_asset_id",
"ref": "<string>",
"side": "<string>"
},
"trade": {
"venue": "polymarket",
"chain": {
"name": "<string>",
"id": 123
},
"instrument": {},
"order": {},
"contracts": {},
"collateral": {},
"submit": {},
"complement": {},
"tradable": true,
"caveats": [
"<string>"
],
"reference": [
"<string>"
]
}
}
]
}
]
},
"meta": {
"as_of": "2023-11-07T05:31:56Z",
"redistributable_filter": "yes_only",
"venues_checked": [
"<string>"
],
"total": 123,
"withheld": {
"games": 123,
"reason": "<string>"
}
}
}{
"error": "<string>",
"code": "<string>",
"hint": "<string>"
}{
"error": "<string>",
"code": "<string>",
"hint": "<string>"
}{
"error": "<string>",
"code": "<string>",
"hint": "<string>"
}{
"error": "<string>",
"code": "<string>",
"hint": "<string>"
}{
"error": "<string>",
"code": "<string>",
"hint": "<string>"
}Game Graph
Game streams
One call returns, per platform, the identifiers and the exact WebSocket subscribe messages needed to stream the books of a game. Platforms that publish only the YES book of a market (book_semantics: yes_book_only_derive_no) are subscribed once per market; the NO side is derived (price 1-p, bids and asks swapped). Where a platform needs an API key to stream (socket.auth), use your own key with that platform.
GET
/
api
/
v1
/
games
/
{id}
/
streams
Everything needed to open every orderbook of a game
curl --request GET \
--url https://api.vatic.trading/api/v1/games/{id}/streams \
--header 'x-api-key: <api-key>'import requests
url = "https://api.vatic.trading/api/v1/games/{id}/streams"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.vatic.trading/api/v1/games/{id}/streams', 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.vatic.trading/api/v1/games/{id}/streams",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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.vatic.trading/api/v1/games/{id}/streams"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
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.vatic.trading/api/v1/games/{id}/streams")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vatic.trading/api/v1/games/{id}/streams")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"game_id": "<string>",
"markets_scope": "<string>",
"venues": [
{
"source": "<string>",
"redistributable": "<string>",
"refs": [
"<string>"
],
"book_semantics": "every_outcome_has_its_own_book",
"socket": {
"url": "<string>",
"protocol": "json",
"auth": {},
"heartbeat": {},
"frames": "<string>",
"note": "<string>"
},
"subscribe": [
{}
]
}
],
"markets": [
{
"id": "polymarket:0x9f1a...",
"game_id": "<string>",
"source": "<string>",
"event_external_id": "<string>",
"title": "<string>",
"raw_type": "<string>",
"canonical": {
"key": "1x2",
"period": "<string>",
"line": 123,
"includes_overtime": true
},
"redistributable": "yes",
"active": true,
"closed": true,
"venue_meta": {},
"outcomes": [
{
"idx": 123,
"label": "<string>",
"canonical_outcome": "<string>",
"team_id": "<string>",
"book": {
"type": "polymarket_asset_id",
"ref": "<string>",
"side": "<string>"
},
"trade": {
"venue": "polymarket",
"chain": {
"name": "<string>",
"id": 123
},
"instrument": {},
"order": {},
"contracts": {},
"collateral": {},
"submit": {},
"complement": {},
"tradable": true,
"caveats": [
"<string>"
],
"reference": [
"<string>"
]
}
}
]
}
]
},
"meta": {
"as_of": "2023-11-07T05:31:56Z",
"redistributable_filter": "yes_only",
"venues_checked": [
"<string>"
],
"total": 123,
"withheld": {
"games": 123,
"reason": "<string>"
}
}
}{
"error": "<string>",
"code": "<string>",
"hint": "<string>"
}{
"error": "<string>",
"code": "<string>",
"hint": "<string>"
}{
"error": "<string>",
"code": "<string>",
"hint": "<string>"
}{
"error": "<string>",
"code": "<string>",
"hint": "<string>"
}{
"error": "<string>",
"code": "<string>",
"hint": "<string>"
}Authorizations
Required for order endpoints. Obtain your API key from the Vatic dashboard.
Path Parameters
Game id, e.g. espn:401879264. An id that was replaced still resolves to the new game.
Example:
"espn:401879264"
Query Parameters
main = the full-game 1x2 / moneyline.
Available options:
main, classified, all Was this page helpful?