curl --request GET \
--url https://api.example.com/exercises{
"totalExercises": 123,
"totalPages": 123,
"data": [
{
"name": "<string>",
"title": "<string>",
"target": "<string>",
"muscles_worked": "<string>",
"bodyPart": "<string>",
"equipment": "<string>",
"id": "<string>",
"id_": "<string>",
"blog": "<string>",
"images": [
"<string>"
],
"gifUrl": "<string>",
"videos": [
"<string>"
],
"keywords": [
"<string>"
]
}
]
}Retrieve a paginated list of exercises with filtering options
curl --request GET \
--url https://api.example.com/exercises{
"totalExercises": 123,
"totalPages": 123,
"data": [
{
"name": "<string>",
"title": "<string>",
"target": "<string>",
"muscles_worked": "<string>",
"bodyPart": "<string>",
"equipment": "<string>",
"id": "<string>",
"id_": "<string>",
"blog": "<string>",
"images": [
"<string>"
],
"gifUrl": "<string>",
"videos": [
"<string>"
],
"keywords": [
"<string>"
]
}
]
}GET /api/exercises
Show Exercise Object
curl -X GET "https://api.bodyworks.com/api/exercises?limit=10&page=1"
import axios from 'axios';
const getExercises = async (limit = 10, page = 1) => {
const response = await axios.get('/api/exercises', {
params: {
limit,
page
}
});
return response.data;
};
// Usage
const exercises = await getExercises(10, 1);
const getExercises = async (limit = 10, page = 1) => {
const response = await fetch(
`/api/exercises?limit=${limit}&page=${page}`
);
const data = await response.json();
return data;
};
// Usage
const exercises = await getExercises(10, 1);
{
"totalExercises": 1324,
"totalPages": 133,
"data": [
{
"name": "barbell-bench-press",
"title": "Barbell Bench Press",
"target": "pectorals",
"muscles_worked": "chest, triceps, shoulders",
"bodyPart": "chest",
"equipment": "barbell",
"id": "ex_001",
"id_": "001",
"blog": "https://bodyworks.com/blog/bench-press-guide",
"images": [
"https://cdn.bodyworks.com/exercises/bench-press-1.jpg",
"https://cdn.bodyworks.com/exercises/bench-press-2.jpg"
],
"gifUrl": "https://cdn.bodyworks.com/exercises/bench-press.gif",
"videos": [
"https://youtube.com/watch?v=example1"
],
"keywords": [
"chest",
"barbell",
"compound",
"strength"
]
},
{
"name": "squat",
"title": "Barbell Squat",
"target": "quadriceps",
"muscles_worked": "quads, glutes, hamstrings, core",
"bodyPart": "legs",
"equipment": "barbell",
"id": "ex_002",
"id_": "002",
"blog": "https://bodyworks.com/blog/squat-guide",
"images": [
"https://cdn.bodyworks.com/exercises/squat-1.jpg",
"https://cdn.bodyworks.com/exercises/squat-2.jpg"
],
"gifUrl": "https://cdn.bodyworks.com/exercises/squat.gif",
"videos": [
"https://youtube.com/watch?v=example2"
],
"keywords": [
"legs",
"barbell",
"compound",
"strength"
]
}
]
}
{
"error": "Invalid pagination parameters",
"message": "Limit and page must be positive integers"
}
{
"error": "Internal server error",
"message": "Failed to fetch exercises from database"
}