Build your request:

Username:
Password:
Function:
User ID:
Object:
Filter:
Attribute
Subfunction:
Ingredient ID:
Name:
Data:
Limit:
opts
Quantity
Attributes:
ATTACH INGREDIENT+
Fields:
=
+

ATTACH INGREDIENT:

X

ID

NAME

QUANTITY

COOKING METHOD

ADD
//NOTE: The Javascript example is not secure and is shown only for informational purposes. Nutritics doesn't recommend its usage.
// Get results using JSONP:
function myCallback(result) { //Define a function to be called after we receive the data

    if( result.status == 200 ){ //ON SUCCESS:
        console.log(result) //output the result to the console

    }else{ // ON ERROR:
        console.log('ERROR '+result.status+': '+result.msg)
    }
}
//Run the request:
var script = document.createElement('script')
script.src = 'https://[USERNAME]:[PASSWORD]@[URL]&callback=myCallback'
document.getElementsByTagName('head')[0].appendChild(script)
require 'rubygems'
require 'json'
require 'rest-client'

# Get json results using RestClient.
response = RestClient.get 'https://[USERNAME]:[PASSWORD]@[URL]', 
	{:accept => :json}
    
if response.code == 200
	# Convert the string to a JSON Object
	data = JSON.parse(response)
	# Print the returned json data out
	puts JSON.pretty_generate(data)

	#Loop through each object and print out their id
	for item in data; 
		puts item["id"]
	end
else
	#We have an error
end
//NOTE: The JQuery example is not secure and is shown only for informational purposes. Nutritics doesn't recommend its usage.
// Get results using JSONP:
var requsetURL = 'https://[USERNAME]:[PASSWORD]@[URL]&callback=?'

$.getJSON( requestURL, function( result ){ //Define a function to be called after we receive the data

	if( result.status == 200 ){ //ON SUCCESS:
        console.log(result) //output the result to the console

    }else{ // ON ERROR:
        console.log('ERROR '+result.status+': '+result.msg)
    }
} )
/*Note: Json library needs to be import for the results.*/
/*imports*/
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.Authenticator;
import java.net.PasswordAuthentication;
import java.net.URL;
import java.net.URLConnection;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class NutriticsApi {
	public static void main(String [] arg) throws IOException, JSONException
		{
		//CREATE AN AUTHENTICATOR:
		Authenticator.setDefault(new Authenticator() {
			String username="[USERNAME]";
			String password="[PASSWORD]";
			@Override
			protected PasswordAuthentication getPasswordAuthentication() {          
				return new PasswordAuthentication(username, password.toCharArray());
			}
		});
		URL url = new URL("[URL]");
		URLConnection conn = url.openConnection();
		BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
		String inputLine, output = "";
		while ((inputLine = in.readLine()) != null) {
			output += inputLine;
		} 
		
		// HOW TO GET THE FIRST RESULT:
		JSONArray newArr= new JSONArray(output);
		System.out.println(newArr.getJSONObject(0)); 
		
		// HOW TO LOOP THROUGH RESULTS TO GET INDIVIDUAL FIELDS:
		for(int i=0; i<newArr.length(); i++) {
			JSONObject dataObj= newArr.getJSONObject(i);
			System.out.println(dataObj.getString("id")); //output the id number for each result
		} 
	}
}
#Example to use an API call with Python v2 and authentication
#You have to use these basic libraries
import urllib2
import sys
import re
import base64
import json
from urlparse import urlparse

theurl = 'https://[URL]'
username = '[USERNAME]'
password = '[PASSWORD]'

req = urllib2.Request(theurl)
try:
    handle = urllib2.urlopen(req)
except IOError, e:
    # Here we want to fail
    pass
else:
    sys.exit(1)

if not hasattr(e, 'code') or e.code != 401:
    # Uknown error (no response code)
    sys.exit(1)

#We extract scheme and realm
authline = e.headers['www-authenticate']
authobj = re.compile(r'''(?:\s*www-authenticate\s*:)?\s*(\w*)\s+realm=['"]([^'"]+)['"]''',re.IGNORECASE)
matchobj = authobj.match(authline)

if not matchobj:
    # here something is wrong (you have to catch an error)
    print authline
    sys.exit(1)

scheme = matchobj.group(1)
realm = matchobj.group(2)
# here we've extracted the scheme and the realm from the header
if scheme.lower() != 'basic':
    # here something is wrong (you have to catch an error)
    sys.exit(1)

base64string = base64.encodestring('%s:%s' % (username, password))[:-1]
authheader =  "Basic %s" % base64string
req.add_header("Authorization", authheader)

try:
    handle = urllib2.urlopen(req)
except IOError, e:
    # authentication failed
    print "The username or password is wrong."
    sys.exit(1)

#We read the result
thepage = handle.read()

#Print the returned json data out
print thepage;

jsondata = json.loads(thepage)
#Loop through each object and print out their id
for item in jsondata:
    print item["id"]
//BASIC EXAMPLE:

$requestURL = "https://[USERNAME]:[PASSWORD]@[URL]";

if($result = file_get_contents( $requestURL ) ) {

	$result = json_decode( $result, true ); //unpack the response into an array
    
	if( $result['status'] == 200 ){ //ON SUCCESS:
		print_r($result); // print the full object
        
	}else{ //ON ERROR:
		die('ERROR '.$result['status'].': '.$result['msg']);
	}
    
}else die("There was an error sending the request");
'How to import REST API data into a Microsoft Excel Workbook:
'Open the excel VBA editor and paste the code below into a new module.
'Next, create a button on sheet1 and choose getNutritics as the onclick function.

Sub getNutritics()
    URL = "https://[URL]"
    user = "[USERNAME]"
    pass = "[PASSWORD]"
    Set httpReq = CreateObject("MSXML2.ServerXMLHTTP.6.0")
    httpReq.Open "GET", URL, False
    httpReq.setRequestHeader "Content-Type", "application/xml"
    httpReq.setRequestHeader "Accept", "application/xml"
    httpReq.setRequestHeader "Authorization", "Basic " + Base64Encode(user + ":" + pass)
    httpReq.send
    'MsgBox httpReq.responseText
    n2XlJSONParser (httpReq.responseText)   'displays the result in sheet 1
End Sub


'JSON parsing function
'http://www.mrexcel.com/forum/excel-questions/640780-parse-json-excel-visual-basic-applications-3.html
'parses a JSON string into a range of cells
Sub n2XlJSONParser(Src)

    Dim ws As Worksheet     ' Target worksheet for extracted data
    Dim TLen As Integer     ' Total length of of input cell data
    Dim columnsCR As Integer ' limit number of data pairs before forced Carriage Return
    Dim cCR As Integer      ' Runtime modified carriage return value for relative reference from start.
    Dim lenLim As Integer   ' Data lenth limit to cause a new row.  0 = none
    Dim rStart As Integer   ' Starting output row
    Dim cStart As Integer   ' Starting output column
    Dim rOut As Integer     ' Dest Row for output
    Dim cOut As Integer     ' Dest Col for output
    Dim nDex As Integer     ' Current position in Source string
    Dim nDex2 As Integer    ' further index to find end quote
    Dim nDexChr As String   ' The character at nDex
    Dim n2This As String    ' value within from nDex -> nDex2 range
    Dim records As Integer  ' Total number of records to report parsed.
    
    ' Propagation rules:
    ' A brace "{" indents the table 1 column.
    ' An end brace "}" un-indents the table (is that a word?).
    ' Quotes are partial delimiters to find a string value to extract by looking ahead to the next quote.
    ' colons and commas are minor delimiters; a comma looks back to the previous colon.
    ' "}," is a major delimiter, and causes the extraction to start a new row.
    
    ' First assign the source
    Set ws = ActiveWorkbook.Worksheets(1)
    'Src = ws.Range("A4").Value  ' Cell that contains JSON data to parse.
    TLen = Len(Src)
    records = 0
    
    ' Initialize cell output behavior.  Adjust these to suit.
    rStart = 1          ' Start output in row 1
    cStart = 1          ' Start output in "A" column
    columnsCR = 0       ' Number of columns, after which, force the start of a new row. _
                        ' _ A ZERO value turns this off. (even numbers work best)
    lenLim = 0          ' If string longer than this, start new row.  A ZERO value turns this off.
                        '...if you use lenLim, variable record lengths can break table structure.
    
    ' Set up assorted variables
    rOut = rStart
    cOut = cStart
    Sheet1.Cells(rStart, cStart).Activate ' This is the starting output cell.
    cStart = cStart - 1 ' Pay no attention to the man behind the curtain!
    
    ' Initialize nDex
    ' The nDex crawls through the Source, leaving nDex2 behind.  When it finds a delimiter, it grabs _
    ' what is in between the two NDex counters.  Then it brings up nDex2 and continues.  This is like _
    ' an inch-worm process through the source data.  It's smart enough to know to look for the next _
    ' quote after finding a quote.  This way it won't have to check EVERY character of data.
    ' A future version will increase speed dramatically by looking ahead for next delimiter.
    nDex = 1
    nDex2 = nDex
    
    ' MAIN LOOP
    Do While nDex <= TLen
        nDexChr = Mid(Src, nDex, 1) ' Get the character sitting at the nDex location
    
        ' Find what's at the nDex location
        If nDexChr = """" Then  ' Is it a quote?
            nDex2 = nDex        ' Bring up the tail
            nDex = InStr(nDex2 + 1, Src, """")  ' Find the next quote
            n2This = Mid(Src, nDex2 + 1, (nDex - nDex2) - 1)    'Get what is in the quotes
            ws.Cells(rOut, cOut) = n2This ' Dump the first found data here and now.
            records = records + 1
            nDex = nDex + 1 ' increment the inchworm
            nDex2 = nDex    ' ...and bring up the tail
            cOut = cOut + 1
                            
        ElseIf nDexChr = "," Then ' Is it a comma?
            If nDex2 <> nDex Then ' Should we look back?
                n2This = Mid(Src, nDex2 + 1, (nDex - nDex2) - 1)    ' Get what's between the head and tail.
                ws.Cells(rOut, cOut) = n2This   ' Dump data into cell
                records = records + 1
                cOut = cOut + 1 ' next output cell in a new column
            End If
            nDex = nDex + 1
            nDex2 = nDex
            ' encountered comma now see if we should start new line.
            If (cOut >= cCR And columnsCR > 0) Or (Len(n2This) > lenLim And lenLim <> 0) Then
                rOut = rOut + 1
                cOut = cStart
                cCR = cStart + columnsCR
            End If
                       
        ElseIf nDexChr = "}" Then
            cStart = cStart - 1
            cCR = cStart + columnsCR
            If nDex <> nDex2 Then   ' didn't start here so look back.
                n2This = Mid(Src, nDex2 + 1, (nDex - nDex2) - 1)
                ws.Cells(rOut, cOut) = n2This
                records = records + 1
            End If
            nDex = nDex + 1
            nDex2 = nDex
           
            If InStr(nDex, Src, ",") = nDex Then    ' is this character a comma?
                rOut = rOut + 1
                cOut = cStart
            Else:
                cOut = cOut + 1
            End If
            nDex = nDex + 1
            
        ElseIf nDexChr = "{" Then
            cStart = cStart + 1
            If cOut < cStart Then
                cOut = cStart
            End If
            cCR = cStart + columnsCR
            nDex = nDex + 1
        
        Else:
            nDex = nDex + 1
        End If
                
        Loop
        MsgBox records & " total records were parsed."
    
