### GET /workouts/push Source: https://api.musclewiki.com/documentation/index Get a pre-defined 'push' workout routine. This routine typically includes exercises that target pushing movements. ```APIDOC ## GET /workouts/push ### Description Get a pre-defined 'push' workout routine. This routine typically includes exercises that target pushing movements. ### Method GET ### Endpoint /workouts/push ### Response #### Success Response (200) - **Array of exercise objects** that constitute a 'push' workout. #### Response Example ```json [ { "id": 10, "name": "Bench Press", "category": "barbell", "muscles": ["chest", "triceps", "shoulders"], "difficulty": "intermediate" }, { "id": 15, "name": "Overhead Press", "category": "barbell", "muscles": ["shoulders", "triceps"], "difficulty": "intermediate" } ] ``` ``` -------------------------------- ### GET /statistics Source: https://api.musclewiki.com/documentation/index Get comprehensive database statistics including exercise counts, category breakdown, difficulty distribution, and more. ```APIDOC ## GET /statistics ### Description Get comprehensive database statistics including exercise counts, category breakdown, difficulty distribution, and more. Use Case: Display database statistics, build dynamic filter UIs, show available content. ### Method GET ### Endpoint /statistics ### Response #### Success Response (200) - **Object containing various statistics** about the exercise database. #### Response Example ```json { "total_exercises": 1832, "total_categories": 15, "total_muscles": 10, "difficulty_distribution": { "novice": 500, "intermediate": 800, "advanced": 532 }, "force_type_distribution": { "push": 900, "pull": 700, "static": 232 } } ``` ``` -------------------------------- ### GET /search Source: https://api.musclewiki.com/documentation/index Searches for exercises based on a query string. ```APIDOC ## GET /search ### Description Searches for exercises based on a query string. This endpoint is useful for finding exercises when you don't know the exact name or category. ### Method GET ### Endpoint /search ### Parameters #### Query Parameters - **q** (string) - Required - The search query string. - **limit** (integer) - Optional - Number of search results to return per page. Defaults to 10. ### Request Example ``` GET /search?q=curl&limit=5 ``` ### Response #### Success Response (200) - **total** (integer) - Total number of exercises matching the search query. - **results** (array) - An array of exercise objects, similar to the `/exercises` endpoint (Standard Response). #### Response Example ```json { "total": 25, "results": [ { "id": 15, "name": "Dumbbell Bicep Curl", "primary_muscles": ["Biceps"], "category": "dumbbell", "force": "push", "grips": ["neutral"], "mechanic": "isolation", "difficulty": "novice", "steps": "Stand with a dumbbell in each hand...", "videos": [ { "url": "https://example.com/bicep_curl.mp4" } ] } ] } ``` ``` -------------------------------- ### GET /exercises Source: https://api.musclewiki.com/documentation/index List exercises with pagination and optional filtering. Returns minimal information optimized for list views. ```APIDOC ## GET /exercises ### Description List exercises with pagination and optional filtering. Returns minimal information optimized for list views. ### Method GET ### Endpoint /exercises ### Query Parameters - **limit** (integer) - Optional - Maximum results to return (1-100, default: 20) - **offset** (integer) - Optional - Number of results to skip (default: 0) - **search** (string) - Optional - Search in exercise names and steps (min 2 characters) - **gender** (string) - Optional - Filter videos by gender (male or female) - **category** (string) - Optional - Filter by equipment category (e.g., barbell, dumbbell) - **muscles** (string) - Optional - Filter by muscle groups (e.g., Biceps, Chest) - **difficulty** (string) - Optional - Filter by difficulty (novice, intermediate, advanced) - **force** (string) - Optional - Filter by force type (push, pull, static) - **mechanic** (string) - Optional - Filter by mechanic (isolation, compound) - **grips** (string) - Optional - Filter by grip types (e.g., Overhand, Underhand) ### Request Example ``` GET /exercises?limit=5&category=barbell&difficulty=intermediate ``` ### Response #### Success Response (200) - **Array of exercise objects**, each containing minimal information suitable for list views. #### Response Example ```json [ { "id": 1, "name": "Barbell Curl", "description": "A classic bicep exercise.", "category": "barbell", "muscles": ["biceps"], "difficulty": "novice" } ] ``` ``` -------------------------------- ### GET /exercises Source: https://api.musclewiki.com/documentation/index Retrieves a list of exercises. Supports filtering by category, muscle, difficulty, and pagination. ```APIDOC ## GET /exercises ### Description Retrieves a list of exercises. Supports filtering by category, muscle, difficulty, and pagination. ### Method GET ### Endpoint /exercises ### Parameters #### Query Parameters - **category** (string) - Optional - Filter exercises by equipment type (e.g., 'barbell', 'dumbbell'). - **muscles** (string) - Optional - Filter exercises by targeted muscle group (e.g., 'Biceps', 'Chest'). - **difficulty** (string) - Optional - Filter exercises by difficulty level (e.g., 'Novice', 'Intermediate', 'Advanced'). - **limit** (integer) - Optional - Number of exercises to return per page. Defaults to 20. - **offset** (integer) - Optional - Number of exercises to skip for pagination. Defaults to 0. - **detail** (boolean) - Optional - If true, returns a detailed response including video_count and step_count. Defaults to false. ### Request Example ``` GET /exercises?category=barbell&limit=20&difficulty=intermediate ``` ### Response #### Success Response (200) - **total** (integer) - Total number of exercises matching the query. - **results** (array) - An array of exercise objects. The structure of each object depends on the `detail` query parameter (Minimal, Standard, or Detailed Response). #### Response Example (Standard Response) ```json { "total": 150, "results": [ { "id": 1, "name": "Barbell Bench Press", "primary_muscles": ["Chest", "Triceps", "Shoulders"], "category": "barbell", "force": "push", "grips": ["flat", "wide"], "mechanic": "compound", "difficulty": "intermediate", "steps": "Lie on a flat bench...", "videos": [ { "url": "https://example.com/video1.mp4" } ] } ] } ``` ``` -------------------------------- ### GET /search Source: https://api.musclewiki.com/documentation/index Perform a full-text search across exercise names and steps with relevance scoring. ```APIDOC ## GET /search ### Description Perform a full-text search across exercise names and steps with relevance scoring. ### Method GET ### Endpoint /search ### Query Parameters - **query** (string) - Required - The search term (min 2 characters) - **limit** (integer) - Optional - Maximum results to return (1-100, default: 20) - **offset** (integer) - Optional - Number of results to skip (default: 0) ### Request Example ``` GET /search?query=bench press&limit=10 ``` ### Response #### Success Response (200) - **Array of exercise objects** matching the search query, ordered by relevance. #### Response Example ```json [ { "id": 5, "name": "Barbell Bench Press", "description": "A compound exercise targeting the chest, shoulders, and triceps.", "category": "barbell", "muscles": ["chest", "triceps", "shoulders"], "difficulty": "intermediate" } ] ``` ``` -------------------------------- ### GET /random Source: https://api.musclewiki.com/documentation/index Get a random exercise from the database. Useful for workout generators or introducing variety. ```APIDOC ## GET /random ### Description Get a random exercise from the database. Useful for workout generators or introducing variety. ### Method GET ### Endpoint /random ### Response #### Success Response (200) - **Exercise object** representing a random exercise from the database. #### Response Example ```json { "id": 42, "name": "Pull-up", "description": "An upper body exercise targeting the back and biceps.", "category": "bodyweight", "muscles": ["back", "biceps"], "difficulty": "intermediate" } ``` ``` -------------------------------- ### GET /filters Source: https://api.musclewiki.com/documentation/index Get all available filter values for building dynamic UIs. This endpoint provides comprehensive options for creating filter interfaces. ```APIDOC ## GET /filters ### Description Get all available filter values for building dynamic UIs. Use Case: Build comprehensive filter interfaces with all available options. ### Method GET ### Endpoint /filters ### Response #### Success Response (200) - **Object containing all filterable fields** and their available values (e.g., difficulty, force, mechanic, grips, etc.). #### Response Example ```json { "difficulty": ["novice", "intermediate", "advanced"], "force": ["push", "pull", "static"], "mechanic": ["isolation", "compound"], "grips": ["overhand", "underhand", "neutral"] } ``` ``` -------------------------------- ### GET /categories Source: https://api.musclewiki.com/documentation/index Retrieves a list of available exercise categories (equipment types). ```APIDOC ## GET /categories ### Description Retrieves a list of available exercise categories, such as 'barbell', 'dumbbell', 'machine', 'bodyweight', etc. This endpoint provides metadata that can be used to filter exercises. ### Method GET ### Endpoint /categories ### Parameters None ### Request Example ``` GET /categories ``` ### Response #### Success Response (200) - **categories** (array) - An array of strings, where each string is a unique exercise category. #### Response Example ```json { "categories": [ "barbell", "dumbbell", "machine", "kettlebell", "bodyweight", "cable" ] } ``` ``` -------------------------------- ### GET /exercises/{id} Source: https://api.musclewiki.com/documentation/index Fetch a specific exercise by its ID, including detailed information and video URLs. ```APIDOC ## GET /exercises/{id} ### Description Fetch a specific exercise by its ID, including detailed information and video URLs. ### Method GET ### Endpoint /exercises/{id} ### Path Parameters - **id** (integer) - Required - The unique identifier of the exercise ### Request Example ``` GET /exercises/0 ``` ### Response #### Success Response (200) - **Exercise object** with full details, including video URLs. #### Response Example ```json { "id": 0, "name": "Barbell Curl", "description": "Targets the biceps brachii. Stand with feet shoulder-width apart, holding a barbell with an underhand grip. Curl the barbell up towards your shoulders, keeping your elbows tucked in. Slowly lower the barbell back to the starting position.", "category": "barbell", "muscles": ["biceps"], "difficulty": "novice", "force": "pull", "mechanic": "isolation", "equipment": "barbell", "gender_specific_videos": { "male": "https://cdn.musclewiki.com/videos/male/barbell-curl.mp4", "female": "https://cdn.musclewiki.com/videos/female/barbell-curl.mp4" }, "video_urls": { "front": "https://cdn.musclewiki.com/videos/front/barbell-curl.mp4", "side": "https://cdn.musclewiki.com/videos/side/barbell-curl.mp4" } } ``` ``` -------------------------------- ### Make Your First API Request with cURL Source: https://api.musclewiki.com/documentation/index This example demonstrates how to make your first authenticated request to the MuscleWiki API using cURL to fetch exercise data. Ensure you replace 'YOUR_API_KEY' with your actual API key obtained from the dashboard. This request retrieves details for a specific exercise. ```curl curl --request GET \ --url 'https://api.musclewiki.com/exercises/0' \ --header 'X-API-Key: YOUR_API_KEY' ``` -------------------------------- ### GET /random Source: https://api.musclewiki.com/documentation/index Retrieves a random exercise. Can be filtered by category. ```APIDOC ## GET /random ### Description Retrieves a random exercise. This endpoint is useful for generating workout ideas or adding variety to routines. You can optionally filter by category. ### Method GET ### Endpoint /random ### Parameters #### Query Parameters - **category** (string) - Optional - Filter the random exercise by equipment type (e.g., 'bodyweight', 'machine'). ### Request Example ``` GET /random?category=bodyweight ``` ### Response #### Success Response (200) - Returns a single exercise object in the Standard Response format. #### Response Example ```json { "id": 78, "name": "Push-up", "primary_muscles": ["Chest", "Triceps", "Shoulders"], "category": "bodyweight", "force": "push", "grips": ["wide", "neutral"], "mechanic": "compound", "difficulty": "intermediate", "steps": "1. Place your hands on the floor...", "videos": [ { "url": "https://example.com/pushup.mp4" } ] } ``` ``` -------------------------------- ### Example API Response (Success) Source: https://api.musclewiki.com/documentation/index Demonstrates a typical successful response from a paginated list endpoint. It includes total results, requested limit, current offset, and the number of items in the current response, along with a minimal list of exercise objects. ```json { "total": 45, // Total exercises matching filters "limit": 5, // Requested limit "offset": 0, // Current offset "count": 5, // Number of results in this response "results": [ // Array of exercise objects (minimal format) {"id": 0, "name": "Barbell Curl"}, {"id": 15, "name": "Barbell Bench Press"}, {"id": 23, "name": "Barbell Squat"} ] } ``` -------------------------------- ### Get Push Workout Exercises Source: https://api.musclewiki.com/documentation/index Retrieve a list of exercises specifically targeting push movements. Ideal for building 'push day' workout routines. ```APIDOC ## GET /workouts/push ### Description Get exercises with push force type. Perfect for building push workout routines. ### Method GET ### Endpoint `/workouts/push` ### Response #### Success Response (200) - **total** (integer) - Total exercises matching filters. - **limit** (integer) - Requested limit. - **offset** (integer) - Current offset. - **count** (integer) - Number of results in this response. - **results** (array) - An array of exercise objects. #### Response Example ```json { "total": 45, "limit": 5, "offset": 0, "count": 5, "results": [ {"id": 0, "name": "Barbell Bench Press"}, {"id": 1, "name": "Incline Dumbbell Press"}, {"id": 2, "name": "Overhead Press"} ] } ``` ``` -------------------------------- ### GET /workouts/pull Source: https://api.musclewiki.com/documentation/index Get a pre-defined 'pull' workout routine. This routine typically includes exercises that target pulling movements. ```APIDOC ## GET /workouts/pull ### Description Get a pre-defined 'pull' workout routine. This routine typically includes exercises that target pulling movements. ### Method GET ### Endpoint /workouts/pull ### Response #### Success Response (200) - **Array of exercise objects** that constitute a 'pull' workout. #### Response Example ```json [ { "id": 20, "name": "Deadlift", "category": "barbell", "muscles": ["back", "glutes", "hamstrings"], "difficulty": "advanced" }, { "id": 25, "name": "Barbell Row", "category": "barbell", "muscles": ["back", "biceps"], "difficulty": "intermediate" } ] ``` ``` -------------------------------- ### GET /stream/videos/branded/{video_name} Source: https://api.musclewiki.com/documentation/index Streams a branded video of an exercise. ```APIDOC ## GET /stream/videos/branded/{video_name} ### Description Streams a branded video demonstration for a specific exercise. Use this endpoint to embed exercise videos directly into your application. ### Method GET ### Endpoint /stream/videos/branded/{video_name} ### Parameters #### Path Parameters - **video_name** (string) - Required - The name of the video file (e.g., 'male-Barbell-barbell-curl-front.mp4'). ### Request Example ``` curl --request GET \ --url 'https://api.musclewiki.com/stream/videos/branded/male-Barbell-barbell-curl-front.mp4' \ --header 'X-API-Key: YOUR_API_KEY' \ --output video.mp4 ``` ### Response #### Success Response (200) - Returns the video file content. #### Error Response (404) - If the video file is not found. ``` -------------------------------- ### GET /stream/images/og_images/{image_name} Source: https://api.musclewiki.com/documentation/index Streams an OG image for an exercise. ```APIDOC ## GET /stream/images/og_images/{image_name} ### Description Streams an Open Graph (OG) image, typically used for social media sharing previews, for a specific exercise. ### Method GET ### Endpoint /stream/images/og_images/{image_name} ### Parameters #### Path Parameters - **image_name** (string) - Required - The name of the OG image file (e.g., 'og-male-Barbell-barbell-curl-front.jpg'). ### Request Example ``` curl --request GET \ --url 'https://api.musclewiki.com/stream/images/og_images/og-male-Barbell-barbell-curl-front.jpg' \ --header 'X-API-Key: YOUR_API_KEY' \ --output og-image.jpg ``` ### Response #### Success Response (200) - Returns the image file content. #### Error Response (404) - If the image file is not found. ``` -------------------------------- ### GET /exercises/{id} Source: https://api.musclewiki.com/documentation/index Retrieves details for a specific exercise by its ID. ```APIDOC ## GET /exercises/{id} ### Description Retrieves details for a specific exercise by its ID. You can request a more detailed response by adding the `detail=true` query parameter. ### Method GET ### Endpoint /exercises/{id} ### Parameters #### Path Parameters - **id** (integer) - Required - The unique identifier of the exercise. #### Query Parameters - **detail** (boolean) - Optional - If true, returns a detailed response including video_count and step_count. Defaults to false. ### Request Example ``` GET /exercises/0?detail=true ``` ### Response #### Success Response (200) - **id** (integer) - Exercise identifier. - **name** (string) - Exercise name. - **primary_muscles** (array) - Targeted muscle groups. - **category** (string) - Equipment type. - **force** (string) - Push/Pull/Static (may be null). - **grips** (array) - Grip types used. - **mechanic** (string) - Isolation/Compound (may be null). - **difficulty** (string) - Novice/Intermediate/Advanced (may be null). - **steps** (string) - Step-by-step instructions. - **videos** (array) - Video demonstrations with URLs. - **video_count** (integer) - Total number of videos (only if `detail=true`). - **step_count** (integer) - Total number of instruction steps (only if `detail=true`). #### Response Example (Detailed Response) ```json { "id": 0, "name": "Barbell Back Squat", "primary_muscles": ["Quadriceps", "Glutes", "Hamstrings"], "category": "barbell", "force": "push", "grips": ["medium"], "mechanic": "compound", "difficulty": "intermediate", "steps": "1. Stand with your feet shoulder-width apart...", "videos": [ { "url": "https://example.com/squat_video.mp4" } ], "video_count": 5, "step_count": 7 } ``` ``` -------------------------------- ### GET /categories Source: https://api.musclewiki.com/documentation/index List all equipment categories with exercise counts. This endpoint is useful for building category filters and displaying available equipment types. ```APIDOC ## GET /categories ### Description List all equipment categories with exercise counts. Use Case: Build category filters, show available equipment types. ### Method GET ### Endpoint /categories ### Response #### Success Response (200) - **Array of category objects**, each containing: - **name** (string) - The internal name of the category - **display_name** (string) - The user-friendly display name of the category - **count** (integer) - The number of exercises in this category #### Response Example ```json [ {"name": "barbell", "display_name": "Barbell", "count": 150}, {"name": "dumbbell", "display_name": "Dumbbell", "count": 200}, {"name": "bodyweight", "display_name": "Bodyweight", "count": 180} ] ``` ``` -------------------------------- ### GET /workouts/{type} Source: https://api.musclewiki.com/documentation/index Retrieves a list of exercises for a specific workout type (e.g., push, pull). ```APIDOC ## GET /workouts/{type} ### Description Retrieves a list of exercises categorized by workout type, such as 'push' or 'pull'. This is useful for creating balanced workout routines. ### Method GET ### Endpoint /workouts/{type} ### Parameters #### Path Parameters - **type** (string) - Required - The type of workout to retrieve (e.g., 'push', 'pull'). #### Query Parameters - **difficulty** (string) - Optional - Filter exercises by difficulty level (e.g., 'Novice', 'Intermediate', 'Advanced'). - **limit** (integer) - Optional - Number of exercises to return. Defaults to 5. ### Request Example ``` GET /workouts/push?difficulty=intermediate&limit=5 ``` ### Response #### Success Response (200) - **exercises** (array) - An array of exercise objects in the Standard Response format, matching the specified workout type and difficulty. #### Response Example ```json { "exercises": [ { "id": 1, "name": "Barbell Bench Press", "primary_muscles": ["Chest", "Triceps", "Shoulders"], "category": "barbell", "force": "push", "grips": ["flat", "wide"], "mechanic": "compound", "difficulty": "intermediate", "steps": "Lie on a flat bench...", "videos": [ { "url": "https://example.com/video1.mp4" } ] } ] } ``` ``` -------------------------------- ### Get Pull Workout Exercises Source: https://api.musclewiki.com/documentation/index Retrieve a list of exercises specifically targeting pull movements. Ideal for building 'pull day' workout routines. ```APIDOC ## GET /workouts/pull ### Description Get exercises with pull force type. Perfect for building pull workout routines. ### Method GET ### Endpoint `/workouts/pull` ### Response #### Success Response (200) - **total** (integer) - Total exercises matching filters. - **limit** (integer) - Requested limit. - **offset** (integer) - Current offset. - **count** (integer) - Number of results in this response. - **results** (array) - An array of exercise objects. #### Response Example ```json { "total": 45, "limit": 5, "offset": 0, "count": 5, "results": [ {"id": 10, "name": "Barbell Row"}, {"id": 11, "name": "Pull-up"}, {"id": 12, "name": "Lat Pulldown"} ] } ``` ``` -------------------------------- ### GET /muscles Source: https://api.musclewiki.com/documentation/index Retrieves a list of available primary muscle groups. ```APIDOC ## GET /muscles ### Description Retrieves a list of all primary muscle groups that exercises target. This can be used to build muscle-specific workout plans. ### Method GET ### Endpoint /muscles ### Parameters None ### Request Example ``` GET /muscles ``` ### Response #### Success Response (200) - **muscles** (array) - An array of strings, where each string is a unique muscle group. #### Response Example ```json { "muscles": [ "Chest", "Back", "Legs", "Shoulders", "Biceps", "Triceps", "Core" ] } ``` ``` -------------------------------- ### Get Basic API Information Source: https://api.musclewiki.com/documentation/index This endpoint provides basic information about the MuscleWiki API, including its name, version, and available documentation and OpenAPI endpoints. It's useful for understanding the API's structure and capabilities at a glance. ```json { "name": "MuscleWiki API", "version": "2.0.0", "docs": "/docs", "openapi": "/openapi.json", "health": "/health", "endpoints": { "exercises": "/exercises", "search": "/search", "random": "/random", "categories": "/categories", "muscles": "/muscles", "filters": "/filters", "statistics": "/statistics", "workouts": { "push": "/workouts/push", "pull": "/workouts/pull" } } } ``` -------------------------------- ### Get Exercise Details Source: https://api.musclewiki.com/documentation/index Retrieve detailed information for a specific exercise by its ID. Supports optional query parameters for detail level and gender filtering. ```APIDOC ## GET /exercises/{exercise_id} ### Description Get detailed information for a specific exercise by ID. Supports optional query parameters for detail level and gender filtering. ### Method GET ### Endpoint `/exercises/{exercise_id}` ### Parameters #### Path Parameters - **exercise_id** (integer) - Required - Exercise ID (0-based index) #### Query Parameters - **detail** (boolean) - Optional - Return detailed info (default: false) - **gender** (string) - Optional - Filter videos by gender ### Response #### Success Response (200) - **id** (integer) - The unique identifier for the exercise. - **name** (string) - The name of the exercise. - **videos** (array) - A list of video objects associated with the exercise. - **steps** (array) - A list of step-by-step instructions for performing the exercise. - **equipment** (array) - A list of equipment required for the exercise. - **muscles** (array) - A list of muscles targeted by the exercise. - **instructions** (string) - Detailed instructions for the exercise. - **video_count** (integer) - Count of associated videos (only if `detail=true`). - **step_count** (integer) - Count of associated steps (only if `detail=true`). #### Response Example (Standard) ```json { "id": 0, "name": "Barbell Curl", "videos": [ { "title": "Barbell Curl", "url": "/stream/videos/branded/male-Barbell-barbell-curl-front.mp4" } ], "steps": [ "Stand with your feet shoulder-width apart.", "Hold a barbell with an underhand grip..." ], "equipment": ["Barbell"], "muscles": ["Biceps"], "instructions": "Stand with your feet shoulder-width apart...", "video_count": 1, "step_count": 5 } ``` #### Response Example (Detailed) ```json { "id": 0, "name": "Barbell Curl", "videos": [ { "title": "Barbell Curl", "url": "/stream/videos/branded/male-Barbell-barbell-curl-front.mp4" } ], "steps": [ "Stand with your feet shoulder-width apart.", "Hold a barbell with an underhand grip..." ], "equipment": ["Barbell"], "muscles": ["Biceps"], "instructions": "Stand with your feet shoulder-width apart...", "video_count": 1, "step_count": 5 } ``` ``` -------------------------------- ### Get Exercise Videos Source: https://api.musclewiki.com/documentation/index Retrieve only the video URLs for a specific exercise. This endpoint is optimized to reduce bandwidth by excluding other exercise data. ```APIDOC ## GET /exercises/{exercise_id}/videos ### Description Get only video URLs for a specific exercise. Optimized endpoint that reduces bandwidth by excluding other exercise data. ### Method GET ### Endpoint `/exercises/{exercise_id}/videos` ### Parameters #### Path Parameters - **exercise_id** (integer) - Required - Exercise ID (0-based index) ### Response #### Success Response (200) - **videos** (array) - An array of video objects, each containing a title and URL. #### Response Example ```json { "videos": [ { "title": "Barbell Curl", "url": "/stream/videos/branded/male-Barbell-barbell-curl-front.mp4" } ] } ``` ``` -------------------------------- ### Get Exercise Videos by ID (HTTP Request) Source: https://api.musclewiki.com/documentation/index Fetches only the video URLs for a specific exercise. This endpoint is optimized to reduce bandwidth by excluding other exercise data, making it suitable for video-only display features. ```http GET /exercises/{exercise_id}/videos ``` -------------------------------- ### Get Push Force Exercises (HTTP Request) Source: https://api.musclewiki.com/documentation/index Fetches exercises categorized by their 'push' force type. This is useful for constructing push-focused workout routines and organizing exercises by movement patterns. ```http GET /workouts/push ``` -------------------------------- ### GET /health Source: https://api.musclewiki.com/documentation/index Check API health status and database statistics. This endpoint is useful for verifying API availability before making other requests. ```APIDOC ## GET /health ### Description Check API health status and database statistics. Use Case: Verify API availability before making requests. ### Method GET ### Endpoint /health ### Response #### Success Response (200) - **status** (string) - API health status (e.g., "healthy") - **version** (string) - API version - **exercises_loaded** (integer) - Number of exercises loaded in the database #### Response Example ```json { "status": "healthy", "version": "2.0.0", "exercises_loaded": 1832 } ``` ``` -------------------------------- ### Get Exercise Details by ID (HTTP Request) Source: https://api.musclewiki.com/documentation/index Retrieves detailed information for a specific exercise using its ID. Supports query parameters for additional details and filtering by gender. The response format varies based on the 'detail' parameter. ```http GET /exercises/{exercise_id}?detail=true&gender=male ``` -------------------------------- ### Get Random Exercise Source: https://api.musclewiki.com/documentation/index Retrieve a random exercise. Optionally, you can filter the random exercise by a specific category. ```APIDOC ## GET /random ### Description Get a random exercise, optionally filtered by category. Perfect for "try something new" features. ### Method GET ### Endpoint `/random` ### Parameters #### Query Parameters - **category** (string) - Optional - Filter the random exercise by a specific category (e.g., 'Chest', 'Legs'). ### Response #### Success Response (200) - **id** (integer) - The unique identifier for the exercise. - **name** (string) - The name of the exercise. #### Response Example ```json { "id": 10, "name": "Dumbbell Flyes" } ``` ``` -------------------------------- ### GET /muscles Source: https://api.musclewiki.com/documentation/index List all primary muscle groups with exercise counts. This endpoint is useful for building muscle group filters and displaying muscle targeting options. ```APIDOC ## GET /muscles ### Description List all primary muscle groups with exercise counts. Use Case: Build muscle group filters, display muscle targeting options. ### Method GET ### Endpoint /muscles ### Response #### Success Response (200) - **Array of muscle objects**, each containing: - **name** (string) - The internal name of the muscle group - **display_name** (string) - The user-friendly display name of the muscle group - **count** (integer) - The number of exercises targeting this muscle group #### Response Example ```json [ {"name": "biceps", "display_name": "Biceps", "count": 120}, {"name": "chest", "display_name": "Chest", "count": 150}, {"name": "quadriceps", "display_name": "Quadriceps", "count": 100} ] ``` ``` -------------------------------- ### Get Random Exercise (HTTP Request) Source: https://api.musclewiki.com/documentation/index Retrieves a random exercise, with an option to filter by category. This endpoint is ideal for features that encourage users to try new exercises or generate workout variations. ```http GET /random?category=chest ``` -------------------------------- ### Get Pull Force Exercises (HTTP Request) Source: https://api.musclewiki.com/documentation/index Retrieves exercises categorized by their 'pull' force type. This endpoint is designed for building pull workout routines and filtering exercises based on movement patterns. ```http GET /workouts/pull ``` -------------------------------- ### Fetch Exercises with Python Source: https://api.musclewiki.com/documentation/index This Python script demonstrates how to fetch a list of exercises from the MuscleWiki API using the 'requests' library. It includes setting headers for authentication, defining query parameters, and processing the JSON response to display exercise names and IDs. ```python import requests url = "https://api.musclewiki.com/exercises" headers = { "X-API-Key": "YOUR_API_KEY" } params = { "limit": 10, "category": "barbell" } response = requests.get(url, headers=headers, params=params) exercises = response.json() print(f"Total exercises: {exercises['total']}") for exercise in exercises['results']: print(f"- {exercise['name']} (ID: {exercise['id']})") ``` -------------------------------- ### Search Exercises with JavaScript Source: https://api.musclewiki.com/documentation/index This JavaScript code snippet shows how to search for exercises using the 'fetch' API. It constructs the request URL with search query and limit, sets the necessary headers, and handles the JSON response or any potential errors. ```javascript const url = 'https://api.musclewiki.com/search?q=curl&limit=5'; const options = { method: 'GET', headers: { 'X-API-Key': 'YOUR_API_KEY' } }; try { const response = await fetch(url, options); const result = await response.json(); console.log(result); } catch (error) { console.error(error); } ``` -------------------------------- ### Search Exercises by Text Query (HTTP Request) Source: https://api.musclewiki.com/documentation/index Searches for exercises based on a text query, with results scored by relevance. The search considers exercise names and instruction steps, offering word-order independent matching and prioritizing exact matches. ```http GET /search?q=curl&limit=5&difficulty=intermediate ``` -------------------------------- ### Search Exercises Source: https://api.musclewiki.com/documentation/index Search exercises by a text query. The search intelligently scores relevance and searches within exercise names and instruction steps. Results are sorted by relevance. ```APIDOC ## GET /search ### Description Search exercises by text query with intelligent relevance scoring. Searches in exercise names and instruction steps. Results are sorted by relevance. ### Method GET ### Endpoint `/search` ### Parameters #### Query Parameters - **q** (string) - Required - The search query string. - **limit** (integer) - Optional - The maximum number of results to return (default: 10). - **offset** (integer) - Optional - The number of results to skip (default: 0). - **difficulty** (string) - Optional - Filter by exercise difficulty (e.g., 'beginner', 'intermediate', 'advanced'). ### Response #### Success Response (200) - **total** (integer) - Total exercises matching filters. - **limit** (integer) - Requested limit. - **offset** (integer) - Current offset. - **count** (integer) - Number of results in this response. - **results** (array) - An array of exercise objects matching the search query. #### Response Example ```json { "total": 45, "limit": 5, "offset": 0, "count": 5, "results": [ {"id": 0, "name": "Barbell Curl"}, {"id": 15, "name": "Barbell Bench Press"}, {"id": 23, "name": "Barbell Squat"} ] } ``` ``` -------------------------------- ### List Exercises with Filtering Source: https://api.musclewiki.com/documentation/index This endpoint allows you to list exercises with support for pagination and various filtering options. You can filter by limit, offset, search terms, gender, category, muscle group, difficulty, force type, mechanic, and grip types. The response is optimized for list views. ```http GET /exercises?limit=5&category=barbell&difficulty=intermediate ``` -------------------------------- ### Not Found Error Response (JSON) Source: https://api.musclewiki.com/documentation/index A 'Not Found' error response, returned when a requested resource, such as an exercise ID or media file, does not exist. The `detail` field explains which resource was not found. ```json { "detail": "Exercise not found" } ``` -------------------------------- ### List Equipment Categories Source: https://api.musclewiki.com/documentation/index This endpoint returns a list of all available equipment categories, along with the count of exercises associated with each. This data is useful for building dynamic filter interfaces in your application. ```json [ {"name": "barbell", "display_name": "Barbell", "count": 150}, {"name": "dumbbell", "display_name": "Dumbbell", "count": 200}, {"name": "bodyweight", "display_name": "Bodyweight", "count": 180} ] ``` -------------------------------- ### Stream Branded Video with cURL Source: https://api.musclewiki.com/documentation/index This cURL command downloads a branded video from the API. Ensure you have the correct video URL and your API key. ```curl curl --request GET \ --url 'https://api.musclewiki.com/stream/videos/branded/male-Barbell-barbell-curl-front.mp4' \ --header 'X-API-Key: YOUR_API_KEY' \ --output video.mp4 ``` -------------------------------- ### Error Handling Source: https://api.musclewiki.com/documentation/index Information on common error responses and best practices for handling them. ```APIDOC ## Error Handling ### Rate Limit Exceeded (429) When you exceed your allocated API usage limits. #### Response Body ```json { "detail": "Monthly API quota exceeded", "message": "Monthly API quota exceeded. Please upgrade your plan or wait for the next billing cycle." } ``` ### Validation Error (422) Returned when query parameters or request body formats are invalid. #### Response Body ```json { "detail": [ { "loc": ["query", "limit"], "msg": "ensure this value is less than or equal to 100", "type": "value_error.number.not_le" } ] } ``` ### Internal Server Error (500) Indicates an unexpected error on the server. #### Response Body ```json { "detail": "Internal server error" } ``` ### Best Practices * **Check Status Codes**: Always inspect the HTTP status code before attempting to parse the response body. * **Exponential Backoff**: For `429 Too Many Requests` errors, implement exponential backoff to retry requests with increasing delays. * **Logging**: Log detailed error information for debugging purposes, but avoid exposing sensitive details to end-users. * **Retry 500 Errors**: For `500 Internal Server Error`, retry the request using exponential backoff, with a maximum of 3 attempts. ``` -------------------------------- ### Stream Unbranded Exercise Video (HTTP Request) Source: https://api.musclewiki.com/documentation/index Streams unbranded exercise video files, also supporting byte-range requests for smooth playback. Like other media endpoints, this requires authentication with an `X-API-Key` header. ```http GET /stream/videos/unbranded/male-Barbell-barbell-curl-front.mp4 ``` -------------------------------- ### Stream Unbranded Video Source: https://api.musclewiki.com/documentation/index Stream unbranded exercise video files. Supports byte-range requests for smooth playback. ```APIDOC ## GET /stream/videos/unbranded/{filename} ### Description Stream unbranded exercise video files. Supports byte-range requests for smooth playback. ### Method GET ### Endpoint `/stream/videos/unbranded/{filename}` ### Parameters #### Path Parameters - **filename** (string) - Required - Video filename (e.g., `male-Barbell-barbell-curl-front.mp4`) ### Request Example ``` GET /stream/videos/unbranded/male-Barbell-barbell-curl-front.mp4 ``` ``` -------------------------------- ### Stream OG Image with cURL Source: https://api.musclewiki.com/documentation/index This cURL command downloads an OG image from the API. Replace placeholders with your specific details. ```curl curl --request GET \ --url 'https://api.musclewiki.com/stream/images/og_images/og-male-Barbell-barbell-curl-front.jpg' \ --header 'X-API-Key: YOUR_API_KEY' \ --output og-image.jpg ``` -------------------------------- ### Stream Branded Exercise Video (HTTP Request) Source: https://api.musclewiki.com/documentation/index Streams branded exercise video files, supporting byte-range requests for efficient playback and seeking. Authentication is required via the `X-API-Key` header. ```http GET /stream/videos/branded/male-Barbell-barbell-curl-front.mp4 ``` -------------------------------- ### Stream Branded Video Source: https://api.musclewiki.com/documentation/index Stream branded exercise video files. Supports byte-range requests for smooth playback and video seeking. ```APIDOC ## GET /stream/videos/branded/{filename} ### Description Stream branded exercise video files. Supports byte-range requests for smooth playback and video seeking. ### Method GET ### Endpoint `/stream/videos/branded/{filename}` ### Parameters #### Path Parameters - **filename** (string) - Required - Video filename (e.g., `male-Barbell-barbell-curl-front.mp4`) ### Request Example ``` GET /stream/videos/branded/male-Barbell-barbell-curl-front.mp4 ``` **Note:** Supports HTTP range requests for efficient streaming and seeking. Users should only perform transient caching (e.g., in-memory playback buffers) as per the API Terms. ``` -------------------------------- ### Stream OG Image Source: https://api.musclewiki.com/documentation/index Stream Open Graph image files for social sharing preview images. Supports automatic content-type detection for JPEG, PNG, GIF, and WebP formats. ```APIDOC ## GET /stream/images/og_images/{filename} ### Description Stream Open Graph image files for social sharing preview images. Supports automatic content-type detection for JPEG, PNG, GIF, and WebP formats. ### Method GET ### Endpoint `/stream/images/og_images/{filename}` ### Parameters #### Path Parameters - **filename** (string) - Required - Image filename (e.g., `og-male-Barbell-barbell-curl-front.jpg`) ### Request Example ``` GET /stream/images/og_images/og-male-Barbell-barbell-curl-front.jpg ``` ``` -------------------------------- ### Stream Open Graph Image (HTTP Request) Source: https://api.musclewiki.com/documentation/index Streams Open Graph image files used for social sharing previews. This endpoint supports various image formats (JPEG, PNG, GIF, WebP) and requires authentication. ```http GET /stream/images/og_images/og-male-Barbell-barbell-curl-front.jpg ``` -------------------------------- ### Handle API Internal Server Error Source: https://api.musclewiki.com/documentation/index This JSON response indicates an unexpected internal server error. It's recommended to log this error and contact support if the issue persists. ```json { "detail": "Internal server error" } ``` -------------------------------- ### Unauthorized Error Response (JSON) Source: https://api.musclewiki.com/documentation/index Represents an 'Unauthorized' error, typically returned when the `X-API-Key` header is missing or invalid. The response includes a `detail` and `message` field explaining the issue. ```json { "detail": "Authentication required", "message": "Missing X-API-Key header" } ``` -------------------------------- ### Handle API Rate Limit Exceeded Error Source: https://api.musclewiki.com/documentation/index This JSON structure represents a rate limit exceeded error from the API. It indicates that the monthly quota has been reached and suggests upgrading the plan or waiting for the next billing cycle. ```json { "detail": "Monthly API quota exceeded", "message": "Monthly API quota exceeded. Please upgrade your plan or wait for the next billing cycle." } ``` -------------------------------- ### Check API Health Status Source: https://api.musclewiki.com/documentation/index This endpoint allows you to check the health status of the MuscleWiki API and retrieve database statistics. It's recommended to use this to verify API availability before making other requests. ```json { "status": "healthy", "version": "2.0.0", "exercises_loaded": 1832 } ```