Teams and scores
These commands change the match information that the HUD and the scenes show: the teams, the event name, the team size and the score of each map.
They need the main MyHUD window to be open and signed in. Each change appears at once on the open pages, including OBS browser sources.
Team A and team B
The API always uses team A and team B, like the match page of MyHUD. They are the two teams of the series. They do not mean CT or T in the game.
Read the current match
curl http://127.0.0.1:44555/api/match(Invoke-RestMethod http://127.0.0.1:44555/api/match).matchimport requests
match = requests.get("http://127.0.0.1:44555/api/match").json()["match"]
print(match["seriesScore"])const { match } = await (await fetch('http://127.0.0.1:44555/api/match')).json();
console.log(match.seriesScore);The answer contains the event name, the teams, the series maps with their scores, the series score and the veto:
{
"ok": true,
"match": {
"eventName": "Spring Cup",
"teamFormat": "5v5",
"boFormat": "bo3",
"teamA": { "name": "Vitality" },
"teamB": { "name": "NAVI" },
"maps": [
{ "number": 1, "map": "de_nuke", "label": "Nuke", "pickedBy": "Vitality", "finished": true, "scoreA": 13, "scoreB": 9, "winner": "Vitality" },
{ "number": 2, "map": "de_mirage", "label": "Mirage", "pickedBy": "NAVI", "finished": false, "scoreA": 4, "scoreB": 6, "winner": null }
],
"seriesScore": { "a": 1, "b": 0 },
"veto": {
"steps": [
{ "type": "ban", "team": "A", "map": "de_ancient" },
{ "type": "ban", "team": "B", "map": "de_train" }
],
"revealed": 2
}
}
}teamA, teamB, boFormat and veto are null when they are not set yet.
The set_* commands below return the same match summary in result.
Set the teams
POST /api/actions/set_teams
{
"teamA": { "name": "Vitality", "logo": "https://example.com/vitality.png" },
"teamB": { "name": "NAVI" },
"boFormat": "bo3"
}logois optional.boFormat(bo1,bo3orbo5) is optional. It sets the series length shown on the versus scene.
MyHUD renames the teams everywhere: map results, picks, veto and versus scene.
Set the score of a map
POST /api/actions/set_map_result
{ "map": 1, "scoreA": 13, "scoreB": 9, "finished": true }mapis the map number in the series (1 to 5), or the map name if it is in the series ("mirage").finished: truemarks the map as played. MyHUD then sets the winner. If you do not sendfinished, the current value stays.
The map must already be in the series, from a veto or from the match page. If the slot is empty, MyHUD answers 409 conflict.
Set the event name
POST /api/actions/set_event_name
{ "name": "Spring Cup — Grand Final" }The HUD and the scenes show this name.
Set the team size
POST /api/actions/set_team_format
{ "format": "2v2" }Values: auto, 1v1, 2v2, 3v3, 5v5.
Example: a full series setup
This script sets the event and the teams, runs a BO3 veto, then sets the score of map 1:
$Base = 'http://127.0.0.1:44555'
function Invoke-MyHud([string]$Action, [hashtable]$Payload = @{}) {
Invoke-RestMethod -Method Post "$Base/api/actions/$Action" `
-ContentType 'application/json' -Body ($Payload | ConvertTo-Json -Depth 6 -Compress)
}
Invoke-MyHud set_event_name @{ name = 'Spring Cup' } | Out-Null
Invoke-MyHud set_teams @{ teamA = @{ name = 'Vitality' }; teamB = @{ name = 'NAVI' }; boFormat = 'bo3' } | Out-Null
Invoke-MyHud veto_start @{
boFormat = 'bo3'
teamA = @{ name = 'Vitality' }
teamB = @{ name = 'NAVI' }
mapPool = @('ancient', 'anubis', 'dust2', 'inferno', 'mirage', 'nuke', 'train')
} | Out-Null
foreach ($map in 'nuke', 'ancient', 'mirage', 'inferno', 'anubis', 'dust2') {
Invoke-MyHud veto_select @{ map = $map } | Out-Null
}
Invoke-MyHud set_map_result @{ map = 1; scoreA = 13; scoreB = 9; finished = $true } | Out-Nullimport requests
BASE = "http://127.0.0.1:44555"
def myhud(action, payload=None):
res = requests.post(f"{BASE}/api/actions/{action}", json=payload or {}, timeout=40)
body = res.json()
if not body["ok"]:
raise RuntimeError(f"{action} failed ({res.status_code} {body['error']}): {body['message']}")
return body.get("result")
teams = {"teamA": {"name": "Vitality"}, "teamB": {"name": "NAVI"}}
myhud("set_event_name", {"name": "Spring Cup"})
myhud("set_teams", {**teams, "boFormat": "bo3"})
myhud("veto_start", {
**teams,
"boFormat": "bo3",
"mapPool": ["ancient", "anubis", "dust2", "inferno", "mirage", "nuke", "train"],
})
for map_name in ["nuke", "ancient", "mirage", "inferno", "anubis", "dust2"]:
myhud("veto_select", {"map": map_name})
match = myhud("set_map_result", {"map": 1, "scoreA": 13, "scoreB": 9, "finished": True})
print("Series:", match["seriesScore"])const BASE = 'http://127.0.0.1:44555';
async function myhud<T = unknown>(action: string, payload: object = {}): Promise<T> {
const res = await fetch(`${BASE}/api/actions/${action}`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(payload),
});
const body = await res.json();
if (!body.ok) throw new Error(`${action} failed (${res.status} ${body.error}): ${body.message}`);
return body.result as T;
}
const teams = { teamA: { name: 'Vitality' }, teamB: { name: 'NAVI' } };
await myhud('set_event_name', { name: 'Spring Cup' });
await myhud('set_teams', { ...teams, boFormat: 'bo3' });
await myhud('veto_start', {
...teams,
boFormat: 'bo3',
mapPool: ['ancient', 'anubis', 'dust2', 'inferno', 'mirage', 'nuke', 'train'],
});
for (const map of ['nuke', 'ancient', 'mirage', 'inferno', 'anubis', 'dust2']) {
await myhud('veto_select', { map });
}
const match = await myhud<{ seriesScore: { a: number; b: number } }>('set_map_result', {
map: 1,
scoreA: 13,
scoreB: 9,
finished: true,
});
console.log('Series:', match.seriesScore);