End Sub

Function Base64Encode(sText)
    Dim oXML, oNode
    Set oXML = CreateObject("Msxml2.DOMDocument.3.0")
    Set oNode = oXML.createElement("base64")
    oNode.DataType = "bin.base64"
    oNode.nodeTypedValue = Stream_StringToBinary(sText)
    Base64Encode = oNode.Text
    Set oNode = Nothing
    Set oXML = Nothing
End Function


'Stream_StringToBinary Function 2003 Antonin Foller, http://www.motobit.com
'Text - string parameter To convert To binary data
Function Stream_StringToBinary(Text)
  Const adTypeText = 2
  Const adTypeBinary = 1

  'Create Stream object
  Dim BinaryStream 'As New Stream
  Set BinaryStream = CreateObject("ADODB.Stream")

  'Specify stream type - we want To save text/string data.
  BinaryStream.Type = adTypeText

  'Specify charset For the source text (unicode) data.
  BinaryStream.Charset = "us-ascii"

  'Open the stream And write text/string data To the object
  BinaryStream.Open
  BinaryStream.WriteText Text

  'Change stream type To binary
  BinaryStream.Position = 0
  BinaryStream.Type = adTypeBinary

  'Ignore first two bytes - sign of
  BinaryStream.Position = 0

  'Open the stream And get binary data from the object
  Stream_StringToBinary = BinaryStream.Read

  Set BinaryStream = Nothing
End Function

'Stream_BinaryToString Function
'2003 Antonin Foller, http://www.motobit.com
'Binary - VT_UI1 | VT_ARRAY data To convert To a string
Function Stream_BinaryToString(Binary)
  Const adTypeText = 2
  Const adTypeBinary = 1

  'Create Stream object
  Dim BinaryStream 'As New Stream
  Set BinaryStream = CreateObject("ADODB.Stream")

  'Specify stream type - we want To save text/string data.
  BinaryStream.Type = adTypeBinary

  'Open the stream And write text/string data To the object
  BinaryStream.Open
  BinaryStream.Write Binary

  'Change stream type To binary
  BinaryStream.Position = 0
  BinaryStream.Type = adTypeText

  'Specify charset For the source text (unicode) data.
  BinaryStream.Charset = "us-ascii"

  'Open the stream And get binary data from the object
  Stream_BinaryToString = BinaryStream.ReadText
  Set BinaryStream = Nothing
End Function

    DOCUMENTATION

  • Welcome
  • Introduction
  • Nutritics Objects
  • Functions
  • LIST
  • DETAIL
  • CREATE
  • MODIFY
  • DELETE
  • ADMIN
  • HELP
  • Response Codes
  • Allergens
  • What's new in v1.2

v1.2Welcome

Nutritics API allows you to leverage the power of the world's favourite nutrition engine in your own app, program or website. Integration requires you to either be or to hire a developer. The API can be accessed from any programming language which can connect to the internet.

Most common uses for our API

  • Search our vast international databases
  • Analyse recipes from your own app or platform
  • Analyse a diet from your own app or platform
  • Generate a meal plan from your own app or platform
  • Control Nutritics user data

Introduction

Working with the API is very straight forward. All requests are made via HTTPS URLs. Each URL contains a set of parameters which specify the data you wish to retrieve. The data is always returned in JSON format.

For example, here's a simple request which searches our database for the keyword "banana" https://[USERNAME]:[PASSWORD]@www.nutritics.com/api/v1.2/LIST/food=banana

API explorer

You can use our powerful API explorer to build and test your requests before deploying them. The explorer will automatically generate a basic connection script in the most common coding languages to get you up and running quickly.

Syntax for requests

https://{USERNAME}:{PASSWORD}@www.nutritics.com/api/{API_VERSION}/{FUNCTION}/user={USER_ID}&{OBJECT}={ID OR GROUP}&[other parameters...]

Parameters after the last forward slash can be listed in any order.

