USDA FoodData Central is the United States Department of Agriculture's official food composition database, providing detailed nutritional profiles for 300,000 plus branded and generic foods, free to use without commercial restrictions.
MoEngage <> USDA FoodData Central
The MoEngage <> USDA FoodData Central integration allows you to personalise health, nutrition, and grocery campaigns with authoritative food composition data at send time. Common use cases include surfacing nutritional details for foods a user has logged or purchased, or enriching dietary coaching campaigns with calorie and macronutrient breakdowns.
Integration
| library_add_check |
Prerequisites Ensure you have a USDA FoodData Central API key. Free keys are available instantly at fdc.nal.usda.gov/api-key-signup.html. |
Step 1: Get your USDA FoodData API key
- Navigate to fdc.nal.usda.gov/api-key-signup.html and submit the registration form.
- Your API key is emailed to you immediately. Copy it.
Step 2: Set up the Content API on MoEngage
- Navigate to Dashboard > Settings > APIs and open the Content API tab.
- Click Add Content API.
- Fill in the details using the table below as a reference.
| Key | Value | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Name | Choose a descriptive name, for example USDA Food Nutrition Lookup. |
|||||||||||||||
| Method | GET | |||||||||||||||
| API URL |
Use |
|||||||||||||||
| Key Value Parameters |
|
- Click Validate to confirm the platform returns a response, then click Save.
Once saved, refer to the MoEngage documentation on using Content APIs in campaigns to learn how to reference response fields inside your campaign templates.
Understanding the API response
The response contains a foods array. Each object represents one food item with its nutritional data.
| Response field | Template variable example | Description |
|---|---|---|
foods[0].description |
{{ContentApi.foods[0].description}} |
Food name or description. |
foods[0].brandOwner |
{{ContentApi.foods[0].brandOwner}} |
Brand name, if a branded food. |
foods[0].foodNutrients[0].nutrientName |
{{ContentApi.foods[0].foodNutrients[0].nutrientName}} |
Name of the first nutrient in the list, for example "Protein". |
foods[0].foodNutrients[0].value |
{{ContentApi.foods[0].foodNutrients[0].value}} |
Quantity of that nutrient per 100g. |
foods[0].foodNutrients[0].unitName |
{{ContentApi.foods[0].foodNutrients[0].unitName}} |
Unit of measurement, for example G or KCAL. |