SDKs

The official libraries for JavaScript and TypeScript, Python and Go: install, pages, errors and webhooks.

Updated October 22, 2026

Three libraries, one way of naming things: artists.list, changes.resolve, stats.trend, webhooks.create. Each reads the key from LABELSENTRY_KEY, follows pages for you, retries 429 and 5xx answers and sends an Idempotency-Key with every POST.

JavaScript and TypeScript

bash
npm install @labelsentry/sdk
ts
import { LabelSentry } from "@labelsentry/sdk";

const ls = new LabelSentry();
for await (const change of ls.changes.list({ severity: "critical", status: "open" })) {
  console.log(change.artist.name, change.summary);
}

Python

bash
pip install labelsentry
python
from labelsentry import LabelSentry

ls = LabelSentry()
trend = ls.stats.trend(days=28)
print(trend["streams_prev"], trend["buckets"][-1]["streams"])

Go

bash
go get github.com/LabelSentrycom/labelsentry-sdks/go
go
client := labelsentry.New("")
releases, err := client.Releases.List(ctx, &labelsentry.ReleasesListParams{State: "down"}).All()

Errors

A refused request raises an error with status, code, message and request_id: LabelSentryError in JavaScript and Python, *labelsentry.Error in Go, where labelsentry.IsCode(err, "not_found") checks the code.

Read next

Still stuck? Write to [email protected].