Get started with automation
This page shows how to turn on the automation server and send a first command.
Turn on the server
- Open MyHUD.
- Go to Integrations > Local automation.
- Select Enable local automation server.
The panel shows two addresses:
| Address | |
|---|---|
| WebSocket | ws://127.0.0.1:44555 |
| HTTP | http://127.0.0.1:44555 |
By default, only programs on this PC can connect. They do not need a password or a token. To control MyHUD from another device, read Control from another device.
Code examples
The examples in these pages are in curl, PowerShell, Python and TypeScript. Click a tab to choose the language.
- Python: Python 3.9 or later. Install the
requestspackage:pip install requests. - TypeScript: Node.js 22 or later, no package needed. Save the file with the
.mtsextension and run it withnpx tsx script.mts.
Send a first command
Open the HUD overlay, then send toggle_scoreboard. The scoreboard opens or closes, like with the F9 key.
curl -X POST http://127.0.0.1:44555/api/actions/toggle_scoreboardInvoke-RestMethod -Method Post http://127.0.0.1:44555/api/actions/toggle_scoreboardimport requests
res = requests.post("http://127.0.0.1:44555/api/actions/toggle_scoreboard")
print(res.json())const res = await fetch('http://127.0.0.1:44555/api/actions/toggle_scoreboard', { method: 'POST' });
console.log(await res.json());MyHUD answers with JSON:
{ "ok": true, "state": { "revision": 12, "scoreboardVisible": true } }Send a command with data
Some commands need data (the payload). Send it as a JSON body. This example sets the two teams:
curl -X POST http://127.0.0.1:44555/api/actions/set_teams \
-H 'Content-Type: application/json' \
-d '{"teamA":{"name":"Vitality"},"teamB":{"name":"NAVI"}}'$body = @{
teamA = @{ name = 'Vitality' }
teamB = @{ name = 'NAVI' }
} | ConvertTo-Json
Invoke-RestMethod -Method Post http://127.0.0.1:44555/api/actions/set_teams `
-ContentType 'application/json' -Body $bodyimport requests
res = requests.post(
"http://127.0.0.1:44555/api/actions/set_teams",
json={"teamA": {"name": "Vitality"}, "teamB": {"name": "NAVI"}},
)
print(res.json())const res = await fetch('http://127.0.0.1:44555/api/actions/set_teams', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ teamA: { name: 'Vitality' }, teamB: { name: 'NAVI' } }),
});
console.log(await res.json());A helper for your scripts
Most scripts send many commands. This small function sends a command, raises an error when it fails, and returns the result. The longer examples in these pages use it.
import 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")
myhud("set_event_name", {"name": "Spring Cup"})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;
}
await myhud('set_event_name', { name: 'Spring Cup' });A veto import can take up to 20 seconds. If you set a timeout, keep it above 30 seconds.
Toggle or show/hide?
toggle_scoreboard inverts the current state. For a Stream Deck button, this is what you want.
In a script, use show_scoreboard and hide_scoreboard instead. They always give the same result, even if you send them two times. The same pairs exist for the veto, the stats and the overlay window. See Commands.
Keep the MyHUD window open
Many commands (veto, teams, scores, scene overlays) need the main MyHUD window to be open and signed in. If it is closed, they fail with 503 unavailable. The command list shows which commands need it.
See what MyHUD received
The Recent requests list in the panel shows each request, its result, and the IP address of the sender. Use it when a command does not do what you expect.
You can also ask MyHUD for the list of all its commands:
curl http://127.0.0.1:44555/api/actions