jamesragnar/audiobookshelf-api-swift
A thin Swift client for the Audiobookshelf API, providing async/await request functions and model structs.
Supported Server Range
Supported range: audiobookshelf >= 2.26.0 and <= 2.33.2
- Exception:
GetSearchProviders(/api/search/providers) requires server>= 2.31.0. - Deprecated/Removed in package
2.33.0: legacyAuthorizeUser(/api/authorize) wrapper was removed. Use JWT auth endpoints instead.
Installation
Add this package to your project using Swift Package Manager:
// In your Package.swift — use the version matching your target server minor
dependencies: [
.package(
url: "https://github.com/JamesRagnar/audiobookshelf-api-swift.git",
.upToNextMinor(from: "1.2.0")
),
]Or in Xcode:
- File → Add Packages…
- Enter the repository URL:
https://github.com/JamesRagnar/audiobookshelf-api-swift.git - Choose the version you need
Versioning
This package is a thin Swift client for the upstream Audiobookshelf API. Version numbers are aligned with the corresponding server API version:
<server-major>.<server-minor>.<client-patch>- MAJOR / MINOR indicate the supported server API version
- PATCH releases contain client-side fixes and corrections
Because this package mirrors the server API closely (like an OpenAPI-generated client), upgrades may require changes to how the API is used — even on PATCH bumps. Always review release notes for breaking changes.
Usage
import AudiobookshelfAPI
let server = ServerConfiguration(
url: URL(string: "http://localhost:13378")!,
authToken: "your_api_token"
)
do {
let item = try await URLSession().dataTask(
GetLibraryItem.self,
.init(itemID: "itemID"),
server
)
} catch {
print("Error fetching item:", error)
}Contributing
Contributions are welcome! Please open an issue or submit a pull request.
License
Apache License 2.0. See LICENSE for details.
Package Metadata
Repository: jamesragnar/audiobookshelf-api-swift
Default branch: main
README: README.md