Nutrition Facts Data OCR
Mindee’s Nutrition Facts Data API uses deep learning to automatically, accurately, and instantaneously parse your documents details. In a few seconds, the API extracts a set of data from your PDFs or photos of Nutrition Facts, including:
Serving per Box
Serving Size
Calories
Total Fat
Saturated Fat
Trans Fat
Cholesterol
Total Carbohydrate
Dietary Fiber
Total Sugars
Added Sugar
Protein
Sodium
Nutrients
Set up the API
You'll need a Nutrition Facts document. You can use one of the sample documents provided below.

Access your Nutrition Facts Data API by clicking on the corresponding product card in the Document Catalog

From the left navigation, go to documentation > API Reference, you'll find sample code in popular languages and command line.
Replace my-api-key-here with your new API key, or use the select an API key feature and it will be filled automatically.
Copy and paste the sample code of your desired choice in your application, code environment, terminal etc.
Replace
/path/to/the/file.extwith the path to your input document.
Remember to replace with your V1 API key.
Run your code. You will receive a JSON response with the Nutrition Facts Data details.
API Response
Here is the full JSON response you get when you call the API:
You can find the prediction within the prediction key found in document > inference > prediction for document-level predictions: it contains the different fields extracted at the document level, meaning that for multi-pages PDFs, we reconstruct a single receipt object using all the pages.
Detailed Field Information
Using the above Nutrition Facts Data example the following are the basic fields that can be extracted.
Serving per Box
serving_per_box: The number of servings in each box of the product.
Serving Size
serving_size: The size of a single serving of the product.
amount: The amount of a single serving.
unit: The unit for the amount of a single serving.
Calories
calories: The amount of calories in the product.
per_100g: The amount of calories per 100g of the product.
per_serving: The amount of calories per serving of the product.
daily_value: DVs are the recommended amounts of calories to consume or not to exceed per day..
Total Fat
total_fat: The amount of total fat in the product.
per_100g: The amount of total fat per 100g of the product.
per_serving: The amount of total fat per serving of the product.
daily_value: DVs are the recommended amounts of total fat to consume or not to exceed per day..
Saturated Fat
saturated_fat: The amount of saturated fat in the product.
per_100g: The amount of saturated fat per 100g of the product.
per_serving: The amount of saturated fat per serving of the product.
daily_value: DVs are the recommended amounts of saturated fat to consume or not to exceed per day..
Trans Fat
trans_fat: The amount of trans fat in the product.
per_100g: The amount of trans fat per 100g of the product.
per_serving: The amount of trans fat per serving of the product.
daily_value: DVs are the recommended amounts of trans fat to consume or not to exceed per day..
Cholesterol
cholesterol: The amount of trans fat in the product.
per_100g: The amount of cholesterol per 100g of the product.
per_serving: The amount of cholesterol per serving of the product.
daily_value: DVs are the recommended amounts of cholesterol to consume or not to exceed per day..
Total Carbohydrate
total_carbohydrate: The amount of total carbohydrate in the product.
per_100g: The amount of total carbohydrate per 100g of the product.
per_serving: The amount of total carbohydrate per serving of the product.
daily_value: DVs are the recommended amounts of total carbohydrate to consume or not to exceed per day..
Dietary Fiber
dietary_fiber: The amount of total dietary fiber in the product.
p
Total Sugars
total_sugars: The amount of total sugars in the product.
per_100g: The amount of total sugars per 100g of the product.
per_serving: The amount of total sugars per serving of the product.
daily_value: DVs are the recommended amounts of total sugars to consume or not to exceed per day..
Added Sugars
added_sugars: The amount of added sugars in the product.
per_100g: The amount of added sugars per 100g of the product.
per_serving: The amount of added sugars per serving of the product.
daily_value: DVs are the recommended amounts of total sugars to consume or not to exceed per day..
Protein
protein: The amount of protein in the product.
per_100g: The amount of protein per 100g of the product.
per_serving: The amount of protein per serving of the product.
daily_value: DVs are the recommended amounts of protein to consume or not to exceed per day..
Sodium
sodium: The amount of sodium in the product.
per_100g: The amount of sodium per 100g of the product.
per_serving: The amount of sodium per serving of the product.
daily_value: DVs are the recommended amounts of sodium to consume or not to exceed per day..
unit: The unit of measurement for the amount of sodium.
Nutrients
nutrients: The amount of nutrients in the product.
name: The name of the nutrients of the product.
per_100g: The amount of sodium per 100g of the product.
per_serving: The amount of sodium per serving of the product.
unit: The unit of measurement for the amount of nutrients.
daily_value: DVs are the recommended amounts of sodium to consume or not to exceed per day..
Last updated
Was this helpful?

