Content
πŸ“Ž API

API

The NutriFix API allows you to access and manage your NutriFix data from your own applications. The API is available to all NutriFix users, including free users.

Endpoint: Quotes

Example Request

GET "https://type.fit/api/quotes"

Example response

[
  {
    "text": "Genius is one percent inspiration and ninety-nine percent perspiration.",
    "author": "Thomas Edison, type.fit"
  },
  {
    "text": "You can observe a lot just by watching.",
    "author": "Yogi Berra, type.fit"
  },
  {
    "text": "A house divided against itself cannot stand.",
    "author": "Abraham Lincoln, type.fit"
  },
  {
    "text": "Difficulties increase the nearer we get to the goal.",
    "author": "Johann Wolfgang von Goethe, type.fit"
  },
  {
    "text": "Fate is in your hands and no one elses",
    "author": "Byron Pulsifer, type.fit"
  },
  {
    "text": "Be the chief but never the lord.",
    "author": "Lao Tzu, type.fit"
  },
  {
    "text": "Nothing happens unless first we dream.",
    "author": "Carl Sandburg, type.fit"
  },
  {
    "text": "Well begun is half done.",
    "author": "Aristotle, type.fit"
  },
  {
    "text": "Life is a learning experience, only if you learn.",
    "author": "Yogi Berra"
  },
  {
    "text": "Self-complacency is fatal to progress.",
    "author": "Margaret Sangster, type.fit"
  },
  {
    "text": "Peace comes from within. Do not seek it without.",
    "author": "Buddha, type.fit"
  },
  {
    "text": "What you give is what you get.",
    "author": "Byron Pulsifer, type.fit"
  },
  {
    "text": "We can only learn to love by loving.",
    "author": "Iris Murdoch, type.fit"
  },
  {
    "text": "Life is change. Growth is optional. Choose wisely.",
    "author": "Karen Clark, type.fit"
  },
  {
    "text": "You'll see it when you believe it.",
    "author": "Wayne Dyer, type.fit"
  },
  {
    "text": "Today is the tomorrow we worried about yesterday.",
    "author": "type.fit"
  }
]

Fetch Data Example (Fetch API)

fetch("https://type.fit/api/quotes")
  .then((response) => response.json())
  .then((data) => console.log(data))
  .catch((error) => console.error("Error:", error));

Fetch Data Example (Axios)

axios
  .get("https://type.fit/api/quotes/")
  .then((response) => console.log(response.data))
  .catch((error) => console.error("Error:", error));

Endpoint: Landing page

Example Request

GET /api/landing-page

Example response

{
  "data": {
    "id": 1,
    "attributes": {
      "createdAt": "2024-03-21T05:36:32.698Z",
      "updatedAt": "2024-03-26T09:40:25.947Z",
      "publishedAt": "2024-03-21T05:36:34.965Z",
      "blocks": [
        {
          "id": 2,
          "__component": "layout.hero-section",
          "Heading": "NutriFix creates the future of health & fitness services",
          "link": {
            "id": 2,
            "text": "Join Us"
          }
        },
        {
          "id": 1,
          "__component": "layout.vision-section",
          "title": "Our Vision",
          "subTitle": "Solutions For"
        },
        {
          "id": 1,
          "__component": "layout.problems-section",
          "problem": [
            {
              "id": 3,
              "title": "Workout",
              "description": "Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolor dolores laborum nam.",
              "badge": "planner"
            },
            {
              "id": 1,
              "title": "Meal",
              "description": "Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolor dolores laborum nam.",
              "badge": "planner"
            },
            {
              "id": 2,
              "title": "Calories",
              "description": "Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolor dolores laborum nam.",
              "badge": "estimation"
            }
          ]
        },
        {
          "id": 1,
          "__component": "layout.work-section",
          "sectionTitle": "How it Works?",
          "process": [
            {
              "id": 1,
              "title": "Signup or Signin",
              "description": "Create an account or login to your account."
            },
            {
              "id": 2,
              "title": "Choose service",
              "description": "Navigate to the service you want to use."
            },
            {
              "id": 3,
              "title": "Use the AI tool",
              "description": "Feel free to use the AI tool to generate what you want."
            }
          ]
        }
      ]
    }
  },
  "meta": {}
}

