Profile
A user's profile drives their personalized nutrition experience. Macrofy calculates baseline metabolic rates (BMR) and macronutrient distributions on the backend, meaning your SDK or client app doesn't need to reinvent nutrition science. On this page, we'll look at retrieving and updating profiles.
The profile model
The profile endpoints return a combined ProfileWithGoals object.
Properties
- Name
profile- Type
- object
- Description
Contains the user's raw demographic attributes:
age,gender,heightCm,weightKg,targetWeightactivityLevel(e.g.,sedentary,active)calorieDeficit(e.g.,lose_1,maintain)dietType(e.g.,balanced,keto)
- Name
goals- Type
- object
- Description
The server-computed daily macronutrient goals:
calories,carbs,protein,fat
GET/v1/users/:id/profile
Get profile
Retrieve the user's profile parameters and their computed daily macro goals.
Request
GET
/v1/users/xyz/profilecurl https://api.macrofy.com/v1/users/xyz/profile \
-H "Authorization: Bearer {token}"
Response
{
"profile": {
"userId": "xyz",
"name": "Test User",
"age": 30,
"gender": "male",
"weight": 180,
"targetWeight": 170,
"activityLevel": "moderate",
"calorieDeficit": "lose_1",
"dietType": "balanced"
},
"goals": {
"calories": 2000,
"carbs": 250,
"protein": 150,
"fat": 67
}
}