{
  "openapi": "3.1.0",
  "info": {
    "title": "Ritme Now-Playing API",
    "version": "1.0.0",
    "description": "A public, read-only API for the Dutch radio station catalog and current stream metadata. No authentication or OAuth scope is required. Use /api/v1 for the stable API; the unversioned now-playing route remains a compatibility alias. The station catalog accepts an optional category filter. Breaking changes will use a new versioned path.",
    "termsOfService": "https://radio.theroks.com/",
    "contact": {
      "name": "Ritme"
    }
  },
  "servers": [
    {
      "url": "https://radio.theroks.com",
      "description": "Production"
    }
  ],
  "externalDocs": {
    "description": "Developer guide, examples, and agent usage",
    "url": "https://radio.theroks.com/developers"
  },
  "paths": {
    "/api/v1/stations": {
      "get": {
        "operationId": "listV1Stations",
        "summary": "List Dutch radio stations",
        "description": "Returns the complete public catalog, or filters it by the optional category parameter. Stream URLs are supplied by each broadcaster; Ritme does not proxy the audio.",
        "tags": [
          "Stations"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "The station catalog.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StationCatalog"
                }
              }
            }
          },
          "400": {
            "description": "The category is unknown or supplied more than once.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "405": {
            "description": "The HTTP method is not supported. The response includes an Allow header.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "headers": {
              "Allow": {
                "description": "Methods accepted by this endpoint.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Unexpected API errors use RFC 9457 Problem Details.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "required": false,
            "description": "Optional station genre. Omit this parameter to return all stations.",
            "schema": {
              "type": "string",
              "enum": [
                "pop",
                "relax",
                "news",
                "classics",
                "dutch",
                "dance",
                "kids",
                "alternative"
              ]
            }
          }
        ]
      },
      "head": {
        "operationId": "headV1Stations",
        "summary": "Check the station catalog endpoint",
        "description": "Returns the same status and headers as GET without a response body.",
        "tags": [
          "Stations"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "The catalog endpoint is available; no response body is sent for HEAD."
          },
          "405": {
            "description": "The method is not supported. No response body is sent for HEAD."
          }
        }
      }
    },
    "/api/v1/now-playing/{stationId}": {
      "get": {
        "operationId": "getV1StationNowPlaying",
        "summary": "Get current stream metadata for a station",
        "description": "Returns the current ICY stream title when supplied by the broadcaster, plus available bitrate and content type. The audio stream itself is not proxied.",
        "tags": [
          "Stations"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Stream metadata was read. Fields can be null when the broadcaster does not provide them.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NowPlaying"
                }
              }
            }
          },
          "404": {
            "description": "The requested station does not exist.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "405": {
            "description": "The HTTP method is not supported. The response includes an Allow header.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "headers": {
              "Allow": {
                "description": "Methods accepted by this endpoint.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "502": {
            "description": "The broadcaster stream could not provide metadata.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Unexpected API errors use RFC 9457 Problem Details.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "stationId",
            "in": "path",
            "required": true,
            "description": "Lowercase station ID from the Ritme station catalog.",
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9-]+$",
              "enum": [
                "radio538",
                "q-music",
                "skyradio",
                "bnr",
                "decibel",
                "sublimefm",
                "veronicafm",
                "radio10",
                "radio1",
                "538nonstop",
                "joe",
                "skyhits",
                "538greatesthits",
                "q-musicnonstop",
                "skywork",
                "538ochtendshow",
                "q-musicfouteuur",
                "skychristmas",
                "53890s",
                "joenonstop",
                "skyradio00s10s",
                "100pnl",
                "100nonstop",
                "100feest",
                "radio10nonstop",
                "radio2",
                "6070shits",
                "3fm",
                "radio1080shits",
                "radio4",
                "radio10soul",
                "radio5",
                "538ibiza",
                "qmusic90s",
                "slamfm",
                "slamnonstop",
                "slamhousuh",
                "slammix",
                "arrow",
                "arrowbluesrock",
                "funx",
                "538tomorrowland",
                "qmusiceasy",
                "radionoordzee",
                "soulradio",
                "classicfm",
                "bbb",
                "efteling",
                "candlelight",
                "kink"
              ]
            }
          }
        ]
      },
      "head": {
        "operationId": "headV1StationNowPlaying",
        "summary": "Check the now-playing endpoint",
        "description": "Returns the same status and headers as GET without a response body.",
        "tags": [
          "Stations"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "The endpoint is available; no response body is sent for HEAD."
          },
          "404": {
            "description": "The requested station does not exist. No response body is sent for HEAD."
          },
          "405": {
            "description": "The method is not supported. No response body is sent for HEAD."
          },
          "502": {
            "description": "The broadcaster stream could not provide metadata. No response body is sent for HEAD."
          }
        },
        "parameters": [
          {
            "name": "stationId",
            "in": "path",
            "required": true,
            "description": "Lowercase station ID from the Ritme station catalog.",
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9-]+$",
              "enum": [
                "radio538",
                "q-music",
                "skyradio",
                "bnr",
                "decibel",
                "sublimefm",
                "veronicafm",
                "radio10",
                "radio1",
                "538nonstop",
                "joe",
                "skyhits",
                "538greatesthits",
                "q-musicnonstop",
                "skywork",
                "538ochtendshow",
                "q-musicfouteuur",
                "skychristmas",
                "53890s",
                "joenonstop",
                "skyradio00s10s",
                "100pnl",
                "100nonstop",
                "100feest",
                "radio10nonstop",
                "radio2",
                "6070shits",
                "3fm",
                "radio1080shits",
                "radio4",
                "radio10soul",
                "radio5",
                "538ibiza",
                "qmusic90s",
                "slamfm",
                "slamnonstop",
                "slamhousuh",
                "slammix",
                "arrow",
                "arrowbluesrock",
                "funx",
                "538tomorrowland",
                "qmusiceasy",
                "radionoordzee",
                "soulradio",
                "classicfm",
                "bbb",
                "efteling",
                "candlelight",
                "kink"
              ]
            }
          }
        ]
      }
    },
    "/api/now-playing/{stationId}": {
      "get": {
        "operationId": "getLegacyStationNowPlaying",
        "summary": "Get current stream metadata for a station",
        "description": "Returns the current ICY stream title when supplied by the broadcaster, plus available bitrate and content type. The audio stream itself is not proxied. This compatibility alias remains available; use the versioned /api/v1 route for new integrations.",
        "tags": [
          "Stations"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Stream metadata was read. Fields can be null when the broadcaster does not provide them.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NowPlaying"
                }
              }
            }
          },
          "404": {
            "description": "The requested station does not exist.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "405": {
            "description": "The HTTP method is not supported. The response includes an Allow header.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "headers": {
              "Allow": {
                "description": "Methods accepted by this endpoint.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "502": {
            "description": "The broadcaster stream could not provide metadata.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Unexpected API errors use RFC 9457 Problem Details.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "stationId",
            "in": "path",
            "required": true,
            "description": "Lowercase station ID from the Ritme station catalog.",
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9-]+$",
              "enum": [
                "radio538",
                "q-music",
                "skyradio",
                "bnr",
                "decibel",
                "sublimefm",
                "veronicafm",
                "radio10",
                "radio1",
                "538nonstop",
                "joe",
                "skyhits",
                "538greatesthits",
                "q-musicnonstop",
                "skywork",
                "538ochtendshow",
                "q-musicfouteuur",
                "skychristmas",
                "53890s",
                "joenonstop",
                "skyradio00s10s",
                "100pnl",
                "100nonstop",
                "100feest",
                "radio10nonstop",
                "radio2",
                "6070shits",
                "3fm",
                "radio1080shits",
                "radio4",
                "radio10soul",
                "radio5",
                "538ibiza",
                "qmusic90s",
                "slamfm",
                "slamnonstop",
                "slamhousuh",
                "slammix",
                "arrow",
                "arrowbluesrock",
                "funx",
                "538tomorrowland",
                "qmusiceasy",
                "radionoordzee",
                "soulradio",
                "classicfm",
                "bbb",
                "efteling",
                "candlelight",
                "kink"
              ]
            }
          }
        ]
      },
      "head": {
        "operationId": "headLegacyStationNowPlaying",
        "summary": "Check the now-playing endpoint",
        "description": "Returns the same status and headers as GET without a response body. This compatibility alias remains available; use the versioned /api/v1 route for new integrations.",
        "tags": [
          "Stations"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "The endpoint is available; no response body is sent for HEAD."
          },
          "404": {
            "description": "The requested station does not exist. No response body is sent for HEAD."
          },
          "405": {
            "description": "The method is not supported. No response body is sent for HEAD."
          },
          "502": {
            "description": "The broadcaster stream could not provide metadata. No response body is sent for HEAD."
          }
        },
        "parameters": [
          {
            "name": "stationId",
            "in": "path",
            "required": true,
            "description": "Lowercase station ID from the Ritme station catalog.",
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9-]+$",
              "enum": [
                "radio538",
                "q-music",
                "skyradio",
                "bnr",
                "decibel",
                "sublimefm",
                "veronicafm",
                "radio10",
                "radio1",
                "538nonstop",
                "joe",
                "skyhits",
                "538greatesthits",
                "q-musicnonstop",
                "skywork",
                "538ochtendshow",
                "q-musicfouteuur",
                "skychristmas",
                "53890s",
                "joenonstop",
                "skyradio00s10s",
                "100pnl",
                "100nonstop",
                "100feest",
                "radio10nonstop",
                "radio2",
                "6070shits",
                "3fm",
                "radio1080shits",
                "radio4",
                "radio10soul",
                "radio5",
                "538ibiza",
                "qmusic90s",
                "slamfm",
                "slamnonstop",
                "slamhousuh",
                "slammix",
                "arrow",
                "arrowbluesrock",
                "funx",
                "538tomorrowland",
                "qmusiceasy",
                "radionoordzee",
                "soulradio",
                "classicfm",
                "bbb",
                "efteling",
                "candlelight",
                "kink"
              ]
            }
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "NowPlaying": {
        "type": "object",
        "required": [
          "title",
          "bitrateKbps",
          "contentType"
        ],
        "properties": {
          "title": {
            "type": [
              "string",
              "null"
            ],
            "description": "Current track title, when the broadcaster supplies ICY metadata."
          },
          "bitrateKbps": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "Bitrate reported by the station stream, in kilobits per second."
          },
          "contentType": {
            "type": [
              "string",
              "null"
            ],
            "description": "Media type reported by the station stream."
          }
        },
        "additionalProperties": false
      },
      "Problem": {
        "type": "object",
        "description": "RFC 9457 Problem Details with Ritme-specific code and resolution members.",
        "required": [
          "type",
          "title",
          "status",
          "detail",
          "instance",
          "code",
          "resolution"
        ],
        "properties": {
          "type": {
            "type": "string",
            "format": "uri-reference"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer",
            "minimum": 100,
            "maximum": 599
          },
          "detail": {
            "type": "string",
            "description": "A human-readable explanation of this error occurrence."
          },
          "instance": {
            "type": "string",
            "format": "uri-reference"
          },
          "code": {
            "type": "string",
            "description": "Stable machine-readable error code."
          },
          "resolution": {
            "type": "string",
            "description": "Suggested next step for resolving the error."
          }
        },
        "additionalProperties": true
      },
      "Station": {
        "type": "object",
        "required": [
          "id",
          "name",
          "category",
          "categoryLabel",
          "description",
          "stream"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9-]+$",
            "description": "Stable station ID used by the now-playing endpoint."
          },
          "name": {
            "type": "string",
            "description": "Station name shown in the Ritme catalog."
          },
          "category": {
            "type": "string",
            "enum": [
              "pop",
              "relax",
              "news",
              "classics",
              "dutch",
              "dance",
              "kids",
              "alternative"
            ]
          },
          "categoryLabel": {
            "type": "string",
            "description": "Human-readable genre label in Dutch."
          },
          "description": {
            "type": "string",
            "description": "Short station description in Dutch."
          },
          "stream": {
            "type": "string",
            "format": "uri",
            "description": "HTTPS audio stream URL provided by the broadcaster. Ritme does not proxy this stream."
          }
        },
        "additionalProperties": false
      },
      "StationCatalog": {
        "type": "object",
        "required": [
          "count",
          "stations"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "minimum": 0,
            "description": "Number of stations in the catalog."
          },
          "stations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Station"
            }
          }
        },
        "additionalProperties": false
      }
    },
    "responses": {
      "ProblemNotFound": {
        "description": "The requested endpoint or station does not exist.",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "ProblemMethodNotAllowed": {
        "description": "The HTTP method is not supported. The response includes an Allow header.",
        "headers": {
          "Allow": {
            "description": "Methods accepted by this endpoint.",
            "schema": {
              "type": "string"
            }
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "ProblemBadGateway": {
        "description": "The broadcaster stream could not provide metadata.",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Stations",
      "description": "Public Dutch radio station catalog and stream metadata."
    }
  ]
}
