The Calories Burned API calculates the total calories burned for hundreds of sports and activities. It supports custom weight and duration.
https://api.api-ninjas.com/v1/caloriesburned
Returns the calories burned per hour and total calories burned according to given parameters for given activities (up to 10).
activity
requiredName of the given activity. This value can be partial (e.g. ski
will match water skiing
and downhill skiing
).
weight
optionalWeight of the user performing the activity in pounds. Must be between 50
and 500
. Default value is 160
.
duration
optionalHow long the activity was performed in minutes. Must be 1
or greater. Default value is 60
(1 hour).
X-Api-Key
requiredAPI Key associated with your account.
https://api.api-ninjas.com/v1/caloriesburned?activity=skiing
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
[
{
"name": "Skiing, water skiing",
"calories_per_hour": 354,
"duration_minutes": 60,
"total_calories": 354
},
{
"name": "Cross country snow skiing, slow",
"calories_per_hour": 413,
"duration_minutes": 60,
"total_calories": 413
},
{
"name": "Cross country skiing, moderate",
"calories_per_hour": 472,
"duration_minutes": 60,
"total_calories": 472
},
...
]
1
2
3
4
5
6
7
8
9
import requests
activity = 'skiing'
api_url = 'https://api.api-ninjas.com/v1/caloriesburned?activity={}'.format(activity)
response = requests.get(api_url, headers={'X-Api-Key': 'YOUR_API_KEY'})
if response.status_code == requests.codes.ok:
print(response.text)
else:
print("Error:", response.status_code, response.text)
If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.