📌 Image
Streams an animated GIF file representing the selected exercise at a specific resolution.
This endpoint returns a GIF for a given exerciseId and resolution. The available resolution depends on the user's subscription tier.
Request
Method: GET
URL: https://exercisedb.p.rapidapi.com/image
🔐 Authentication
- Query parameter:
?rapidapi-key=YOUR_API_KEY - OR request header:
X-RapidAPI-Key: YOUR_API_KEY
🔸 Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
exerciseId | query | string | true | The ID of the exercise to retrieve the GIF for |
resolution | query | enum | true | Must be one of: 180, 360, 720, 1080 (in pixels) |
rapidapi-key | query | string | false | RapidAPI API key |
💻 Example Request
import React from "react";
const ExerciseImage: React.FC<{ exerciseId: string }> = ({ exerciseId }) => {
const apiKey = "YOUR_API_KEY"; // Replace with your actual RapidAPI key
const resolution = "360"; // Adjust based on your user's plan
const imageUrl = `https://exercisedb.p.rapidapi.com/image?exerciseId=${exerciseId}&resolution=${resolution}&rapidapi-key=${apiKey}`;
return (
<img
src={imageUrl}
alt="Exercise animation"
width={resolution}
height="auto"
style={{ borderRadius: "8px" }}
/>
);
};
export default ExerciseImage;
Response
200
- The endpoint returns a streamed GIF image.
- The response is not JSON.
- The
Content-Typeheader is always set toimage/gif. - This endpoint is optimized for direct use in
<img>tags or client-rendered previews.
📝 Notes
- All images returned by this endpoint are in GIF format.
- Subscription tier access:
- BASIC → access to
180resolution only - PRO → access to
180and360resolutions - ULTRA and MEGA → access to all four resolutions:
180,360,720, and1080
- BASIC → access to
- If a resolution higher than the user's tier is requested, the response defaults to the highest resolution allowed for their plan.
- A
422 Unprocessable Entityerror is returned if:exerciseIdis missing or invalidresolutionis missing or not one of the accepted values
- A
500 Internal Server Erroris returned if:- The image does not exist for the given parameters
- There is a server-side issue retrieving the image
- It is highly recommended to use this endpoint client-side by passing the
rapidapi-keyas a query parameter within an<img>tag or similar component to ensure smooth streaming and fast rendering.