Please note, the following characters are in use by the API engine and may break certain requests unless URL encoded:
{ ' } / \ | ¦ ~ > < + - , : " [ ]

Request Methods

Nutritics API supports both HTTP GET and HTTP POST methods. For simplicity, the GET method is used throughout our documentation. Please note however that HTML GET maximum URL length is 2048 characters so you will need to use the POST method if you need to make very long requests.

Required Parameters

The following parameters are required on all requests.

{USERNAME}:{PASSWORD}

Your developer username & Password

{API_VERSION}

Currently v1.2

{FUNCTION}

The action you wish to perform. Read more about functions.
function description
LIST Search and retrieve a list of Nutritics Objects or any set of data within them
CREATE Create a new Nutritics Object and return it's calculated values
MODIFY Edit a Nutritics Object
DELETE Remove a Nutritics Object

{OBJECT}

The type of data you wish to work with. A description of each of our core objects is listed below. Read more about objects.

object parent description
user dev A Nutritics account
client user A customer of a Nutritics user
food user A base food or ingredient
recipe user Multiple foods are combined to form a recipe
activity system An exercise or physical action
dietlog client A list of foods a client has eaten over a given period
mealplan client A special diet prescribed by a user for their client

Return Data

All requests return a stripped Nutritics object in JSON format. The following attributes are appended to all returned objects

Attribute Type description
status int(3)int: A numeric value without a decimal Response code of your request
msg stringstring: Letters, numbers, or other types of characters A message containing errors or warnings regarding your request.
queryTime intint: A numeric value without a decimal Number of miliseconds the server took to process your request
id intint: A numeric value without a decimal Returned only with 404 errors to specify the nutritics ID of the missing component.
warning stringstring: Letters, numbers, or other types of characters Returned only when something has gone wrong but your request was still processed successfully.

Debugging

You may append &debug=1 to any request to see a breakdown of all the data the API is using to calculate its response to your request. This can give useful insight when debugging your application.

Nutritics Objects

Data is sent and received from the API in Nutritics objects. The tables below detail all available parameters for objects. Note that all functions return a stripped object, which will not contain all available fields. If you need fields which are not returned by default, you may use the DETAIL function to specify these.

  • Foods
  • Recipes
  • Clients
  • Diet Logs
  • Meal Plans
  • Outlet
  • Orders
  • Nutrients
  • Portions
  • Menus
  • Components
  • Special
Attribute Permission Type Unit Description Group Default for:
coo Read/Write list of arrayslist of arrays: A list of array objects, separated by commas, each containing multiple variables. Country of origin
id Read int(19)int: A numeric value without a decimal Nutritics internal ID System LIST/DETAIL
id2 Read int(20)int: A numeric value without a decimal System
ifc Read string(17)string: Letters, numbers, or other types of characters (International Food Code) Universally unique identifier System LIST/DETAIL
isLive Read boolean(1)boolean: A true or false variable Is this item public on Nutritics Search & API System
isRecipe Read boolean(1)boolean: A true or false variable Is Recipe (1=yes) System
userID Read int(10)int: A numeric value without a decimal ID of the owner of this object System LIST/DETAIL
portionID Read int(10)int: A numeric value without a decimal Portion ID System
photoID Read int(12)int: A numeric value without a decimal Used to map an existing photo onto this food System
portionPhotoID Read int(12)int: A numeric value without a decimal Used to map an existing portion photo onto this food
moddate Read datedate: A timestamp in unix timestamp format for inputs or Y-M-D H:M:S format for outputs The last modified date and time of this object in the UTC or GMT timezone System LIST/DETAIL
portions Read/Write list of arrayslist of arrays: A list of array objects, separated by commas, each containing multiple variables. List of available portions for this food
foodlabel Read list of arrayslist of arrays: A list of array objects, separated by commas, each containing multiple variables. EU food label data including traffic light colours
costs Read/Write currencycurrency: Ingredient costs System
claims Read/Write arrayarray: A package containing multiple variables, usually containing internal labels for each
allergens Read list of arrayslist of arrays: A list of array objects, separated by commas, each containing multiple variables. Allergens and dietary properties, grouped by type
sharing Read/Write list of arrayslist of arrays: A list of array objects, separated by commas, each containing multiple variables. Share this food
cmethod Read arrayarray: A package containing multiple variables, usually containing internal labels for each cmethod System
customfields Read/Write arrayarray: A package containing multiple variables, usually containing internal labels for each Populatable only via the Nutritics front-end, this custom data can be retrieved through the API
code Read/Write string(255)string: Letters, numbers, or other types of characters Owner Food Identifier (food code, item number, etc).... Categorisation LIST/DETAIL
* cat (Required) Read/Write string(20)string: Letters, numbers, or other types of characters Nutritics standardised food category (see HELP function for a list of available categories) Categorisation LIST/DETAIL
groups Read/Write array(65535)array: A package containing multiple variables, usually containing internal labels for each List of folders or labels the owner has tagged to this object Categorisation
interID Read int(10)int: A numeric value without a decimal Groups the same foods from different countries Categorisation
barcode Read/Write string(30)string: Letters, numbers, or other types of characters Barcode Categorisation LIST
quid Read/Write stringstring: Letters, numbers, or other types of characters Ingredient List
src Read string(6)string: Letters, numbers, or other types of characters Identifier for source database Categorisation LIST/DETAIL
previousCode Read/Write string(255)string: Letters, numbers, or other types of characters src DB Old Food Code
srcCat Read/Write string(70)string: Letters, numbers, or other types of characters src DB Category Categorisation
name Read/Write string(255)string: Letters, numbers, or other types of characters Name of this object Properties LIST/DETAIL
description Read/Write string(65535)string: Letters, numbers, or other types of characters Optional description of this object Properties DETAIL
isWholeFood Read/Write boolean(1)boolean: A true or false variable Single Ingredient Item LIST
brand Read/Write string(60)string: Letters, numbers, or other types of characters Brand
healthScore Read float(2)float: A numeric value which can contain a decimal Health Score
specificGravity Read (12): specificGravity
isMls Read boolean(1)boolean: A true or false variable isMls
ediblePortion Read (12): Edible Percentage
liquid Read/Write boolean(3)boolean: A true or false variable Is this food a liquid?
storage Read/Write string(255)string: Letters, numbers, or other types of characters Text instructions for storing this recipe DETAIL
shelfLife Read/Write string(255)string: Letters, numbers, or other types of characters Text instructions for expiry of this food (ex: 6 Days 5 Hours 40 Mimutes OR 8980) LIST
notes Read/Write stringstring: Letters, numbers, or other types of characters Notes for this food
popularityScore Read int(10)int: A numeric value without a decimal Popularity Properties
portionCount Read/Write int(12)int: A numeric value without a decimal Number of Servings DETAIL
quantity Read array(3)array: A package containing multiple variables, usually containing internal labels for each Quantity DETAIL
products Read/Write formulaformula:
p1 Read/Write string(100)string: Letters, numbers, or other types of characters Portion name 1
s5 Read/Write string(5)string: Letters, numbers, or other types of characters Portion price 5
s4 Read/Write string(5)string: Letters, numbers, or other types of characters Portion price 4
s3 Read/Write string(5)string: Letters, numbers, or other types of characters Portion price 3
s2 Read/Write string(5)string: Letters, numbers, or other types of characters Portion price 2
s1 Read/Write string(5)string: Letters, numbers, or other types of characters Portion price 1
q1 Read/Write string(22)string: Letters, numbers, or other types of characters Portion quantity 1
p2 Read/Write string(100)string: Letters, numbers, or other types of characters Portion name 2
q2 Read/Write string(22)string: Letters, numbers, or other types of characters Portion quantity 2
p3 Read/Write string(100)string: Letters, numbers, or other types of characters Portion name 3
q3 Read/Write string(22)string: Letters, numbers, or other types of characters Portion quantity 3
p4 Read/Write string(100)string: Letters, numbers, or other types of characters Portion name 4
q4 Read/Write string(22)string: Letters, numbers, or other types of characters Portion quantity 4
p5 Read/Write string(100)string: Letters, numbers, or other types of characters Portion name 5
q5 Read/Write string(22)string: Letters, numbers, or other types of characters Portion quantity 5
csvurl Read urlurl: A web address Web link to full nutrient CSV export DETAIL
reporturl Read urlurl: A web address Web link to the full nutrition report LIST/DETAIL
photo Read urlurl: A web address URL of a photo for this food. Default dimensions are 240x240. Dimensions may be modified manually after the url is retrieved. Max dimensions are 900x900. LIST/DETAIL
gluten Read/Write int(3)int: A numeric value without a decimal Cereals Containing Gluten
oats Read/Write int(3)int: A numeric value without a decimal Oats
wheat Read/Write int(3)int: A numeric value without a decimal Wheat
barley Read/Write int(3)int: A numeric value without a decimal Barley
rye Read/Write int(3)int: A numeric value without a decimal Rye
nuts Read/Write int(3)int: A numeric value without a decimal Tree Nuts
hazelnuts Read/Write int(3)int: A numeric value without a decimal Hazelnuts
pecan Read/Write int(3)int: A numeric value without a decimal Pecans
almonds Read/Write int(3)int: A numeric value without a decimal Almonds
cashews Read/Write int(3)int: A numeric value without a decimal Cashews
walnut Read/Write int(3)int: A numeric value without a decimal Walnuts
brazil Read/Write int(3)int: A numeric value without a decimal Brazil Nuts
pistachio Read/Write int(3)int: A numeric value without a decimal Pistachio Nuts
macadamia Read/Write int(3)int: A numeric value without a decimal Macadamia Nuts
beech Read/Write int(3)int: A numeric value without a decimal Beech
chestnut Read/Write int(3)int: A numeric value without a decimal Chestnut
chinquapin Read/Write int(3)int: A numeric value without a decimal Chinquapin
coconut Read/Write int(3)int: A numeric value without a decimal Coconut
ginkgo Read/Write int(3)int: A numeric value without a decimal Ginkgo
hickory Read/Write int(3)int: A numeric value without a decimal Hickory
lichee Read/Write int(3)int: A numeric value without a decimal Lichee
pili Read/Write int(3)int: A numeric value without a decimal Pili
pine Read/Write int(3)int: A numeric value without a decimal Pine
sheanut Read/Write int(3)int: A numeric value without a decimal Sheanut
peanuts Read/Write int(3)int: A numeric value without a decimal Peanuts
eggs Read/Write int(3)int: A numeric value without a decimal Eggs
milk Read/Write int(3)int: A numeric value without a decimal Milk DETAIL
fish Read/Write int(3)int: A numeric value without a decimal Fish
crustaceans Read/Write int(3)int: A numeric value without a decimal Crustaceans
molluscs Read/Write int(3)int: A numeric value without a decimal Molluscs
celery Read/Write int(3)int: A numeric value without a decimal Celery
vegetarian Read/Write boolean(3)boolean: A true or false variable Vegetarian (1=yes)
kola Read/Write int(3)int: A numeric value without a decimal Kola
mustard Read/Write int(3)int: A numeric value without a decimal Mustard DETAIL
vegan Read/Write boolean(3)boolean: A true or false variable Vegan (1=yes)
halal Read/Write boolean(3)boolean: A true or false variable Halal (1=yes)
glutenfree Read/Write boolean(3)boolean: A true or false variable Gluten Free (1=yes)
sesame Read/Write int(3)int: A numeric value without a decimal Sesame
kosher Read/Write boolean(3)boolean: A true or false variable Kosher (1=yes)
soya Read/Write int(3)int: A numeric value without a decimal Soya
sulphites Read/Write int(3)int: A numeric value without a decimal Sulphites
lupin Read/Write int(3)int: A numeric value without a decimal Lupin
energyKcal Read/Write floatfloat: A numeric value which can contain a decimal kcal Set user defined energyKcal (labelvalue) in CREATE request, and get labelConversions table based calculated value in LIST request Energy DETAIL
energyKj Read/Write floatfloat: A numeric value which can contain a decimal kJ Energy Energy DETAIL
carbohydrate Read/Write floatfloat: A numeric value which can contain a decimal g CHO is by weight (UK/EU) or by difference (US) at 4kcal per gram Macronutrients DETAIL
protein Read/Write floatfloat: A numeric value which can contain a decimal g Protein Macronutrients DETAIL
fat Read/Write floatfloat: A numeric value which can contain a decimal g Fat Macronutrients DETAIL
water Read/Write float(12)float: A numeric value which can contain a decimal g Water (Moisture) Macronutrients DETAIL
waterDr Read floatfloat: A numeric value which can contain a decimal g Water from Drinks Macronutrients DETAIL
alcohol Read/Write floatfloat: A numeric value which can contain a decimal g Alcohol Macronutrients
starch Read/Write floatfloat: A numeric value which can contain a decimal g Starch Carbohydrate Components DETAIL
oligosaccharide Read/Write floatfloat: A numeric value which can contain a decimal g Includes maltodextrins, fructooligosaccharides,maltotriose (in beer), inulin Carbohydrate Components
sugars Read/Write floatfloat: A numeric value which can contain a decimal g Sugars Carbohydrate Components DETAIL
freesugars Read/Write floatfloat: A numeric value which can contain a decimal g Often called added sugar on labels Carbohydrate Components DETAIL
sucrose Read/Write floatfloat: A numeric value which can contain a decimal g Sucrose Carbohydrate Components
glucose Read/Write floatfloat: A numeric value which can contain a decimal g Glucose Carbohydrate Components
lactose Read/Write floatfloat: A numeric value which can contain a decimal g lactose Carbohydrate Components
fructose Read/Write floatfloat: A numeric value which can contain a decimal g Fructose Carbohydrate Components
galactose Read/Write floatfloat: A numeric value which can contain a decimal g Galactose Carbohydrate Components
maltose Read/Write floatfloat: A numeric value which can contain a decimal g maltose Carbohydrate Components
fibre Read/Write floatfloat: A numeric value which can contain a decimal g Fibre Carbohydrate Components DETAIL
nsp Read/Write floatfloat: A numeric value which can contain a decimal g NSP (Englyst) Carbohydrate Components DETAIL
satfat Read/Write floatfloat: A numeric value which can contain a decimal g Saturated Fat Fat Components DETAIL
monos Read/Write floatfloat: A numeric value which can contain a decimal g Monounsaturated Fat Fat Components
poly Read/Write floatfloat: A numeric value which can contain a decimal g Polyunsaturated Fat Fat Components
n3poly Read/Write floatfloat: A numeric value which can contain a decimal g Omega-3 (Total) Fat Components
n6poly Read/Write floatfloat: A numeric value which can contain a decimal g Omega-6 (Total) Fat Components
trans Read/Write floatfloat: A numeric value which can contain a decimal g Trans Fats (Total) Fat Components
cholesterol Read/Write floatfloat: A numeric value which can contain a decimal mg Cholesterol Fat Components
vita Read/Write floatfloat: A numeric value which can contain a decimal ug carotene/6 + retinol = Vitamin A Vitamins
retinol Read/Write floatfloat: A numeric value which can contain a decimal ug Retinol (preformed) Vitamins
carotene Read/Write floatfloat: A numeric value which can contain a decimal ug Beta carotene + alpha carotene x.5 + beta cryptoxanthins x .5 Vitamins
vitd Read/Write floatfloat: A numeric value which can contain a decimal ug Vitamin D3 (cholecalciferol) + Vitamin D2 (ergocalciferol) +(25OHD3)x5 Vitamins
vite Read/Write floatfloat: A numeric value which can contain a decimal mg as alpha toceopherol equivalents (factors in M&W p14) Vitamins
vitk Read/Write floatfloat: A numeric value which can contain a decimal ug Vitamin K1 (Phylloquinone) Vitamins
thiamin Read/Write floatfloat: A numeric value which can contain a decimal mg Thiamin (B1) Vitamins
riboflavin Read/Write floatfloat: A numeric value which can contain a decimal mg Riboflavin (B2) Vitamins
niacin Read/Write floatfloat: A numeric value which can contain a decimal mg The sum of nicotinic acid and nicotinaminde Vitamins
niacineqv Read/Write floatfloat: A numeric value which can contain a decimal mg Niacin + tryptophan/60 Vitamins
pantothenate Read/Write floatfloat: A numeric value which can contain a decimal mg Pantothenate (B5) Vitamins
vitb6 Read/Write floatfloat: A numeric value which can contain a decimal mg Vitamin B6 (Pyridoxine) Vitamins
biotin Read/Write floatfloat: A numeric value which can contain a decimal ug Biotin (B7) Vitamins
folate Read floatfloat: A numeric value which can contain a decimal ug Total Folates Vitamins DETAIL
folateDFE Read floatfloat: A numeric value which can contain a decimal ug folatefood +1.7 * folicAcidFortified (synthetic) Vitamins DETAIL
vitb12 Read/Write floatfloat: A numeric value which can contain a decimal ug Vitamin B12 (Cobalamin) Vitamins
vitb12Fortified Read/Write floatfloat: A numeric value which can contain a decimal ug Vitamin B12 (Synthetic) Vitamins
vitc Read/Write floatfloat: A numeric value which can contain a decimal mg Vitamin C Vitamins DETAIL
sodium Read/Write floatfloat: A numeric value which can contain a decimal mg Sodium (Na) Minerals & Trace Elements DETAIL
salt Read/Write float(16)float: A numeric value which can contain a decimal g Salt Minerals & Trace Elements
potassium Read/Write floatfloat: A numeric value which can contain a decimal mg Potassium (K) Minerals & Trace Elements
calcium Read/Write floatfloat: A numeric value which can contain a decimal mg Calcium (Ca) Minerals & Trace Elements
magnesium Read/Write floatfloat: A numeric value which can contain a decimal mg Magnesium (Mg) Minerals & Trace Elements
phosphorus Read/Write floatfloat: A numeric value which can contain a decimal mg Phosphorus (P) Minerals & Trace Elements
iron Read/Write floatfloat: A numeric value which can contain a decimal mg Iron (Fe) Minerals & Trace Elements
copper Read/Write floatfloat: A numeric value which can contain a decimal mg Copper (Cu) Minerals & Trace Elements
zinc Read/Write floatfloat: A numeric value which can contain a decimal mg Zinc (Zn) Minerals & Trace Elements
chloride Read/Write floatfloat: A numeric value which can contain a decimal mg Chloride (Cl) Minerals & Trace Elements DETAIL
manganese Read floatfloat: A numeric value which can contain a decimal mg Manganese (Mn) Minerals & Trace Elements DETAIL
selenium Read/Write floatfloat: A numeric value which can contain a decimal ug Selenium (Se) Minerals & Trace Elements
iodine Read/Write floatfloat: A numeric value which can contain a decimal ug Iodine (I) Minerals & Trace Elements
gi Read/Write floatfloat: A numeric value which can contain a decimal Glycemic Index Glycemic Impact
gl Read/Write floatfloat: A numeric value which can contain a decimal Glycemic Load Glycemic Impact
polyols Read/Write floatfloat: A numeric value which can contain a decimal g Formerly excluded erythritol. Now interchangeable with polyols Sugar Alcohols DETAIL
tryptophan Read/Write floatfloat: A numeric value which can contain a decimal mg Tryptophan Amino Acids
nitrogen Read/Write floatfloat: A numeric value which can contain a decimal g Nitrogen Other DETAIL
caffeine Read floatfloat: A numeric value which can contain a decimal mg Caffeine Other
caffeineSrc Read string(10)string: Letters, numbers, or other types of characters caffeineSrc
nutriscore Read arrayarray: A package containing multiple variables, usually containing internal labels for each Nutriscore - 5-Colour Nutrition label
Attribute Access Data Type Description Default
coo Read/Write list of arrayslist of arrays: A list of array objects, separated by commas, each containing multiple variables.
id Read int(19)int: A numeric value without a decimal LIST/DETAIL
id2 Read int(20)int: A numeric value without a decimal
ifc Read string(17)string: Letters, numbers, or other types of characters LIST/DETAIL
isLive Read boolean(1)boolean: A true or false variable
isRecipe Read boolean(1)boolean: A true or false variable
userID Read int(10)int: A numeric value without a decimal LIST/DETAIL
portionID Read int(10)int: A numeric value without a decimal
photoID Read int(12)int: A numeric value without a decimal
portionPhotoID Read int(12)int: A numeric value without a decimal
moddate Read datedate: A timestamp in unix timestamp format for inputs or Y-M-D H:M:S format for outputs LIST/DETAIL
portions Read/Write list of arrayslist of arrays: A list of array objects, separated by commas, each containing multiple variables.
quid Read/Write stringstring: Letters, numbers, or other types of characters
foodlabel Read list of arrayslist of arrays: A list of array objects, separated by commas, each containing multiple variables.
costs Read currencycurrency:
claims Read/Write arrayarray: A package containing multiple variables, usually containing internal labels for each
allergens Read list of arrayslist of arrays: A list of array objects, separated by commas, each containing multiple variables.
sharing Read/Write list of arrayslist of arrays: A list of array objects, separated by commas, each containing multiple variables.
components Read/Write list of arrayslist of arrays: A list of array objects, separated by commas, each containing multiple variables.
cmethod Read arrayarray: A package containing multiple variables, usually containing internal labels for each
customfields Read/Write arrayarray: A package containing multiple variables, usually containing internal labels for each
code Read/Write string(255)string: Letters, numbers, or other types of characters LIST/DETAIL
cat Read/Write string(20)string: Letters, numbers, or other types of characters LIST/DETAIL
groups Read/Write array(65535)array: A package containing multiple variables, usually containing internal labels for each
interID Read int(10)int: A numeric value without a decimal
barcode Read/Write string(30)string: Letters, numbers, or other types of characters LIST
src Read string(6)string: Letters, numbers, or other types of characters LIST/DETAIL
previousCode Read/Write string(255)string: Letters, numbers, or other types of characters
srcCat Read/Write string(70)string: Letters, numbers, or other types of characters
name Read/Write string(255)string: Letters, numbers, or other types of characters LIST/DETAIL
description Read/Write string(65535)string: Letters, numbers, or other types of characters DETAIL
isWholeFood Read/Write boolean(1)boolean: A true or false variable LIST
brand Read/Write string(60)string: Letters, numbers, or other types of characters
healthScore Read float(2)float: A numeric value which can contain a decimal
specificGravity Read (12):
isMls Read boolean(1)boolean: A true or false variable
recipeConversionFactor Read/Write float(12)float: A numeric value which can contain a decimal DETAIL
totalRecipeWeight Read int(12)int: A numeric value without a decimal
ediblePortion Read (12):
weightAfterCooking Read/Write decimaldecimal: A numeric value with a decimal DETAIL
liquid Read/Write boolean(3)boolean: A true or false variable
storage Read/Write string(255)string: Letters, numbers, or other types of characters DETAIL
shelfLife Read/Write string(255)string: Letters, numbers, or other types of characters LIST
notes Read/Write stringstring: Letters, numbers, or other types of characters
instructions Read stringstring: Letters, numbers, or other types of characters
popularityScore Read int(10)int: A numeric value without a decimal
portionCount Read/Write int(12)int: A numeric value without a decimal DETAIL
quantity Read array(3)array: A package containing multiple variables, usually containing internal labels for each DETAIL
products Read/Write formulaformula:
p1 Read/Write string(100)string: Letters, numbers, or other types of characters
s5 Read/Write string(5)string: Letters, numbers, or other types of characters
s4 Read/Write string(5)string: Letters, numbers, or other types of characters
s3 Read/Write string(5)string: Letters, numbers, or other types of characters
s2 Read/Write string(5)string: Letters, numbers, or other types of characters
s1 Read/Write string(5)string: Letters, numbers, or other types of characters
q1 Read/Write string(22)string: Letters, numbers, or other types of characters
p2 Read/Write string(100)string: Letters, numbers, or other types of characters
q2 Read/Write string(22)string: Letters, numbers, or other types of characters
p3 Read/Write string(100)string: Letters, numbers, or other types of characters
q3 Read/Write string(22)string: Letters, numbers, or other types of characters
p4 Read/Write string(100)string: Letters, numbers, or other types of characters
q4 Read/Write string(22)string: Letters, numbers, or other types of characters
p5 Read/Write string(100)string: Letters, numbers, or other types of characters
q5 Read/Write string(22)string: Letters, numbers, or other types of characters
csvurl Read urlurl: A web address DETAIL
reporturl Read urlurl: A web address LIST/DETAIL
photo Read urlurl: A web address LIST/DETAIL
gluten Read/Write int(3)int: A numeric value without a decimal
oats Read/Write int(3)int: A numeric value without a decimal
wheat Read/Write int(3)int: A numeric value without a decimal
barley Read/Write int(3)int: A numeric value without a decimal
rye Read/Write int(3)int: A numeric value without a decimal
nuts Read/Write int(3)int: A numeric value without a decimal
hazelnuts Read/Write int(3)int: A numeric value without a decimal
pecan Read/Write int(3)int: A numeric value without a decimal
almonds Read/Write int(3)int: A numeric value without a decimal
cashews Read/Write int(3)int: A numeric value without a decimal
walnut Read/Write int(3)int: A numeric value without a decimal
brazil Read/Write int(3)int: A numeric value without a decimal
pistachio Read/Write int(3)int: A numeric value without a decimal
macadamia Read/Write int(3)int: A numeric value without a decimal
beech Read/Write int(3)int: A numeric value without a decimal
chestnut Read/Write int(3)int: A numeric value without a decimal
chinquapin Read/Write int(3)int: A numeric value without a decimal
coconut Read/Write int(3)int: A numeric value without a decimal
ginkgo Read/Write int(3)int: A numeric value without a decimal
hickory Read/Write int(3)int: A numeric value without a decimal
lichee Read/Write int(3)int: A numeric value without a decimal
pili Read/Write int(3)int: A numeric value without a decimal
pine Read/Write int(3)int: A numeric value without a decimal
sheanut Read/Write int(3)int: A numeric value without a decimal
peanuts Read/Write int(3)int: A numeric value without a decimal
eggs Read/Write int(3)int: A numeric value without a decimal
milk Read/Write int(3)int: A numeric value without a decimal DETAIL
fish Read/Write int(3)int: A numeric value without a decimal
crustaceans Read/Write int(3)int: A numeric value without a decimal
molluscs Read/Write int(3)int: A numeric value without a decimal
celery Read/Write int(3)int: A numeric value without a decimal
vegetarian Read/Write boolean(3)boolean: A true or false variable
kola Read/Write int(3)int: A numeric value without a decimal
mustard Read/Write int(3)int: A numeric value without a decimal DETAIL
vegan Read/Write boolean(3)boolean: A true or false variable
halal Read/Write boolean(3)boolean: A true or false variable
glutenfree Read/Write boolean(3)boolean: A true or false variable
sesame Read/Write int(3)int: A numeric value without a decimal
kosher Read/Write boolean(3)boolean: A true or false variable
soya Read/Write int(3)int: A numeric value without a decimal
sulphites Read/Write int(3)int: A numeric value without a decimal
lupin Read/Write int(3)int: A numeric value without a decimal
energyKcal Read/Write floatfloat: A numeric value which can contain a decimal DETAIL
energyKj Read/Write floatfloat: A numeric value which can contain a decimal DETAIL
carbohydrate Read/Write floatfloat: A numeric value which can contain a decimal DETAIL
protein Read/Write floatfloat: A numeric value which can contain a decimal DETAIL
fat Read/Write floatfloat: A numeric value which can contain a decimal DETAIL
water Read/Write float(12)float: A numeric value which can contain a decimal DETAIL
waterDr Read floatfloat: A numeric value which can contain a decimal DETAIL
alcohol Read/Write floatfloat: A numeric value which can contain a decimal
starch Read/Write floatfloat: A numeric value which can contain a decimal DETAIL
oligosaccharide Read/Write floatfloat: A numeric value which can contain a decimal
sugars Read/Write floatfloat: A numeric value which can contain a decimal DETAIL
freesugars Read/Write floatfloat: A numeric value which can contain a decimal DETAIL
sucrose Read/Write floatfloat: A numeric value which can contain a decimal
glucose Read/Write floatfloat: A numeric value which can contain a decimal
lactose Read/Write floatfloat: A numeric value which can contain a decimal
fructose Read/Write floatfloat: A numeric value which can contain a decimal
galactose Read/Write floatfloat: A numeric value which can contain a decimal
maltose Read/Write floatfloat: A numeric value which can contain a decimal
fibre Read/Write floatfloat: A numeric value which can contain a decimal DETAIL
nsp Read/Write floatfloat: A numeric value which can contain a decimal DETAIL
satfat Read/Write floatfloat: A numeric value which can contain a decimal DETAIL
monos Read/Write floatfloat: A numeric value which can contain a decimal
poly Read/Write floatfloat: A numeric value which can contain a decimal
n3poly Read/Write floatfloat: A numeric value which can contain a decimal
n6poly Read/Write floatfloat: A numeric value which can contain a decimal
trans Read/Write floatfloat: A numeric value which can contain a decimal
cholesterol Read/Write floatfloat: A numeric value which can contain a decimal
vita Read/Write floatfloat: A numeric value which can contain a decimal
retinol Read/Write floatfloat: A numeric value which can contain a decimal
carotene Read/Write floatfloat: A numeric value which can contain a decimal
vitd Read/Write floatfloat: A numeric value which can contain a decimal
vite Read/Write floatfloat: A numeric value which can contain a decimal
vitk Read/Write floatfloat: A numeric value which can contain a decimal
thiamin Read/Write floatfloat: A numeric value which can contain a decimal
riboflavin Read/Write floatfloat: A numeric value which can contain a decimal
niacin Read/Write floatfloat: A numeric value which can contain a decimal
niacineqv Read/Write floatfloat: A numeric value which can contain a decimal
pantothenate Read/Write floatfloat: A numeric value which can contain a decimal
vitb6 Read/Write floatfloat: A numeric value which can contain a decimal
biotin Read/Write floatfloat: A numeric value which can contain a decimal
folate Read floatfloat: A numeric value which can contain a decimal DETAIL
folateDFE Read floatfloat: A numeric value which can contain a decimal DETAIL
vitb12 Read/Write floatfloat: A numeric value which can contain a decimal
vitb12Fortified Read/Write floatfloat: A numeric value which can contain a decimal
vitc Read/Write floatfloat: A numeric value which can contain a decimal DETAIL
sodium Read/Write floatfloat: A numeric value which can contain a decimal DETAIL
salt Read/Write float(16)float: A numeric value which can contain a decimal
potassium Read/Write floatfloat: A numeric value which can contain a decimal
calcium Read/Write floatfloat: A numeric value which can contain a decimal
magnesium Read/Write floatfloat: A numeric value which can contain a decimal
phosphorus Read/Write floatfloat: A numeric value which can contain a decimal
iron Read/Write floatfloat: A numeric value which can contain a decimal
copper Read/Write floatfloat: A numeric value which can contain a decimal
zinc Read/Write floatfloat: A numeric value which can contain a decimal
chloride Read/Write floatfloat: A numeric value which can contain a decimal DETAIL
manganese Read floatfloat: A numeric value which can contain a decimal DETAIL
selenium Read/Write floatfloat: A numeric value which can contain a decimal
iodine Read/Write floatfloat: A numeric value which can contain a decimal
gi Read/Write floatfloat: A numeric value which can contain a decimal
gl Read/Write floatfloat: A numeric value which can contain a decimal
polyols Read/Write floatfloat: A numeric value which can contain a decimal DETAIL
tryptophan Read/Write floatfloat: A numeric value which can contain a decimal
nitrogen Read/Write floatfloat: A numeric value which can contain a decimal DETAIL
caffeine Read floatfloat: A numeric value which can contain a decimal
caffeineSrc Read string(10)string: Letters, numbers, or other types of characters
nutriscore Read arrayarray: A package containing multiple variables, usually containing internal labels for each
Attribute Access Data Type Description Default
id Read int(19)int: A numeric value without a decimal Nutritics internal unique identifier LIST/DETAIL
userID Read string(10)string: Letters, numbers, or other types of characters Nutritics unique identifier of the user who owns this client LIST/DETAIL
lastlogin Read datedate: A timestamp in unix timestamp format for inputs or Y-M-D H:M:S format for outputs Timestamp of last login to Libro smartphone app
modified Read datedate: A timestamp in unix timestamp format for inputs or Y-M-D H:M:S format for outputs Timestamp of the most recent update to this profile
forename Read/Write string(100)string: Letters, numbers, or other types of characters First Name LIST/DETAIL
surname Read/Write string(100)string: Letters, numbers, or other types of characters Surname LIST/DETAIL
username Read string(100)string: Letters, numbers, or other types of characters Username from Libro smartphone app
email Read/Write string(100)string: Letters, numbers, or other types of characters Email DETAIL
idno Read/Write string(100)string: Letters, numbers, or other types of characters Patient or customer identifier for 3rd party systems LIST/DETAIL
tel Read/Write string(20)string: Letters, numbers, or other types of characters Telephone Number DETAIL
mobile Read/Write string(20)string: Letters, numbers, or other types of characters Mobile Number DETAIL
address Read/Write string(255)string: Letters, numbers, or other types of characters Address DETAIL
country Read/Write string(100)string: Letters, numbers, or other types of characters Country LIST/DETAIL
dob Read/Write datedate: A timestamp in unix timestamp format for inputs or Y-M-D H:M:S format for outputs D.O.B (D-M-Y) DETAIL
groups Read/Write array(65535)array: A package containing multiple variables, usually containing internal labels for each Client Groups LIST/DETAIL
notes Read/Write string(65535)string: Letters, numbers, or other types of characters Notes / History
gender Read/Write char(1)char: A single character in lowercase Sex (m/f) DETAIL
weight Read/Write float(12)float: A numeric value which can contain a decimal Weight in grams DETAIL
height Read/Write float(12)float: A numeric value which can contain a decimal Height in cm DETAIL
calc_bmi Read/Write float(12)float: A numeric value which can contain a decimal Body Mass Index DETAIL
waist Read/Write float(12)float: A numeric value which can contain a decimal Waist circumference in cm DETAIL
hips Read/Write float(12)float: A numeric value which can contain a decimal Hip circumference in cm DETAIL
bodyfat Read/Write float(12)float: A numeric value which can contain a decimal Body Fat % DETAIL
fluidRetention Read/Write float(12)float: A numeric value which can contain a decimal How many kg of fluid does this client retain?
orderNotes Read/Write string(255)string: Letters, numbers, or other types of characters Meal Service Notes
bedGroup Read/Write stringstring: Letters, numbers, or other types of characters Ward/Floor
bedNo Read/Write stringstring: Letters, numbers, or other types of characters Bed Number
mobilityFactor Read/Write float(12)float: A numeric value which can contain a decimal Mobility factor of this client within a clinical environment
stressFactor Read string(50)string: Letters, numbers, or other types of characters Clinical condition which contributes to eer calculations
stressFactorPerc Read/Write float(12)float: A numeric value which can contain a decimal Percentage change in EER introduced by a stress factor
facility Read objectobject: Facility
feedType Read/Write string(35)string: Letters, numbers, or other types of characters Type of clinical feed required by this client
tGradeSolid Read/Write string(3)string: Letters, numbers, or other types of characters IDDSI Texture grade this client needs for solid foods (3-7a) DETAIL
tGradeLiquid Read/Write string(3)string: Letters, numbers, or other types of characters IDDSI Texture grade this client needs for liquids (0-4) DETAIL
halal Read/Write boolean(3)boolean: A true or false variable Diet Preference: Halal
vegan Read/Write boolean(3)boolean: A true or false variable Diet Preference: Vegan
vegetarian Read/Write boolean(3)boolean: A true or false variable Diet Preference: Vegetarian
glutenfree Read/Write boolean(3)boolean: A true or false variable Diet Preference: Gluten Free
kosher Read/Write boolean(3)boolean: A true or false variable Diet Preference: Kosher
gluten Read/Write boolean(3)boolean: A true or false variable Indicates that this client has an allergy to Cereals Containing Gluten
oats Read/Write boolean(3)boolean: A true or false variable Indicates that this client has an allergy to Oats
wheat Read/Write boolean(3)boolean: A true or false variable Indicates that this client has an allergy to Wheat
barley Read/Write boolean(3)boolean: A true or false variable Indicates that this client has an allergy to Barley
rye Read/Write boolean(3)boolean: A true or false variable Indicates that this client has an allergy to Rye
peanuts Read/Write boolean(3)boolean: A true or false variable Indicates that this client has an allergy to Peanuts
nuts Read/Write boolean(3)boolean: A true or false variable Indicates that this client has an allergy to Tree Nuts
hazelnuts Read/Write boolean(3)boolean: A true or false variable Indicates that this client has an allergy to Hazelnuts
almonds Read/Write boolean(3)boolean: A true or false variable Indicates that this client has an allergy to Almonds
cashews Read/Write boolean(3)boolean: A true or false variable Indicates that this client has an allergy to Cashews
walnut Read/Write boolean(3)boolean: A true or false variable Indicates that this client has an allergy to Walnuts
pecan Read/Write boolean(3)boolean: A true or false variable Indicates that this client has an allergy to Pecans
brazil Read/Write boolean(3)boolean: A true or false variable Indicates that this client has an allergy to Brazil Nuts
pistachio Read/Write boolean(3)boolean: A true or false variable Indicates that this client has an allergy to Pistachio Nuts
macadamia Read/Write boolean(3)boolean: A true or false variable Indicates that this client has an allergy to Macadamia Nuts
celery Read/Write boolean(3)boolean: A true or false variable Indicates that this client has an allergy to Celery
mustard Read/Write boolean(3)boolean: A true or false variable Indicates that this client has an allergy to Mustard
eggs Read/Write boolean(3)boolean: A true or false variable Indicates that this client has an allergy to Eggs
milk Read/Write boolean(3)boolean: A true or false variable Indicates that this client has an allergy to Milk
sesame Read/Write boolean(3)boolean: A true or false variable Indicates that this client has an allergy to Sesame
fish Read/Write boolean(3)boolean: A true or false variable Indicates that this client has an allergy to Fish
crustaceans Read/Write boolean(3)boolean: A true or false variable Indicates that this client has an allergy to Crustaceans
molluscs Read/Write boolean(3)boolean: A true or false variable Indicates that this client has an allergy to Molluscs
soya Read/Write boolean(3)boolean: A true or false variable Indicates that this client has an allergy to Soya
sulphites Read/Write boolean(3)boolean: A true or false variable Indicates that this client has an allergy to Sulphites
lupin Read/Write boolean(3)boolean: A true or false variable Indicates that this client has an allergy to Lupin
formula Read/Write string(255)string: Letters, numbers, or other types of characters Energy Calculation Formula DETAIL
drv Read arrayarray: A package containing multiple variables, usually containing internal labels for each Calculated Dietary Reference Values (Reference Intake amounts) for this client
occ_activity Read/Write int(50)int: A numeric value without a decimal Occupational Activity Level DETAIL
exe_activity Read/Write int(50)int: A numeric value without a decimal Exercise Level DETAIL
athletic Read/Write string(50)string: Letters, numbers, or other types of characters Athlethic Type DETAIL
pregnancy Read/Write string(50)string: Letters, numbers, or other types of characters Pregnancy DETAIL
EERadjust Read/Write int(12)int: A numeric value without a decimal Number of calories the client wants to gain/lose per day DETAIL
EERadjustRatio Read/Write int(12)int: A numeric value without a decimal Percentage of EER adjustment which comes from diet DETAIL
calc_pal Read/Write float(12)float: A numeric value which can contain a decimal Physical Activity Level DETAIL
calc_bmr Read/Write float(12)float: A numeric value which can contain a decimal Base Metabolic Rate - the number of kcal needed per day of rest (bed ridden) DETAIL
calc_energy Read/Write float(12)float: A numeric value which can contain a decimal Number of Kcal this client needs per day before adjustments for pregnancy or weightloss DETAIL
Attribute Access Data Type Description Default
logIDs Read formula(19)formula: Nutritics internal ID LIST/DETAIL
logDetailIDs Read formula(19)formula: id LIST/DETAIL
userID Read int(10)int: A numeric value without a decimal userID LIST/DETAIL
* clientID (Required) Read/Write int(19)int: A numeric value without a decimal clientID
startdate Read datedate: A timestamp in unix timestamp format for inputs or Y-M-D H:M:S format for outputs created LIST/DETAIL
name Read/Write string(255)string: Letters, numbers, or other types of characters name LIST
periodName Read string(10)string: Letters, numbers, or other types of characters periodName LIST/DETAIL
notes Read/Write string(65535)string: Letters, numbers, or other types of characters notes
foodIDs Read formula(19)formula: foodID LIST/DETAIL
recipeIDs Read formula(1)formula: foodID LIST/DETAIL
gender Read/Write char(1)char: A single character in lowercase Sex (m/f) LIST/DETAIL
Attribute Access Data Type Description Default
id Read int(19)int: A numeric value without a decimal Nutritics internal ID LIST/DETAIL
userID Read int(10)int: A numeric value without a decimal Owner ID LIST/DETAIL
* clientID (Required) Read int(19)int: A numeric value without a decimal Client ID LIST/DETAIL
name Read/Write string(255)string: Letters, numbers, or other types of characters Name LIST/DETAIL
mealnames Read array(65535)array: A package containing multiple variables, usually containing internal labels for each mealnames LIST/DETAIL
startdate Read/Write datedate: A timestamp in unix timestamp format for inputs or Y-M-D H:M:S format for outputs Start date LIST/DETAIL
notes Read/Write string(65535)string: Letters, numbers, or other types of characters Notes
rdaID Read int(19)int: A numeric value without a decimal Rda ID LIST/DETAIL
eersrc Read/Write string(6)string: Letters, numbers, or other types of characters EER source LIST/DETAIL
nutrients Read formulaformula: nutrients LIST/DETAIL
monitors Read array(65535)array: A package containing multiple variables, usually containing internal labels for each monitors LIST/DETAIL
energyKcal Read/Write floatfloat: A numeric value which can contain a decimal Energy DETAIL
carbohydrate Read/Write floatfloat: A numeric value which can contain a decimal CHO is by weight (UK/EU) or by difference (US) at 4kcal per gram DETAIL
protein Read/Write floatfloat: A numeric value which can contain a decimal Protein DETAIL
fat Read/Write floatfloat: A numeric value which can contain a decimal Fat DETAIL
fibre Read/Write floatfloat: A numeric value which can contain a decimal Fibre DETAIL
modified Read timestamptimestamp: Mealplan Modified Date LIST
Attribute Access Data Type Description Default
id Read int(19)int: A numeric value without a decimal LIST
userID Read bigint(10)bigint: LIST
name Read/Write string(255)string: Letters, numbers, or other types of characters Outlet Name LIST
shortdesc Read/Write string(100)string: Letters, numbers, or other types of characters Company Type LIST
address Read/Write string(255)string: Letters, numbers, or other types of characters Outlet Address LIST
types Read string(255)string: Letters, numbers, or other types of characters LIST
tags Read text(255)text: LIST
lat Read float(12)float: A numeric value which can contain a decimal LIST
lon Read float(12)float: A numeric value which can contain a decimal LIST
email Read/Write string(100)string: Letters, numbers, or other types of characters Outlet Email Address LIST
tel Read/Write string(20)string: Letters, numbers, or other types of characters Outlet Phone Number LIST
menuCount Read int(10)int: A numeric value without a decimal LIST
description Read/Write string(65535)string: Letters, numbers, or other types of characters Short Description / Intro LIST

List all outlets of all users that have given you access:

/LIST/outlet

List a outlet by id (which you have at least read access to):

/LIST/outlet=[outlet_ID]

List outlets of specific users:

/LIST/outlet=userID:[user_ID|user_ID]
Attribute Access Data Type Description Default
dueDate Read/Write datedate: A timestamp in unix timestamp format for inputs or Y-M-D H:M:S format for outputs When is this order due? LIST
tGradeLiquid Read/Write int(3)int: A numeric value without a decimal Does this order require modified texture? LIST/DETAIL
tGradeSolid Read/Write int(3)int: A numeric value without a decimal Does this order require modified texture? LIST/DETAIL
outletName Read string(255)string: Letters, numbers, or other types of characters Outlet name attached to menu LIST
outletID Read string(19)string: Letters, numbers, or other types of characters OutletID LIST
Attribute Access Data Type Description Default
intake Read intint: A numeric value without a decimal intake DETAIL
unit Read stringstring: Letters, numbers, or other types of characters unit DETAIL
flag Read intint: A numeric value without a decimal flag DETAIL
lowerRDA Read intint: A numeric value without a decimal lowerRDA DETAIL
upperRDA Read intint: A numeric value without a decimal upperRDA DETAIL
averageRDA Read intint: A numeric value without a decimal averageRDA DETAIL
lowerSafeLimit Read intint: A numeric value without a decimal lowerSafeLimit DETAIL
upperSafeLimit Read intint: A numeric value without a decimal upperSafeLimit DETAIL
unsafeLimit Read intint: A numeric value without a decimal unsafeLimit DETAIL
trafficLight Read intint: A numeric value without a decimal trafficLight DETAIL
percentRI Read intint: A numeric value without a decimal percentRI DETAIL
val (Required) Read/Write intint: A numeric value without a decimal val DETAIL

Components are sub-elements of objects. They are usually food or recipe objects themselves. On recipes, each ingredient is a component. On logs and meal plans, each food eaten is a component.

Components for recipe objects: (ingredients)

field type required description example
id intint: A numeric value without a decimal or stringstring: Letters, numbers, or other types of characters required ID that identifies the component instance of a food or recipe object ,id:12367
foodID intint: A numeric value without a decimal or stringstring: Letters, numbers, or other types of characters required ID or IFC of a Nutritics food or recipe object ,foodID:GB15.65502
quantity int *int: A numeric value without a decimal This is a special field. Click to see possible values. or string *string: Letters, numbers, or other types of characters This is a special field. Click to see possible values. required Special field. See possible values ,quantity:568
name stringstring: Letters, numbers, or other types of characters optional Overwrites the default food or recipe name with your own name for this ingredient ,name:A pint of warm water
cmethod int *int: A numeric value without a decimal This is a special field. Click to see possible values. or string *string: Letters, numbers, or other types of characters This is a special field. Click to see possible values. optional Specifies the ID or a generic cooking method for this ingredient. Acceptable cooking methods vary for each ingredient. You can look up available cooking methods for a specific food using the DETAIL function. Alternatively pass a generic ID or string, which will attempt to set the cooking method for you automatically. If the method cannot be found, no cooking method will be applied and a warning will be returned in the msg attribute of the response. ,cmethod:Cooked by moist heat

Components for menu objects: (menu items)

field type required description example
foodID intint: A numeric value without a decimal or stringstring: Letters, numbers, or other types of characters required ID or IFC of a Nutritics food or recipe object ,foodID:GB15.65502
group stringstring: Letters, numbers, or other types of characters required Name of the group that the food or recipe belongs in the menu ,group:Breakfast

Components for log objects:

Coming Soon...

Components for mealplan objects:

Coming Soon...

The following tables list all possible values for special input fields/paremeters. These values can be used in multiple functions.

opts parameter

Options for the API call can be passed using the opts parameter.

Format:

&opts=option1:val1,option2:val2,...

Example:

../lIST/food=6600095&attr=foodlabel&opts=labelFormat:US
Currently supported options
format description example
labelFormat:[val] s_labelFormat setting override (EU, US, AU, and SA) labelFormat:US

ID Fields

All id fields on all functions accept the following values

format description example
[int] ID: Nutritics internal ID 200134
[dbsrc].[foodcode] IFC: International Food Code. Note: IFC for all user-created foods and recipes begins with U. GB15.65502
_[int] Barcode: Look up a food by its UPC-A barcode by prepending an underscore _51665834

Quantity Fields

All quantity fields on all functions accept the following values. Please note the minimum accepted quantity is 0.01g.

format description example
[int] see [num]"x"
[num][unit] Weight in one of the following units: g, kg, lb, oz, st, ml, l, floz, pt, qt, gl 2lb 1oz
"p"[int] User's portions 1-5 (if available) p2
[num]"x" Attempts to find [num] units of the food. For example "2x" used with Apples, would find 2 average sized apples while "2x" on bread would find 2 average slices. On recipes, this would find 2 'servings'. 3x
[num]"xp"[int] Use a multiplier on a portion number 2xp2

[num]"x"[name] Use a multiplier on a portion name 2xsmall box
RECIPE OBJECTS ONLY
"serving" Weight of one serving (available only when portionCount is set in the recipe) serving
"total" Weight of the entire recipe (if available) total

Filter Field

Use the filter field on a LIST function to run a Nutritics search. The search engine accepts the following optional parameters:

format description example
[string] Search Term: A word or phrase to search our database. This must be passed before any of the parameters below. bananna
attr:[string] Attribute: Search by one or more object attributes. Most attributes from a Nutritics Object are accepted. Separate multiple attributes by spaces. Separate multiple attribute values by commas. You may use > or < operators for numeric attributes. Boolean attributes should be specified in binary format cat:Pastas,Rice vita:>100,<200 gluten:0
shared:[bool] Special Flag: If specified, this flag returns only objects shared with the selected user. You may also pass a -1 here to return both the user's own objects and objects shared with them. shared:1
order:[string] Sort Order: Specify an attribute to order the result list. order:vitc DESC
FOOD OBJECTS ONLY
like:[id or ifc] Similar Foods: List foods similar to the selected food like:GB15.4016

Example Requests

Find fruits with the most vitamin C:

https://[USERNAME]:[PASSWORD]@www.nutritics.com/api/v1.2/LIST/food=cat:fruits order:vitc DESC

Get a list of IDs for a user's recipes which have been modified since Jun 20th 2017 @ 10:50:02 UTC:

https://[USERNAME]:[PASSWORD]@www.nutritics.com/api/v1.2/LIST/userID=3&recipe=moddate:>1497955802&attr=id

Cooking Methods

cmethod fields on recipe components may accept the one following values (passed in ID or string format). However since acceptable cooking methods vary for each ingredient, we recommend looking up available cooking methods for each specific food using cmethod attribute on the LIST function. The list below is in order of popularity and the first three items are available to 90% of foods. If you pass a method which cannot be applied to the specified food, the Nutitics engine will automatically find and apply the closest match. If no match is found or an unrecognised cooking method is passed, the request will proceed as normal and a warning will be returned within the response data.

  1. Cooked by dry heat
  2. Cooked with fat or oil (baked/fried) *
  3. Cooked by moist heat
  4. Baked or roasted
  5. Sauteed/Stir-fried in oil
  6. Deep fried in oil *
  7. Boiled in salted water *
  8. Batter/crumbed, deep fried in oil *
  9. Stewed
  10. Batter/crumbed, baked in oil *
  11. Crumbed, baked without oil
  12. Batter/crumbed, pan fried in oil *
  13. Broiled or grilled
  14. Boiled or steamed
  15. Boiled
  16. Cooked by dry heat, with sauce
  17. Cooked with fat or oil (fried), with sauce *
  18. Stewed or braised
  19. Cooked by moist heat, with sauce
  20. Steamed
  21. Flash Fried *
  22. Boiled, steamed, with sauce
  23. Stewed, braised, with sauce
  24. Juiced Ingredient
  25. As Dish with sauce, Cooked by moist heat
  26. Toasted
  27. Cooked by moist heat, with cooking liquid
  28. Steeped
  29. As Dish, Broiled or grilled
  30. As Dish, Cooked by dry heat
  31. As Dish, Cooked with fat or oil (baked/fried) *
  32. As Dish, Baked or roasted
  33. Boiled, with cooking liquid
  34. As Dish, Sauteed/Stir-fried in oil *
  35. As Dish, Deep fried in oil *
  36. As Dish with sauce, Cooked by dry heat
  37. As Dish with sauce, Cooked with fat or oil (baked/fried)
  38. Cooked with heat <15 minutes (40% alcohol losses)
  39. Blended Ingredient
  40. Used as flour / light dusting only
  41. Used as batter or coating - baked or dry heat
  42. Used as batter or coating - fried in oil
  43. Cooked with heat 15-45 minutes (80% alcohol losses)
  44. Cooked with heat >45 minutes (90% alcohol losses)
  45. Boiled in salted water (wholegrain) - water absorbed *
  46. Boiled in salted water (polished grain) - water absorbed *
  47. Jam, Jelly, Marmalade
  48. Used as a medium for baking, grilling or roasting ingredients
  49. Used as a medium for frying or deep frying ingredients
  50. Added to cooking water
  51. Used as a batter or coating, baked or dry heat
  52. Used as a batter or coating, fried in oil
  53. Boiled, in salted water *
  54. Boiled in salted water (wholegrain)- water drained *
  55. Boiled in salted water (polished grain)- water drained *
  56. Fried *
  57. Scrambled / Sauteed
  58. In Pancake *
  59. As Dish, Cooked by moist heat
  60. Boiled, drained
  61. Boiled, not drained
  62. Cooked by moist heat (wholegrain)
  63. Boiled - wholegrain
  64. Boiled in dish / sauce
  65. Cooked by moist heat (polished grain)
  66. Boiled - polished grain
  67. Fat fully incorporated into cooked recipe
  68. Cooked with fat or oil *
  69. Cooked with fat or oil (baked/fried), with sauce *


* This cooking method requires any fat to be added as an extra ingredient with one of the cooking methods shown in orange
* This cooking method requires any salt to be added as an extra ingredient with one of the cooking methods shown in blue
* This cooking method requires a sub-recipe to be added as an extra ingredient with one of the cooking methods shown in gold

Example:

...[id:GB15.63832,quantity:496g,name:4 cups of flour,cmethod:Toasted]...

When passing the component above on CREATE OR MODIFY, since the cooking method 'Toasted' is not available for flours, Nutritics will apply the more generic method: 'Cooked by dry heat'

Food Categories

All new food objects must be assigned to one of the following food categories

https://www.nutritics.com/api/v1.2/HELP/food&cats

Databases

The following database sources are acceptable for LIST functions.

https://www.nutritics.com/api/v1.2/HELP/food&srcs

Data Types

Data Type List

Special Fields Definition (to be moved to Nutritics Objects Tables dropdowns)

cat: category definition.cat1,cat2,cat3

allergens: allergens definition.freefrom,maycontain,contains,suitablefor.{allergenlist}

Traffic Lights

Functions

  • LIST
  • DETAIL
  • CREATE
  • MODIFY
  • DELETE
  • ADMIN
  • HELP

LIST is a universal function for fetching data on Nutritics. Search our database and retrieve a list of stripped nutritics objectsA stripped object contains only certain important values by default. To obtain specific values, use the attr parameter.. This function searches within the data sources specificed in your dev account, which can be modified using ADMIN.

Parameters

field type required description example
{object} stringstring: Letters, numbers, or other types of characters required The name of any type of Nutritics object &food
user intint: A numeric value without a decimal or listlist: A list of variables, usually ints or strings, separated by commas. optional List all objects owned by a specific user or list of users. Your developer account must be cleared by Nutritics staff to do requests in behalf of another user. &user=123,321
attr listlist: A list of variables, usually ints or strings, separated by commas. optional A list of attributes you wish to return. Any attributes from a Nutritics Object are accepted. Your developer account must be cleared by Nutritics staff to retrieve cetrain attributes. &attr=vitc,vitd,quid
limit stringstring: Letters, numbers, or other types of characters optional Offset and count for pagination of results. Works like SQL limits. This example returns records from 11-31 &limit=11,20
FOOD, RECIPE & CLIENT OBJECTS ONLY:
{filter} array *array: A package containing multiple variables, usually containing internal labels for each This is a special field. Click to see possible values. optional A search term, optionally including filter field parameters &food=coffee
FOOD & RECIPE OBJECTS ONLY:
quantity int *int: A numeric value without a decimal This is a special field. Click to see possible values. or string *string: Letters, numbers, or other types of characters This is a special field. Click to see possible values. required Special field indicating the physical weight/amount you wish to retrieve data for. See accepted values &quantity=100
responseUnit stringstring: Letters, numbers, or other types of characters optional Retrieve values from components and portions using the requested units: metric (g, kg, ...) or imperial units (oz, lb, ...). Default: responseUnit=metric &responseUnit=imperial

Return Data

Returns an array of stripped Nutritics objects matching the search filter. One additional attribute 'resultCount' is appended to the array which shows the total number of matching results of your search.

Syntax

https://{username}:{password}@www.nutritics.com/api/v1.2/LIST/{object}={filter}&user={user}&attr={attributes}&quantity={quantity}&limit={offset},{count}

Example Requests

Return all user owned foods matching the phrase "red pepper" (shared filter is 0 by default):

https://[USERNAME]:[PASSWORD]@www.nutritics.com/api/v1.2/LIST/food=red pepper

Return all foods matching the phrase "red pepper" and shared to you:

https://[USERNAME]:[PASSWORD]@www.nutritics.com/api/v1.2/LIST/food=red pepper shared:1

Return all foods matching the phrase "red pepper" (both owned and shared):

https://[USERNAME]:[PASSWORD]@www.nutritics.com/api/v1.2/LIST/food=red pepper shared:-1

Return the first 3 foods in the "Sauces & Condiments - Prepared" category:

https://[USERNAME]:[PASSWORD]@www.nutritics.com/api/v1.2/LIST/food=cat:Sauces%20%26%20Condiments%20-%20Prepared&limit=0,3

Return allergens, portions & ingredients from recipe with id 123456:

https://[USERNAME]:[PASSWORD]@www.nutritics.com/api/v1.2/LIST/recipe=123456&attr=allergens,portions,ingredients

Return nutriton label data for all recipes owned by user 123:

https://[USERNAME]:[PASSWORD]@www.nutritics.com/api/v1.2/LIST/user=123&recipe&attr=foodlabel

Return tracker information for the given time period for client 1234:

https://[USERNAME]:[PASSWORD]@www.nutritics.com/api/v1.2/LIST/tracker=client:1234&day=2020-02-22_2020-02-24&attr=energyKcal,carbohydrate,protein,fat

DETAIL was depreciated July 13th 2017 and LIST was upgraded to absorb all of its features. We will continue to support DETAIL requests for as long as v1.1 is live.

Retrieve full detail for a specific Nutritics object. The running DETAIL on a food or recipe returns a stripped object which may not contain all the data you are looking for. In this case, use the filters param to specify the data you need.

Parameters

field type required description example
object stringstring: Letters, numbers, or other types of characters required The name of any type of Nutritics object &recipe
id intint: A numeric value without a decimal or stringstring: Letters, numbers, or other types of characters required The ID or IFC of the object you wish to retrieve &recipe=123
attr listlist: A list of variables, usually ints or strings, separated by commas. optional A list of attributes you wish to return. Any attribute from a Nutritics Object is accepted &attr=vitc,vitd,quid
FOOD & RECIPE OBJECTS ONLY:
quantity int *int: A numeric value without a decimal This is a special field. Click to see possible values. or string *string: Letters, numbers, or other types of characters This is a special field. Click to see possible values. required Special field. See accepted values &quantity=100

Return Data

Returns a single Nutritics Object matching the query

Syntax

https://{username}:{pasword}@www.nutritics.com/api/v1.2/DETAIL/{object}={id}&attr={attr1,attr2...}&quantity={quantity}

Example Request

Return allergens, portions & ingredients from recipe with id 123456:

https://[USERNAME]:[PASSWORD]@www.nutritics.com/api/v1.2/LIST/recipe=123456&attr=allergens,portions,ingredients

Create a new Nutritics object from a list of fields or sub-objects and have new values automatically calculated.

Parameters

field type required description example
{object} stringstring: Letters, numbers, or other types of characters required The name of any type of Nutritics object &client
{attributes} multiplemultiple: Multiple variables in the form &attribute=value required Add data for the object creation (See Nutritics Objects for available attributes) &weight=60
user intint: A numeric value without a decimal or listlist: A list of variables, usually ints or strings, separated by commas. optional Creates the object for the specified users. Your developer account must be cleared by Nutritics staff to do requests in behalf of another user. &user=123,321
attr listlist: A list of variables, usually ints or strings, separated by commas. optional A list of attributes you wish to return. Any attributes from a Nutritics Object are accepted. Your developer account must be cleared by Nutritics staff to retrieve cetrain attributes. &attr=vitc,vitd,quid
replaceID intint: A numeric value without a decimal or stringstring: Letters, numbers, or other types of characters optional ID or IFC of an existing object you would like to replace with your new data. &replaceID=U.5032
RECIPE, MENU, LOG & MEALPLAN OBJECTS ONLY:
components list of arrayslist of arrays: A list of array objects, separated by commas, each containing multiple variables. optional A list of sub-objects for your new object. Usually food or recipe objects themselves, these elements make up your ingredients or log content. (See object components for available fields) &components=[id:U.123,quantity:45],[id:U.456,quantity:250ml]
RECIPE OBJECTS ONLY:
store booleanboolean: A true or false variable optional Flag to store or not the recipe object. If opted for not storing, calculated values are returned, but no identification for further access is retrieved. Default: store=1 &store=0
CLIENT OBJECTS ONLY:
sendInvite booleanboolean: A true or false variable optional Send a Libro invite uppon creating a client. Required fields: email and forename &sendInvite=1

Return Data

The new Nutritics Object with the default array of calculated values. To retrieve specific values, add the attr field to the request

Syntax

https://{username}:{pasword}@www.nutritics.com/api/v1.2/CREATE/{object}&{attribute1}={value1}&{attribute2}={value2}&etc...&components=[{component1}],[{component1}],etc..

Example Requests

Create a new client:

https://[USERNAME]:[PASSWORD]@www.nutritics.com/api/v1.2/CREATE/client&forename=Joe&gender=m&dob=1990-01-01&weight=70&height=180&idno=12345&orderNotes=RequiresAssistance&milk=1

Create a new recipe:

https://[USERNAME]:[PASSWORD]@www.nutritics.com/api/v1.2/CREATE/recipe&name=Pizza Dough&components=[id:63832,quantity:496,name:4 cups of flour,cmethod:Baked or roasted],[id:GB15.17-377,quantity:568,name:A pint of warm water]

Edit an existing Nutritics object

Parameters

field type required description example
{object} stringstring: Letters, numbers, or other types of characters required The name of any type of Nutritics object &recipe
id intint: A numeric value without a decimal or stringstring: Letters, numbers, or other types of characters required The ID or IFC of the object you wish to modify &recipe=123
{attributes} multiplemultiple: Multiple variables in the form &attribute=value required Add fields & values you wish to update (See Nutritics Objects for available attributes) &weight=60
attr listlist: A list of variables, usually ints or strings, separated by commas. optional A list of attributes you wish to return. Any attributes from a Nutritics Object are accepted. Your developer account must be cleared by Nutritics staff to retrieve cetrain attributes. &attr=vitc,vitd,quid
FOOD, RECIPE, LOG & MEALPLAN OBJECTS ONLY:
{subfunction} stringstring: Letters, numbers, or other types of characters optional Additional functions for managing components. Accepted values are below. &add=[foodID:123,name:Pinch of salt,quantity:3]
addAdd new components
updateUpdates existing components with new values
replaceUpdates existing components and automatically adds any missing components.
deleteRemoves the components listed
components list of arrayslist of arrays: A list of array objects, separated by commas, each containing multiple variables. optional Attach components to the add, update & replace subfunctions. (See object components for available fields) &replace=[id:45123,foodID:123,quantity:500],[id:45612,quantity:120]
{componentIDs} listlist: A list of variables, usually ints or strings, separated by commas. optional Only used for delete subfunction. Specify the IDs of the components you wish to delete. &delete=45123,45612

Return Data

The modified object. &attr parameter can be used to specify arbitrary attributes

Syntax

https://{username}:{pasword}@www.nutritics.com/api/v1.2/MODIFY/{object}={id}&{attribute1}={value1}&{attribute2}={value2}&etc...&{subfunction}=( {componentID} OR [{component1}],[{component2}],etc... )

Example Requests

Edit the weight of client 1005:

https://[USERNAME]:[PASSWORD]@www.nutritics.com/api/v1.2/MODIFY/client=1005&weight=70

Edit the quantity of two ingredients in recipe U.123:

https://[USERNAME]:[PASSWORD]@www.nutritics.com/api/v1.2/MODIFY/recipe=U.123&update=[id:12456,quantity:450ml],[id:34789,quantity:serving]

Edit the cost of food 1234567:

https://[USERNAME]:[PASSWORD]@www.nutritics.com/api/v1.2/MODIFY/food=1234567&costs=[unitWeight:100,unitMeasure:g,unitPrice:5,currency:]

Add viewers to recipes:

https://[USERNAME]:[PASSWORD]@www.nutritics.com/api/v1.2/MODIFY/recipe=1234567,891011,3433243&sharing=[viewer:1010,1011,1020,2312 access:r]

Delete an existing Nutritics object permanently, including all data associated with it. To delete individual object components, use MODIFY function.

Parameters

field type required description example
{object} stringstring: Letters, numbers, or other types of characters required The name of any type of Nutritics object &client=
id intint: A numeric value without a decimal or stringstring: Letters, numbers, or other types of characters required The ID or IFC of the object you wish to delete &client=U.123

Return Data

Default (status and msg only)

Syntax

https://[USERNAME]:[PASSWORD]@www.nutritics.com/api/v1.2/DELETE/{object}={id}

Example Request

https://[USERNAME]:[PASSWORD]@www.nutritics.com/api/v1.2/DELETE/client=123

The ADMIN function performs basic checks and updates on your developer account.

Return Data

Returns a simple array containing the information requested

Syntax

https://[USERNAME]:[PASSWORD]@www.nutritics.com/api/v1.2/ADMIN/{object}&{field}

Example Requests

Check the API status:

https://[USERNAME]:[PASSWORD]@www.nutritics.com/api/v1.2/ADMIN/api&status

Check your dev account status & limits:

https://[USERNAME]:[PASSWORD]@www.nutritics.com/api/v1.2/ADMIN/dev&status

Update your account settings:

https://[USERNAME]:[PASSWORD]@www.nutritics.com/api/v1.2/ADMIN/dev&password=abcdef https://[USERNAME]:[PASSWORD]@www.nutritics.com/api/v1.2/ADMIN/dev&defaultUserID=1234

The HELP function returns an array detailing all available attributes for any object. Authentication is not required for this function.

Return Data

Returns a simple array containing the information requested

Syntax

https://www.nutritics.com/api/v1.2/HELP/{object}&{field}

Example Requests

List all available attributes for Nutritics recipe objects:

https://www.nutritics.com/api/v1.2/HELP/recipe

List all available values for Nutritics food categories:

https://www.nutritics.com/api/v1.2/HELP/food&cats

List all available Nutritics databases:

https://www.nutritics.com/api/v1.2/HELP/food&srcs https://www.nutritics.com/api/v1.2/HELP/food&srcs&group=National Databases

Response Codes

Code Name Description
200 Success  Everything worked as expected.
400 Bad Request  The request was unacceptable, often due to missing a required parameter.
401 Unauthorized  Your username or password are incorrect 
402 Limit Reached  (check your account status)
404 Not Found  No object found under the specified filters.
429 Too Many Requests  Too many requests hit the API too quickly. We recommend an exponential backoff of your requests.
500, 502,
503, 504 
Server Errors  Something went wrong on our end  (check the API status)

 

Allergen mapping recommendations

To minimise risk of allergen misinterpretation, Nutritics recommend mapping allergens from the allergens attribute (e.g &attr=allergens). To parse and map the results, use a LIKE search for the cereal species (wheat, oats, barley, rye) and an exact match for 'Gluten'. In no scenario should the presence of a cereal species invoke a gluten tag automatically in the destination system. Mappings should be 1:1. 

 

Nutritics sends…

Activates

Trigger word: 

Oats, gluten-oats

Oats

%LIKE match for ‘Oats’  '%Oats%'

Wheat, gluten-wheat

Wheat

%LIKE match ‘%Wheat%’

Barley, gluten-barely

Barely

%LIKE match ‘%Barley%’

Rye, gluten-rye

Rye

%LIKE match  ‘%Rye%’

Gluten

Cereals Containing Gluten

Exact match for ‘Gluten’

Notes:

  • We have used the term %LIKE match which is a SQL term and should be understood as such. The matching logic and the underlying technology can be different but the principle demonstrated above should be considered to avoid misinterpretation of our allergen data.

Changelog v1.2

Features:

  • New columns available in every object. Read the documentation for more information
  • Search can now be made by IFC (removed src & code option)
  • Portion cost field added to the portion object
  • Cooking methods added to recipes
  • Response codes were updated to web standards
  • CREATE function now accepts the ID of an object to replace
  • MODIFY, ADMIN and HELP functions added
  • Added photos to LIST results
  • queryTime parameter added to all requests
  • Additional units accepted on component quantity (lb, kg, oz, ml, etc)
  • Additional options added to component quantity ("one serving" & "recipe total")
  • Dedicated barcodes added to portions
  • New API Documentation
  • New colour coding on explorer sample code & JSON response
  • Activity object is now supported

Fixes:

  • Removed id2 we recommend to use IFC instead
  • "ingredients" field renamed to "components"
  • "attr" field added to to LIST
  • "filter" field in DETAIL renamed to "attr"
  • "source" field renamed to "src"
  • "txt" field renamed to to "msg"
  • "measure" field removed. Use "quantity" instead.
  • Empty values will be shown as "" instead of "null"
  • Boolean values will be shown as true or false instead of "0","1"
  • Integer and float values will be shown without quotes
  • Fixed source field default value on recipe creation
  • Fixed output encoding problems
  • Fixed bug when deleting client
  • Fixed problem when filtering fields on foods and recipes
  • Fixed problem when showing allergens on foods and recipes
  • Fixed problems with traffic lights and labeling
  • Fixed bug when using pagination on foods and recipes
  • Fixed bug related when detail a food or recipe and adding specific nutrients in the filter
  • Javascript Callback for JSONP repaired