Body Mass Index (BMI) Widget API
Easily calculate your Body Mass Index (BMI) and get personalized health insights, including calorie needs, hydration tips, and risk assessment — all in one
- Id:
widget_243 - Price: Free to run, plus the Call Price, Ƀ 0.1 an API run. Your first 100 API runs carry no Call Price.
- Widget page: Run it in your browser
- Docs: Call Abyss from your code
Input
Send these Fields as input. A Field not listed here is refused.
name
Name
- Type: string
- Required: yes
- Length in characters: 4 to 30
age
Age
- Type: number
- Required: no
gender
Gender
- Type: string
- Required: yes
- Allowed values:
Male,Female,Others
weight
Weight
- Type: number
- Required: yes
height
Height
- Type: number
- Required: yes
waist
Waist
- Type: number
- Required: no
unit
Unit
- Type: string
- Required: yes
- Allowed values:
Metric,Imperial
activity
Activity Level
- Type: string
- Required: yes
- Allowed values:
Sedentary,Light,Moderate,Active,Very active
show_tips
Show Health Tips
- Type: list of strings
- Required: no
- Allowed values:
True
Run it
One call presses the Widget and answers the run once its status is succeeded or failed, however long it takes. The key is read from ABYSS_API_KEY. Install the library with npm install abysshub or pip install abysshub; cURL sends the Fields as a form.
JavaScript
// index.mjs
import Abyss from "abysshub";
const abyss = new Abyss();
const run = await abyss.run("widget_243", {
name: "Ogalue Demian",
age: 0,
gender: "Male",
weight: 75,
height: 5.4,
waist: 3,
unit: "Metric",
activity: "Sedentary",
show_tips: ["True"],
});
for (const path of await run.save("output")) {
console.log(path);
}Python
from abysshub import Abyss
abyss = Abyss()
run = abyss.run("widget_243", {
"name": "Ogalue Demian",
"age": 0,
"gender": "Male",
"weight": 75,
"height": 5.4,
"waist": 3,
"unit": "Metric",
"activity": "Sedentary",
"show_tips": ["True"],
})
for path in run.save("output"):
print(path)cURL
curl https://api.abysshub.com/v1/widgets/widget_243/runs \
-H "Authorization: Bearer $ABYSS_API_KEY" \
-F 'name=Ogalue Demian' \
-F age=0 \
-F gender=Male \
-F weight=75 \
-F height=5.4 \
-F waist=3 \
-F unit=Metric \
-F activity=Sedentary \
-F "show_tips[]=True"A succeeded run carries its result and its output_files. Their URLs are signed for each read: re-read the run, never store a URL. A run still queued or running in the answer (after an hour, or when the API is busy) is read again at its Location with ?wait=true.
More
Keys, files, errors and limits: API access.