{
  "openapi": "3.1.0",
  "info": {
    "title": "Calories Burned API",
    "version": "1.0.0",
    "description": "Calories burned for 1,111 activities from the 2024 Compendium of Physical Activities, by weight and time.\n\nEstimate calories burned for 1,111 activities — the complete 2024 Adult Compendium of Physical Activities (running, cycling, swimming, gym, 156 sports, dancing, occupations, home and garden tasks, and more) with its official MET values (kcal = MET × weight × hours). Look activities up by Compendium code, slug or free-text search across 22 categories, get calories per hour, and see when a MET value is measured versus estimated. Supports kg or lb.",
    "contact": {
      "name": "Data and APIs",
      "url": "https://dataandapis.com/contact"
    },
    "termsOfService": "https://dataandapis.com/terms-of-service",
    "license": {
      "name": "Data and APIs Terms of Service",
      "url": "https://dataandapis.com/terms-of-service"
    },
    "x-logo": {
      "url": "https://dataandapis.com/images/calories-burned.webp"
    }
  },
  "externalDocs": {
    "description": "Documentation, live tester and pricing",
    "url": "https://dataandapis.com/apis/calories-burned"
  },
  "servers": [
    {
      "url": "https://api-calories.dataandapis.com"
    }
  ],
  "tags": [
    {
      "name": "Health",
      "description": "Calories Burned API belongs to the Health category of the Data and APIs catalog."
    }
  ],
  "paths": {
    "/v1/activities/{id}": {
      "get": {
        "operationId": "activityDetail",
        "summary": "Activity Detail",
        "description": "Activity Detail endpoint of the Calories Burned API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/calories-burned/activity-detail"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "12020"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "ok": true,
                  "code": 12020,
                  "slug": "jogging-general-self-selected-pace",
                  "name": "Jogging, general, self-selected pace",
                  "category": "running",
                  "met": 7.5,
                  "estimated": false,
                  "category_name": "Running",
                  "source": {
                    "name": "2024 Adult Compendium of Physical Activities",
                    "citation": "Herrmann SD, Willis EA, Ainsworth BE, et al. 2024 Adult Compendium of Physical Activities: A third update of the energy costs of human activities. J Sport Health Sci. 2024.",
                    "url": "https://pacompendium.com/adult-compendium/"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/calories-burned": {
      "get": {
        "operationId": "caloriesBurned",
        "summary": "Calories Burned",
        "description": "Calories Burned endpoint of the Calories Burned API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/calories-burned/calories-burned"
        },
        "parameters": [
          {
            "name": "activity",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "12030"
          },
          {
            "name": "duration",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "30"
          },
          {
            "name": "unit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "kg"
          },
          {
            "name": "weight",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "70"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "ok": true,
                  "activity": {
                    "code": 12030,
                    "slug": "running-5-0-to-5-2-mph-12-min-mile",
                    "name": "Running, 5.0 to 5.2 mph (12 min/mile)",
                    "category": "running",
                    "met": 8.5,
                    "estimated": false
                  },
                  "matched_by": "code",
                  "weight_kg": 70,
                  "weight_lb": 154.3,
                  "duration_minutes": 30,
                  "calories_burned": 297.5,
                  "calories_per_hour": 595,
                  "formula": "kcal = MET × weight(kg) × duration(hours)",
                  "source": {
                    "name": "2024 Adult Compendium of Physical Activities",
                    "citation": "Herrmann SD, Willis EA, Ainsworth BE, et al. 2024 Adult Compendium of Physical Activities: A third update of the energy costs of human activities. J Sport Health Sci. 2024.",
                    "url": "https://pacompendium.com/adult-compendium/"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/sources": {
      "get": {
        "operationId": "dataSources",
        "summary": "Data Sources",
        "description": "Data Sources endpoint of the Calories Burned API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/calories-burned/data-sources"
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "ok": true,
                  "sources": [
                    {
                      "name": "2024 Adult Compendium of Physical Activities",
                      "citation": "Herrmann SD, Willis EA, Ainsworth BE, et al. 2024 Adult Compendium of Physical Activities: A third update of the energy costs of human activities. J Sport Health Sci. 2024.",
                      "url": "https://pacompendium.com/adult-compendium/"
                    }
                  ],
                  "formula": "kcal = MET × weight(kg) × duration(hours)"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/activities": {
      "get": {
        "operationId": "listActivities",
        "summary": "List Activities",
        "description": "List Activities endpoint of the Calories Burned API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/calories-burned/list-activities"
        },
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "sports"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "50"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "1"
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "running"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "ok": true,
                  "total": 67,
                  "page": 1,
                  "limit": 3,
                  "count": 3,
                  "activities": [
                    {
                      "code": 12200,
                      "slug": "running-marathon",
                      "name": "Running, marathon",
                      "category": "running",
                      "met": 13.3,
                      "estimated": false
                    },
                    {
                      "code": 12045,
                      "slug": "running-5-5-5-8-mph",
                      "name": "Running, 5.5 -5.8 mph",
                      "category": "running",
                      "met": 9,
                      "estimated": false
                    },
                    {
                      "code": 12029,
                      "slug": "running-4-3-to-4-8-mph",
                      "name": "Running 4.3 to 4.8 mph",
                      "category": "running",
                      "met": 7.8,
                      "estimated": false
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/categories": {
      "get": {
        "operationId": "listCategories",
        "summary": "List Categories",
        "description": "List Categories endpoint of the Calories Burned API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/calories-burned/list-categories"
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "ok": true,
                  "count": 22,
                  "total_activities": 1111,
                  "categories": [
                    {
                      "slug": "bicycling",
                      "name": "Bicycling",
                      "activities": 44
                    },
                    {
                      "slug": "conditioning-exercise",
                      "name": "Conditioning Exercise",
                      "activities": 86
                    },
                    {
                      "slug": "dancing",
                      "name": "Dancing",
                      "activities": 28
                    },
                    {
                      "slug": "fishing-hunting",
                      "name": "Fishing & Hunting",
                      "activities": 37
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Api-Key",
        "description": "Create a free key at https://dataandapis.com/sign-up. 500 tokens a month on the Free plan; this API costs 1 token per call."
      }
    }
  },
  "security": [
    {
      "ApiKey": []
    }
  ]
}