Diets Service API

If you're interested in showing a specialised diet recommendation based on a profile's genetic results, and creating customisable meal plans based on those recommendations, you've landed on the right place

Introduction

This API is as an extension to the Diet & Nutrition report, and hence a pre-requisite of using it requires the Diet & Nutrition report to be generated. Please refer to the reports service for more details regarding report generation and retrieval.

Once diet report is generated for a profile, you can fetch its outcome ID using the service/reports/profile-trait/ endpoint.

Using the outcome_id retrieved from the generated diet report, this API can be accessed.

Endpoints

The API exposes 4 endpoints, as given below.

Optimal diet

There are different diets that we offer, namely

  • Plant-Based
  • Mediterranean
  • Low-Carb
  • Paleo

There is an optimal diet associated with each outcome of the diet report. As there can be 27 different outcomes of the diet report, multiple outcomes can map to a single diet, but a single outcome would always be tied with one optimal diet.

To retrieve the optimal diet for a profile, pass the outcome ID of that profile's diet and nutrition report as a query parameter to this endpoint. It returns the optimal diet details along with a list of meals that are part of the diet.

For more details, regarding the endpoint, please refer here.

Meal detail

To retrieve details of the meals returned from the optimal diet endpoint, use this endpoint.

For details, please refer here.

Profile daily meal plan

This endpoint exposes POST, PUT and GET methods, allowing you to build, update and retrieve meal plans against a profile based on that profile's optimal diet.

For details, please refer here.

Profile grocery list

It is supposed to be called after meal plan is built using the profile daily meal plan endpoint for the complete week.

It returns a list of aggregated grocery items needed to prepare the meals for the week, based on the ingredients of the meals that are chosen in the meal plan using the profile daily meal plan endpoint.

For details, please refer here.

Sequence diagram

To get an overall idea of the optimal diet and meal plan builder flow, please refer here.