Fetch Data Example (Fetch API)

fetch("/api/landing-page")
  .then((response) => response.json())
  .then((data) => console.log(data))
  .catch((error) => console.error("Error:", error));

Fetch Data Example (Axios)

axios
  .get("/api/landing-page")
  .then((response) => console.log(response.data))
  .catch((error) => console.error("Error:", error));

Endpoint: Diet

Example Request

POST "https://nutrifix.onrender.com/diet"

Payload

{
  "age": int,
 
  "height": int,
 
  "weight": int,
 
  "gender" : ['Male','Female'],
 
  "activity_level" : ['Sedentary', 'Lightly Active', 'Moderately Active', 'Very Active', 'Extremely Active'],
 
  "medical_condition" : ['Diabetes', 'Hypertension (High Blood Pressure)', 'Heart Disease', 'Celiac Disease (Gluten Intolerance)', 'Irritable Bowel Syndrome (IBS)', 'None', 'Other'],
 
  "allergie" : ['Gluten', 'Lactose', 'Nuts', 'Shellfish', 'Soy', 'None', 'Other'],
 
  "medication" : str,
 
  "fitness_goal" : ['Lose Weight', 'Maintain Weight', 'Muscle Gain', 'Endurance Improvement', 'Overall Health Maintenance', 'Flexibility and Mobilit'],
 
  "stress_level" : ['Low', 'Moderate', 'High', 'Very High', 'Not Sure/Varies'],
 
  "sleep_pattern" : ['Excellent', 'Good', 'Fair', 'Poor', 'Varied'],
 
  "smoker" : ['Non-smoker', 'Occasional-smoker', 'Regular Smoker', 'Former Smoker', 'Heavy Smoker'],
 
  "alchool" : ['Non-drinker', 'Occasional drinker', 'Moderate drinker', 'Regular drinker', 'Heavy drinker']
}

Example Payload

{
  "age": 22,
  "height": 184,
  "weight": 86,
  "gender": "Male",
  "activity_level": "Sedentary",
  "medical_condition": "None",
  "allergie": "None",
  "medication": "None",
  "fitness_goal": "Maintain Weight",
  "stress_level": "Moderate",
  "sleep_pattern": "Fair",
  "smoker": "Non-smoker",
  "alchool": "Non-drinker"
}

Example response

**Day 1**
 
* Breakfast: Oatmeal with berries and nuts (1 cup cooked oatmeal, 1/2 cup berries, 1/4 cup nuts)
* Lunch: Grilled chicken salad with mixed greens, tomatoes, cucumbers, and avocado (4oz grilled chicken, 2 cups mixed greens, 1/2 cup tomatoes, 1/2 cup cucumbers, 1/4 avocado)
* Dinner: Salmon with roasted vegetables (4oz salmon, 1 cup roasted vegetables)
* Snacks: Apple with peanut butter (1 apple, 2 tbsp peanut butter), Greek yogurt (1 cup)
 
**Day 2**
 
* Breakfast: Whole-wheat toast with eggs and avocado (2 slices whole-wheat toast, 2 eggs, 1/4 avocado)
* Lunch: Tuna salad sandwich on whole-wheat bread (1 can tuna, 1/4 cup celery, 1/4 cup onion, 2 slices whole-wheat bread)
* Dinner: Lentil soup with whole-wheat bread (1 bowl lentil soup, 2 slices whole-wheat bread)
* Snacks: Banana (1 banana), Trail mix (1/4 cup)
 
**Day 3**
 
