24/7 supportRequest a demo

Developers · SDKs

Official SDKs.

Ready-made clients for JavaScript/TypeScript and Python. One file each, no dependencies: download it into your project and go.

Every endpoint

Stations, now playing, what aired, logs, the library, records, actions, audio, and the on-air controls.

Safe retries

Rate limits and temporary errors are retried for you, and every change carries an Idempotency-Key, so a retry never runs twice.

Paging and watching

paginate walks through every page; watch tells you when an answer changes.

Safe edits

getRecord gives you the record's ETag; pass it to updateRecord or deleteRecord and nothing is overwritten.

Audio in one call

addToLibrary uploads a file and creates the library item.

Webhooks

verifyWebhook checks a delivery's signature.

JavaScript & TypeScript

Node, Deno, Bun, Workers.

index.mjs is the client and index.d.ts its types. Use it in server-side code only: an API key in a web page can be copied by anyone.

Get it
mkdir stationmonster && cd stationmonster
curl -O https://stationmonster.com/sdk/js/index.mjs \
     -O https://stationmonster.com/sdk/js/index.d.ts \
     -O https://stationmonster.com/sdk/js/package.json

In Deno you can import it straight from https://stationmonster.com/sdk/js/index.mjs.

example.mjs
import { StationMonster } from "./stationmonster/index.mjs";

const sm = new StationMonster({ apiKey: process.env.STATIONMONSTER_API_KEY });

const { data: stations } = await sm.listStations();
const station = stations[0].id;

// What's on air, and everything that aired today
const now = await sm.nowPlaying(station);
for await (const play of sm.paginate((cursor) => sm.plays(station, { cursor }))) {
  console.log(play.started_at, play.artist, play.title);
}

// Run the Studio (needs the Run the air permission)
const cmd = await sm.skip(station);
const done = await sm.waitForCommand(station, cmd.id);   // { status: "done" }
await sm.setLevel(station, "carts", 0.6);                 // pull the cart fader down a bit
const { data: studios } = await sm.studios(station);
await sm.handControl(station, studios.find((s) => s.name === "Studio B").id);
await sm.setNowPlayingText(station, "Live from the County Fair!");

// Add a commercial to the library
import { readFile } from "node:fs/promises";
await sm.addToLibrary(station, await readFile("spot.mp3"), {
  ext: "mp3", contentType: "audio/mpeg", title: "Main Street Motors 30", category: "advert", duration_ms: 30000,
});

Python

Python 3.8 and up.

One file using only the standard library. Put it next to your script.

Get it
curl -O https://stationmonster.com/sdk/python/stationmonster.py
example.py
from stationmonster import StationMonster

sm = StationMonster()  # reads STATIONMONSTER_API_KEY

station = sm.list_stations()["data"][0]["id"]
print(sm.now_playing(station)["title"])

# Tomorrow's log, entry by entry
for entry in sm.log(station, "2026-10-28")["data"]:
    print(entry["position"], entry["title"])

# Records with filters, safely changed
page = sm.list_records("advertisers", filters={"name": "ilike.*motors*"})
record, etag = sm.get_record("advertisers", page["data"][0]["id"])
sm.update_record("advertisers", record["id"], {"phone": "555-0199"}, if_match=etag)

# Skip to the next item and wait for the engine
cmd = sm.skip(station)
print(sm.wait_for_command(station, cmd["id"])["status"])

Webhooks

Check every delivery.

Both SDKs check the X-StationMonster-Signature header against your webhook's secret (Python: verify_webhook). Pass the body exactly as it arrived.

route.js
import { verifyWebhook } from "./stationmonster/index.mjs";

export async function POST(req) {
  const raw = await req.text();
  const ok = await verifyWebhook(raw, req.headers.get("x-stationmonster-signature"), process.env.WEBHOOK_SECRET);
  if (!ok) return new Response("Bad signature", { status: 401 });
  const event = JSON.parse(raw);
  // event.event = "now_playing.changed", "request.received", …
  return new Response("OK");
}

Another language? Import the OpenAPI document into a code generator (openapi-generator, oapi-codegen, NSwag…) or Postman. The SDKs and the document follow the same list of endpoints, so they never drift apart.

Missing something?

Tell us which language or helper you'd like next.