exerciseapi.dev

How do I add exercise data to a Flutter app?

Use one exerciseapi.dev request to fill a Flutter list and detail screen. See where the key goes and how to use the list offline for up to 30 days.

One request fills both screens

Fetch a list from exerciseapi.dev with your API key and save it on the phone. Show the exercise names in your Flutter list. When someone taps a name, open the saved steps without another call.

Our library covers 2,200 exercises across 12 disciplines. Say you want 20 strength exercises for your first screen. Each result is a full exercise record, even on the free plan.

Where the key goes

You can ship the key in a mobile app you publish. Pass it to your Flutter build with --dart-define=EXERCISEAPI_KEY=your_key. In Dart, read it with const String.fromEnvironment('EXERCISEAPI_KEY') and send it in the X-API-Key header.

Keep the key out of source code and git. Anyone with the built app can read it. We checked with a made-up key and found it as plain text in our iOS release build. If you also build for the web, leave the key off the web build command. Have the web app call your own server, which holds the key and calls exerciseapi.dev.

In the Flutter 3.50.1 template, debug and profile builds already have Android internet permission. For an Android release, add <uses-permission android:name="android.permission.INTERNET"/> inside the manifest element in android/app/src/main/AndroidManifest.xml.

What to show when someone taps

Open the steps and form tips from the saved row. The same record includes common mistakes, safety notes and variations. If a saved workout or link gives you only an id, fetch /v1/exercises/:id. Use the id from an API response. Building it from the name can give you the wrong id.

333 of our 2,200 exercises have a video. In Dart, check videos.isNotEmpty before showing a player. Otherwise, show the steps and tips. Add hasVideo=true to the query if every result needs a demo.

How long to keep a list

Use jsonEncode to turn the exercise data and the time you fetched it into one string. Save that string with shared_preferences, using the request URL as the storage key. That gives each search or page its own saved copy.

Under 24 hours, show the copy without a call. Once the copy is 24 hours old, show it right away and fetch a fresh copy in the background. Offline, you may show a copy up to 30 days old. Remove older copies, even offline. Fetch a fresh copy before showing the data again. Use the same rule for /v1/categories, /v1/muscles and /v1/equipment. Those lists change even less often.

What we checked

On December 2, 2026, we built a Flutter 3.50.1 app with http and shared_preferences. We tested it against the live API on an iPhone simulator running iOS 26. We didn’t test Android.

The first open returned 20 exercises in one call. We tapped the first row and its saved steps opened without another call. Opening the saved list again took zero calls. When we marked the list 25 hours old, it opened right away while one background call refreshed it.

With calls switched off in code, the 29-day copy still opened. The app removed the 31-day copy and showed the list again only after we switched calls back on. The id lookup worked, and all three reference lists loaded. The whole test took seven calls.

Get your first 20 exercises

Your free account gets 100 requests a day. Every phone with your app installed shares that limit. Exercise searches return up to 20 results per page, and you can page through the first 500 results of each query. Get a free key from exerciseapi.dev without a card, then send this request with your key in the X-API-Key header.

GET https://api.exerciseapi.dev/v1/exercises?category=strength&limit=20&offset=0