* Breakfast: Smoothie with fruit, yogurt, and spinach (1 cup fruit, 1 cup yogurt, 1 cup spinach)
* Lunch: Leftover lentil soup
* Dinner: Chicken stir-fry with brown rice (4oz chicken, 1 cup vegetables, 1 cup brown rice)
* Snacks: Hummus with carrots (1/2 cup hummus, 1 cup carrots), Apple (1 apple)
 
**Day 4**
 
* Breakfast: Yogurt with granola and berries (1 cup yogurt, 1/4 cup granola, 1/2 cup berries)
* Lunch: Salad with grilled shrimp, quinoa, and vegetables (4oz grilled shrimp, 1 cup quinoa, 2 cups mixed greens, 1/2 cup vegetables)
* Dinner: Vegetarian chili with cornbread (1 bowl vegetarian chili, 1 piece cornbread)
* Snacks: Popcorn (3 cups), Banana (1 banana)
 
**Day 5**
 
* Breakfast: Oatmeal with peanut butter and banana (1 cup cooked oatmeal, 2 tbsp peanut butter, 1 banana)
* Lunch: Leftover vegetarian chili
* Dinner: Salmon with roasted vegetables (4oz salmon, 1 cup roasted vegetables)
* Snacks: Apple with peanut butter (1 apple, 2 tbsp peanut butter), Trail mix (1/4 cup)
 
**Day 6**
 
* Breakfast: Whole-wheat toast with eggs and avocado (2 slices whole-wheat toast, 2 eggs, 1/4 avocado)
* Lunch: Tuna salad sandwich on whole-wheat bread (1 can tuna, 1/4 cup celery, 1/4 cup onion, 2 slices whole-wheat bread)
* Dinner: Chicken stir-fry with brown rice (4oz chicken, 1 cup vegetables, 1 cup brown rice)
* Snacks: Hummus with carrots (1/2 cup hummus, 1 cup carrots), Apple (1 apple)
 
**Day 7**
 
* Breakfast: Smoothie with fruit, yogurt, and spinach (1 cup fruit, 1 cup yogurt, 1 cup spinach)
* Lunch: Salad with grilled shrimp, quinoa, and vegetables (4oz grilled shrimp, 1 cup quinoa, 2 cups mixed greens, 1/2 cup vegetables)
* Dinner: Vegetarian chili with cornbread (1 bowl vegetarian chili, 1 piece cornbread)
* Snacks: Popcorn (3 cups), Banana (1 banana)
 
**Additional Notes:**
 
* Aim for 2,000-2,200 calories per day.
* Drink plenty of water throughout the day.
* Choose lean protein sources such as chicken, fish, beans, and tofu.\n* Include plenty of fruits and vegetables in your diet.\n* Limit processed foods, sugary drinks, and unhealthy fats.
* Cook meals at home as much as possible to control ingredients and portions.
* Listen to your body and eat when you're hungry, but stop when you're full.
* If you have any questions or concerns, consult with a registered dietitian or other qualified healthcare professional.

Fetch Data Example (Fetch API)

fetch("https://nutrifix.onrender.com/diet", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    // Add your payload here
  }),
})
  .then((response) => response.json())
  .then((data) => console.log(data))
  .catch((error) => console.error("Error:", error));

Fetch Data Example (Axios)

axios
  .post("https://nutrifix.onrender.com/diet", {
    // Add your payload here
  })
  .then((response) => console.log(response.data))
  .catch((error) => console.error("Error:", error));

Endpoint: Workout

Example Request

POST "https://nutrifix.onrender.com/workout"

Payload

{
"age": int,
 
"height": int,
 
"weight": int,
 
"my_goals" : str,
 
"fitness_level" : ['Beginner', 'Intermediate', 'Advanced', 'Elite'],
 
"days" : int,
 
"hours" : int,
 
"health_consd" : ['Cutting Phase', 'Bulking Phase', 'Maintenance Phase', 'Lean Muscle Gain'],
 
"routine" : ['Bro Split', 'Push Pull Leg', 'Upper and Lower', 'Full Body']
}

