Kastyn API

The Kastyn API gives Pro users programmatic access to their station metadata. Use it to pull track data, build integrations, or automate your broadcast workflow.

The Kastyn API is available on the Pro Broadcast plan only. Upgrade your plan to get access.

Base URL

https://api.kastyn.co.uk/v1

API Keys

Generate API keys from your dashboard settings. Keys are prefixed with kst_live_ and are shown only once when created — store them securely.

Authentication

Pass your API key in the X-Api-Key header on every request.

curl https://api.kastyn.co.uk/v1/stations \
  -H "X-Api-Key: kst_live_your_key_here"
const response = await fetch('https://api.kastyn.co.uk/v1/stations', {
  headers: {
    'X-Api-Key': 'kst_live_your_key_here'
  }
});
const stations = await response.json();
import requests

response = requests.get(
    'https://api.kastyn.co.uk/v1/stations',
    headers={'X-Api-Key': 'kst_live_your_key_here'}
)
stations = response.json()
Never expose your API key in client-side code. Always make API requests from a secure server environment.

Rate Limits

API requests are rate limited per key to prevent abuse.

100
Requests per minute
10,000
Requests per day

When a rate limit is exceeded, the API returns a 429 Too Many Requests response. Back off and retry after a short delay.

Errors

The API uses standard HTTP status codes. Error responses include a detail field explaining what went wrong.

200 Success
401 Missing or invalid API key
403 Plan does not include API access
404 Resource not found
429 Rate limit exceeded
500 Internal server error

Error response format

{
  "detail": "Invalid or revoked API key."
}

Stations

List all stations associated with your account.

GET /v1/stations List all stations

Returns all stations belonging to the authenticated account.

curl https://api.kastyn.co.uk/v1/stations \
  -H "X-Api-Key: kst_live_your_key_here"
const res = await fetch('https://api.kastyn.co.uk/v1/stations', {
  headers: { 'X-Api-Key': 'kst_live_your_key_here' }
});
const stations = await res.json();
import requests

stations = requests.get(
    'https://api.kastyn.co.uk/v1/stations',
    headers={'X-Api-Key': 'kst_live_your_key_here'}
).json()
Response 200
[
  {
    "id": "cfcb9166-d774-408b-8c8d-7cccea1e57c6",
    "name": "Genesis Radio Birmingham",
    "description": "Main GRB station library",
    "is_active": true
  }
]

Tracks

List all tracks for a specific station.

GET /v1/stations/{station_id}/tracks List tracks for a station

Returns all tracks scanned for the specified station. The title and artist fields return corrected metadata where available, falling back to the original values.

Parameter Type Description
station_id string (UUID) The station ID from /v1/stations
curl https://api.kastyn.co.uk/v1/stations/STATION_ID/tracks \
  -H "X-Api-Key: kst_live_your_key_here"
const res = await fetch(
  `https://api.kastyn.co.uk/v1/stations/${stationId}/tracks`,
  { headers: { 'X-Api-Key': 'kst_live_your_key_here' } }
);
const tracks = await res.json();
tracks = requests.get(
    f'https://api.kastyn.co.uk/v1/stations/{station_id}/tracks',
    headers={'X-Api-Key': 'kst_live_your_key_here'}
).json()
Response 200
[
  {
    "id": "a1b2c3d4-...",
    "title": "Bohemian Rhapsody",
    "artist": "Queen",
    "album": "A Night at the Opera",
    "original_title": "bohemian_rhapsody_final.mp3",
    "original_artist": "unknown",
    "confidence_score": 0.97,
    "file_path": "/music/classic/bohemian_rhapsody_final.mp3",
    "created_at": "2026-06-01T12:00:00"
  }
]

Single Track

Retrieve a single track by ID.

GET /v1/tracks/{track_id} Get a single track

Returns full metadata for a single track. The track must belong to a station owned by the authenticated account.

Parameter Type Description
track_id string (UUID) The track ID
curl https://api.kastyn.co.uk/v1/tracks/TRACK_ID \
  -H "X-Api-Key: kst_live_your_key_here"
const res = await fetch(
  `https://api.kastyn.co.uk/v1/tracks/${trackId}`,
  { headers: { 'X-Api-Key': 'kst_live_your_key_here' } }
);
const track = await res.json();
track = requests.get(
    f'https://api.kastyn.co.uk/v1/tracks/{track_id}',
    headers={'X-Api-Key': 'kst_live_your_key_here'}
).json()
Response 200
{
  "id": "a1b2c3d4-...",
  "title": "Bohemian Rhapsody",
  "artist": "Queen",
  "album": "A Night at the Opera",
  "original_title": "bohemian_rhapsody_final.mp3",
  "original_artist": "unknown",
  "confidence_score": 0.97,
  "file_path": "/music/classic/bohemian_rhapsody_final.mp3",
  "station_id": "cfcb9166-...",
  "created_at": "2026-06-01T12:00:00"
}