The official Swift package for the WorkoutX API. Build fitness apps for iOS, watchOS, iPadOS, and macOS with native async/await — 1,400+ exercises with GIF animations, the AI Workout Generator, supplements, and the Body Scan API. Built on URLSession, no third-party dependencies.
📦 Publishing to GitHub shortly — not yet available. Get your key now and you'll be ready the moment it lands.
One client covers both products — the Exercise API (API-key auth) and the Body Scan API (user JWT). The SDK attaches the right credential automatically.
Modern concurrency built on URLSession. Strongly-typed Exercise models and a flexible JSON type for everything else.
Automatic retries with backoff on 429 and 5xx, honoring Retry-After. Structured WorkoutXError with status, code and tips.
Exercises, GIFs, workouts, supplements and Body Scan — all under wx.*. Auth handled transparently per product.
Exercise IDs are not sequential, so passing a human name to get() returns a 404. The find() helper tries an ID first, then falls back to a name search.
Add the Swift Package https://github.com/workoutx/sdk-swift in Xcode (File ▸ Add Packages) or to your Package.swift dependencies, then add the WorkoutX product to your target.
iOS 13+, macOS 10.15+, watchOS 6+, and tvOS 13+. It uses native async/await and URLSession, with no third-party dependencies.
Use wx.gifURL("0001") to build a direct URL and pass it to AsyncImage, or fetch raw bytes with wx.gifs.get().
Body Scan uses a logged-in user's JWT. Pass scan: .token("..."), or scan: .credentials(email:password:) to let the SDK log in automatically.
Anything bundled in an iOS app can be extracted. For production, route requests through your own backend or use a restricted, rotatable key rather than embedding a full-access key.
gifURL() puts the key in the query string so AsyncImage can load it. Since URLs can leak via logs and referrers, use a separate, restricted key for GIFs where possible.
For Body Scan, fetch a short-lived JWT from your backend and pass scan: .token(...). Avoid shipping the email/password login flow inside the app.
Free tier included. 1,400+ exercises, GIFs, workouts, and Body Scan in one Swift package.
Get your free API key