Example Payload

{
  "age": 22,
  "height": 184,
  "weight": 86,
  "my_goals": "Increase Flexibility",
  "fitness_level": "Beginner",
  "days": 4,
  "hours": 2,
  "health_consd": "Cutting Phase",
  "routine": "Bro Split"
}

Example response

Workout Plan for Flexibility
 
Goal: Increase flexibility
 
Fitness Level: Beginner
 
Equipment: Gym with various equipment
 
Time Commitment: 4 days per week, 2 hours per session
 
Bro Split Routine:
 
Day 1: Chest and Triceps
 
Warm-up: 10 minutes of light cardio, such as jogging or cycling
Chest exercises:
Barbell bench press: 3 sets of 10-12 repetitions
Incline dumbbell press: 3 sets of 10-12 repetitions
Dumbbell flyes: 3 sets of 12-15 repetitions
Triceps exercises:
Triceps pushdowns: 3 sets of 10-12 repetitions
Overhead triceps extensions: 3 sets of 10-12 repetitions
Skullcrushers: 3 sets of 12-15 repetitions
Flexibility exercises:
Chest stretch: 3 sets of 30 seconds hold
Triceps stretch: 3 sets of 30 seconds hold
 
Day 2: Back and Biceps
 
Warm-up: 10 minutes of light cardio, such as jogging or cycling
Back exercises:
Barbell row: 3 sets of 10-12 repetitions
Pull-ups: 3 sets of 10-12 repetitions
Lat pulldowns: 3 sets of 12-15 repetitions
Biceps exercises:
Barbell curls: 3 sets of 10-12 repetitions
Hammer curls: 3 sets of 10-12 repetitions
Concentration curls: 3 sets of 12-15 repetitions
Flexibility exercises:
Hamstring stretch: 3 sets of 30 seconds hold
Quad stretch: 3 sets of 30 seconds hold
 
Day 3: Legs
 
Warm-up: 10 minutes of light cardio, such as jogging or cycling
Leg exercises:
Barbell squats: 3 sets of 10-12 repetitions
Leg press: 3 sets of 10-12 repetitions
Hamstring curls: 3 sets of 12-15 repetitions
Calf raises: 3 sets of 15-20 repetitions
Flexibility exercises:
Calf stretch: 3 sets of 30 seconds hold
IT band stretch: 3 sets of 30 seconds hold
 
Day 4: Shoulders and Core
 
Warm-up: 10 minutes of light cardio, such as jogging or cycling
Shoulder exercises:
Overhead press: 3 sets of 10-12 repetitions
Lateral raises: 3 sets of 10-12 repetitions
Front raises: 3 sets of 12-15 repetitions
Core exercises:
Planks: 3 sets of 30-60 seconds hold
Side planks: 3 sets of 30-60 seconds hold per side
Crunches: 3 sets of 15-20 repetitions
Flexibility exercises:
Shoulder stretch: 3 sets of 30 seconds hold
Cat-cow stretch: 3 sets of 10 repetitions
 
Cool-down: 5 minutes of stretching for all major muscle groups
 
Notes:
 
Choose weights that are challenging but allow you to maintain good form.
Rest for 60-90 seconds between sets.
Gradually increase the weight or resistance as you get stronger.
Listen to your body and take rest days when needed.
Stay hydrated by drinking plenty of water throughout the workout.
Consult with a healthcare professional before starting any new exercise program.

Fetch Data Example (Fetch API)

fetch("https://nutrifix.onrender.com/workout", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    // Add your payload here
  }),
})
  .then((response) => response.json())
  .then((data) => console.log(data))
  .catch((error) => console.error("Error:", error));

Fetch Data Example (Axios)

axios
  .post("https://nutrifix.onrender.com/workout", {
    // Add your payload here
  })
  .then((response) => console.log(response.data))
  .catch((error) => console.error("Error:", error));