How do I build exercise search that handles typos?
Send what someone types as q to exerciseapi.dev. If the search comes back empty, try fewer words or let the person browse by muscle.
Send what the person typed
Your search box can find bench press exercises when someone types benchpress, without a fuzzy index of your own. Send the text as q to GET /v1/exercises. Keep the spelling as typed and URL-encode the text so a space becomes %20. Show the results in the order they come back. The API puts the best match first unless you set random=true, so leave that off.
GET https://api.exerciseapi.dev/v1/exercises?q=benchpress
What came back
When we ran it on December 2, 2026, benchpress returned 13 records. Twelve were bench press variants, including Dumbbell_Bench_Press and Machine_Bench_Press. Bent_Press came second because its name shares some of the same letters. Adding category=strength and muscle=chest narrowed the list to eight bench press variants.
For dumbell curl, the first three results were Dumbbell_Bicep_Curl, Dumbbell_Wrist_Curl and Dumbbell_Hammer_Curl. For romanian dedlift, Romanian_Deadlift came first. But sqaut came back empty. Changing it to squat worked.
Help someone who gets no matches
For close spellings, q compares groups of three letters with the whole exercise name and the keywords. Swapping two letters in a short word like squat leaves too few groups in common. Adding a filter to q=sqaut still returns nothing because each exercise must match both the text and the filter. When the person browses by muscle or equipment, leave q out and start at offset=0, for example GET /v1/exercises?muscle=chest&offset=0.
A longer search can miss for a different reason. To match by word, the API needs to find all the search words across the name, keywords, primary muscles or equipment. Keywords include other names people use, such as back squat for Barbell_Squat. If a longer search comes back empty, try dropping the last word or removing a filter.
Wait for a pause
Wait about 250 milliseconds after the last keystroke before sending. Skip the request when the box is empty because q takes 1 to 200 characters. Use a result only if it matches the text and filters on screen now. If the person clears the box while a search is running, ignore its result.
Show no matches only after a successful response with an empty data array on the first page. The total is null for every text search. If the request fails, show an error. On Free, each account gets 60 requests a minute and 100 a day. On a 429, wait for the time in the Retry-After header before trying again.
Try it with a free key
Get a free key from exerciseapi.dev and try the benchpress request with your key in the X-API-Key header. For a browser app, send the request through your own server so the key stays there. No card required.