Nutrition API

The Nutrition API extracts nutrition information from text using natural language processing. From food blogs to menus to recipes, it can read any text and calculate the corresponding nutrition data.

An intelligent feature of this API is custom portioning: if your text specifies quantities of individual food items or ingredients, the algorithm will automatically scale the nutrition data in the result accordingly.



Returns a list of nutrition information extracted from given text. Nutrition data for each food item is scaled to 100g unless a quantity is specified within the query parameter.


query (required) - query text to extract nutrition information.


X-Api-Key (required) - API Key associated with your account.

Sample Request URL

Live Demo!

Sample Response

    "name": "brisket",
    "calories": 1312.3,
    "serving_size_g": 453.592,
    "fat_total_g": 82.9,
    "fat_saturated_g": 33.2,
    "protein_g": 132,
    "sodium_mg": 217,
    "potassium_mg": 781,
    "cholesterol_mg": 487,
    "carbohydrates_total_g": 0,
    "fiber_g": 0,
    "sugar_g": 0
    "name": "fries",
    "calories": 317.7,
    "serving_size_g": 100,
    "fat_total_g": 14.8,
    "fat_saturated_g": 2.3,
    "protein_g": 3.4,
    "sodium_mg": 212,
    "potassium_mg": 124,
    "cholesterol_mg": 0,
    "carbohydrates_total_g": 41.1,
    "fiber_g": 3.8,
    "sugar_g": 0.3

import requests

query = '1lb brisket and fries'
api_url = '{}'.format(query)
response = requests.get(api_url, headers={'X-Api-Key': 'YOUR_API_KEY'})
if response.status_code ==
    print("Error:", response.status_code, response.text)
var query = '1lb brisket and fries'
    method: 'GET',
    url: '' + query,
    headers: { 'X-Api-Key': 'YOUR_API_KEY'},
    contentType: 'application/json',
    success: function(result) {
    error: function ajaxError(jqXHR) {
        console.error('Error: ', jqXHR.responseText);
const request = require('request');
var query = '1lb brisket and fries';
  url: '' + query,
  headers: {
    'X-Api-Key': 'YOUR_API_KEY'
}, function(error, response, body) {
  if(error) return console.error('Request failed:', error);
  else if(response.statusCode != 200) return console.error('Error:', response.statusCode, body.toString('utf8'));
  else console.log(body)

import com.fasterxml.jackson.databind.ObjectMapper;

URL url = new URL(" brisket and fries");
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestProperty("accept", "application/json");
InputStream responseStream = connection.getInputStream();
ObjectMapper mapper = new ObjectMapper();
JsonNode root = mapper.readTree(responseStream);
let query = "1lb brisket and fries".addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)
let url = URL(string: ""+query!)!
var request = URLRequest(url: url)
request.setValue("YOUR_API_KEY", forHTTPHeaderField: "X-Api-Key")
let task = URLSession.shared.dataTask(with: request) {(data, response, error) in
    guard let data = data else { return }
    print(String(data: data, encoding: .utf8)!)
If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.