Swift Package

SwiftSonic

A native Swift client for the Subsonic and OpenSubsonic APIs.

Zero dependencies. Pure URLSession. Strict spec compliance.

Latest release version MIT License
import SwiftSonic

let client = SwiftSonicClient(
    config: ServerConfiguration(
        host: "music.example.com",
        username: "user",
        password: "pass"
    )
)

let albums = try await client.getAlbumList2(type: .recent)

That's the whole API. Async/await, strongly typed, ready to go.

Strict spec compliance

Implements the official Subsonic and OpenSubsonic specifications. Nothing server-specific.

Zero dependencies

Pure URLSession. No third-party HTTP libraries. Audit-friendly.

Modern Swift

Actor-based, Sendable types, strict concurrency ready, async/await everywhere.

Battle-tested

Used in production by Cassette and other apps. Security-hardened, CVE-grade fixes shipped.

Talks to any Subsonic-compatible server

If your server implements the Subsonic API, SwiftSonic talks to it. OpenSubsonic extensions supported where available.

  • Navidrome
  • Subsonic
  • Airsonic
  • Airsonic-Advanced
  • Gonic
  • Funkwhale
  • Ampache
  • LMS

Installation

Add SwiftSonic to your Package.swift.

dependencies: [
    .package(url: "https://github.com/MathieuDubart/SwiftSonic", from: "0.6.1")
]

Read the full guide →