FoodCASE Web Services
Version 1.4.7 or higher
FoodCASE offers web services that can be used by other software systems. In the following examples, the FoodCASE playground environment is used, which can be found under http://playground.foodcase.ethz.ch/.
Section 1 shows the web services in graphical form and section 2 and 3 describe them in more detail.
1 Graphical Presentation
2 REST
The condition that the RESTful web service can be used, is that the web component of FoodCASE is installed and running.
The REST web service is implemented by the HTTP method GET and therefore parameters must be provided in the URL. The output is always in XML according to FDTP (food data transport package), which the EuroFIR standard to exchange food composition data and can be found under http://www.eurofir.org/wp-content/uploads/TechWeb%20Downloads/XML%20Food%20Transport%20Package/EuroFIR_Food_Data_Transport_Package_1_3.pdf.
The following interfaces exist:
2.1 Search by a food term
Example URL: http://naehrwertdaten.ch/request?query=SearchField&lan=en&searchString=apple
Parameters:
· query: SearchField defines that a search with a term should be executed.
· lan defines the language of the food name that is used for the searching and in which language the answer is provided. E.g. if lan=en then you want to apply the parameter searchString to the English name and the answering FDTP is in English. lan=[empty] is not allowed.
· searchString: the string to search.
Result:
The result is a list of food item without component values in FDTP.
2.2 Search by component value
Example URL:
http://naehrwertdaten.ch/request?query=SearchCompRange&lan=en&compId=11&sign=1&number=30
Parameters:
· query: SearchCompRange defines that a comp value search should be executed.
· lan: defines the language in which the answer is given. Parameter is optional, standard language is English.
· compId: Is the id of the component that is compared against the parameter number. Please note that the idcomponent is different in every version as the components will be copied in every version.
· sign: defines the comparison operator. 1 means component value is bigger than the parameter number, -1 means component value is smaller than the parameter number and everything else is assumed to mean equal.
· number: defines the number to against which a component value is compared.
Result:
The result is a list of food item without component values in FDTP.
2.3 Search by first letter of food name
Example URL: http://naehrwertdaten.ch/request?query=AlphaList&lan=en&letter=A
Parameters:
· query: AlphaList defines that search on the first letter of a food name should be executed.
· lan: defines the language of the food name that is used for the searching and in which language the answer is provided.
· letter: defines the letter
Result:
The result is a list of food item without component values in FDTP.
2.4 Combined search
Example URL: http://naehrwertdaten.ch/request?query=FoodCompList&SearchTerm=tomato&catId=292&subCatId=305&lan=en&CompList=PROT,ALC,FAT,ENERCJ
Parameters:
· query: FoodCompList defines that a search should be executed for which food and component value data is listed in the result.
· SearchTerm: The term to search. Optional.
· catId: Main category to search. Optional.
· subCatId: Sub category to search. Optional.
· lan: defines the language of the food name that is used for the searching and in which language the answer is provided. E.g. if lan=en then you want to apply the parameter searchString to the English name and the answering FDTP is in English. Lan=[empty] is allowed and means that the FoodCASE field food name is searched.
· CompList: defines the component values that are listed in the result. The component values are only listed if they are publicly available. The list of possible values can be found in Appendix A. An empty list means all publicly available component values.
Result:
The result contains food and component values in FDTP format.
3 SOAP (not yet available)
The WSDL for the SOAP web service can be request at .
3.1 getComponents
The method returns a list of all publicly available components. See again Appendix A
3.2 getUnits
The method returns a list of all publicly available units. See EuroFIR thesaurus.
3.3 getMatrixUnits
The method returns a list of all publicly available matrix units. A matrix unit is a denominator, for instance, per 100g edible portion. See EuroFIR thesaurus.
3.4 getValueTypes
The method returns a list of all publicly available value types. See EuroFIR thesaurus.
3.5 GetLanguages
The method returns a list of all publicly available language. This thesaurus is according to ISO 639-1
3.6 getFoodCategories
The method returns a list of all publicly available food categories.
3.7 getPublicVersion
The method returns the current public version.
3.8 getFoodsAndValues(int numberOfFoods, string startFrom)
The method returns a food items and their component values. There are two parameters that can be used:
· numberOfFoods: Defines how many foods should be listed in the answer. More than 100 foods will massively decrease performance and therefore should not be exceeded.
· startFrom: Defines the id from which the search starts. Please note that ID is a string because of user requirements. That means that 1 and 11 comes before 2 and 22.
3.9 GetFood(string ID_for_eSearch)
This is a legacy web service for the EuroFIR eSearch tool. eSearch had some old IDs of the Swiss food composition database which are stored as idimportsource. This interface returns food and component values in FDTP format.
3.10 GetFoodList(String[] foodList)
Similar to GetFood(string ID_for_eSearch) but take multiple ID as input and returns multiple food and component values as FDTP.
Appendix A
Name / Codeamino acids, total aromatic / AAA
amino acids, total essential; unknown which aa are included / AAE-
amino acids, total essential; eight essential amino acids + CYS and TYR / AAE10B
amino acids, total essential; eight essential amino acids / AAE8
amino acids, total sulphur-containing / AAS
amino acids, total; precise definition not specified / AAT-
acetic acid / ACEAC
acesulfam-K / ACESK
aconitic acid / ACONAC
adenine / ADEN
adipic acid / ADIAC
aluminium / AL
alanine / ALA
albumin / ALBU
alcohol / ALC
ammonia / AMMON
amylopectin / AMYP
amylose / AMYS
anthocyanidins, total / ANTCYAN
apigenin / APIGEN
arabinose / ARAS
arginine / ARG
arsenic / AS
L-dehydroascorbic acid / ASCDL
L-ascorbic acid / ASCL
ash / ASH
asparagine / ASN
aspartic acid / ASP
aspartam / ASPM
astaxanthin / ASTAX
isotretinoin / ATTENTION, USE: 13-cis-retinoic acid [RETINAC13]
calcidiol / ATTENTION, USE: 25-hydroxycholecalciferol [CHOCALOH]
calcifediol / ATTENTION, USE: 25-hydroxycholecalciferol [CHOCALOH]
ercalcidiol / ATTENTION, USE: 25-hydroxyergocalciferol [ERGSTROH]
fatty acid 2:0 / ATTENTION, USE: acetic acid [ACEAC]
achilleic acid / ATTENTION, USE: aconitic acid [ACONAC]
citridinic acid / ATTENTION, USE: aconitic acid [ACONAC]
equisetic acid / ATTENTION, USE: aconitic acid [ACONAC]
hexanedi-1,6-oic acid / ATTENTION, USE: adipic acid [ADIAC]
ethanol / ATTENTION, USE: alcohol [ALC]
vitamin A1 / ATTENTION, USE: all-trans retinol [RETOLAT]
retinol / ATTENTION, USE: all-trans retinol [RETOLAT] or all-trans retinol equivalents [RETOLTEQ]
carotene, alpha- / ATTENTION, USE: alpha-carotene [CARTA]
cryptoxanthin, alpha- / ATTENTION, USE: alpha-cryptoxanthin [CRYPXA]
oxoglutaric acid / ATTENTION, USE: alpha-ketoglutaric acid [GLUAKAC]
minerals / ATTENTION, USE: ash [ASH]
carotene, beta- / ATTENTION, USE: beta-carotene [CARTB]
carotene, beta-, cis / ATTENTION, USE: beta-carotene, cis [CARTBCIS]
carotene, beta-, total / ATTENTION, USE: beta-carotene, total [CARTBTOT]
cryptoxanthin, beta- / ATTENTION, USE: beta-cryptoxanthin [CRYPXB]
3-dehydroretinol / ATTENTION, USE: dehydroretinol [RETOLDH]
vitamin A2 / ATTENTION, USE: dehydroretinol [RETOLDH]
phyllohydroquinone / ATTENTION, USE: dihydro-vitamin K-1 [VITK1D]
gallocatechol / ATTENTION, USE: epicatechin [EPICATEC]
lipid, total / ATTENTION, USE: fat, total [FAT]
capric acid / ATTENTION, USE: fatty acid 10:0 (capric acid) [F10:0]
caproleic acid / ATTENTION, USE: fatty acid 10:1 (caproleic acid) [F10:1CN1]
lauric acid / ATTENTION, USE: fatty acid 12:0 (lauric acid) [F12:0]
lauroleic acid / ATTENTION, USE: fatty acid 12:1 (lauroleic acid) [F12:1CN3]
tridecanoic acid / ATTENTION, USE: fatty acid 13:0 (tridecanoic acid) [F13:0]
dodecanoic acid, 11-methyl / ATTENTION, USE: fatty acid 13:0 iso (isotridecanoic acid) [F13:0I]
isotridecanoic acid / ATTENTION, USE: fatty acid 13:0 iso (isotridecanoic acid) [F13:0I]
myristic acid / ATTENTION, USE: fatty acid 14:0 (myristic acid) [F14:0]
anteisotetradecanoic acid / ATTENTION, USE: fatty acid 14:0 anteiso [F14:0AI]
tridecanoic acid, 11-methyl / ATTENTION, USE: fatty acid 14:0 anteiso [F14:0AI]
isomyristic acid / ATTENTION, USE: fatty acid 14:0 iso [F14:0I]
tridecanoic acid, 12-methyl / ATTENTION, USE: fatty acid 14:0 iso [F14:0I]
myristoleic acid / ATTENTION, USE: fatty acid 14:1 n-5 cis (myristoleic acid) [F14:1CN5]
myristelaidic acid / ATTENTION, USE: fatty acid 14:1 n-5 trans (myristelaidic acid) [F14:1TN5]
pentadecanoic acid / ATTENTION, USE: fatty acid 15:0 (pentadecylic acid) [F15:0]
anteisopentadecanoic acid / ATTENTION, USE: fatty acid 15:0 anteiso [F15:0AI]
sarcinic acid / ATTENTION, USE: fatty acid 15:0 anteiso [F15:0AI]
tetradecanoic acid, 12-methyl / ATTENTION, USE: fatty acid 15:0 anteiso [F15:0AI]
isopentadecanoic acid / ATTENTION, USE: fatty acid 15:0 iso [F15:0I]
tetradecanoic acid, 13-methyl / ATTENTION, USE: fatty acid 15:0 iso [F15:0I]
pentadecenoic acid / ATTENTION, USE: fatty acid 15:1 (pentadecenoic acid) [F15:1]
palmitic acid / ATTENTION, USE: fatty acid 16:0 (palmitic acid) [F16:0]
anteisohexadecanoic acid / ATTENTION, USE: fatty acid 16:0 anteiso [F16:0AI]
pentadecanoic acid, 13-methyl / ATTENTION, USE: fatty acid 16:0 anteiso [F16:0AI]
isohexadecanoic acid / ATTENTION, USE: fatty acid 16:0 iso [F16:0I]
pentadecanoic acid, 14-methyl / ATTENTION, USE: fatty acid 16:0 iso [F16:0I]
palmitoleic acid / ATTENTION, USE: fatty acid 16:1 n-7 cis (palmitoleic acid) [F16:1CN7]
zoomaric acid / ATTENTION, USE: fatty acid 16:1 n-7 cis (palmitoleic acid) [F16:1CN7]
palmitelaidic acid / ATTENTION, USE: fatty acid 16:1 n-7 trans [F16:1TN7]
daturic acid / ATTENTION, USE: fatty acid 17:0 (margaric acid) [F17:0]
margaric acid / ATTENTION, USE: fatty acid 17:0 (margaric acid) [F17:0]
anteisoheptadecanoic acid / ATTENTION, USE: fatty acid 17:0 anteiso [F17:0AI]
hexadecanoic acid, 14-methyl / ATTENTION, USE: fatty acid 17:0 anteiso [F17:0AI]
hexadecanoic acid, 15-methyl / ATTENTION, USE: fatty acid 17:0 iso [F17:0I]
isoheptadecanoic acid / ATTENTION, USE: fatty acid 17:0 iso [F17:0I]
heptadecenoic acid / ATTENTION, USE: fatty acid 17:1 (heptadecenoic acid) [F17:1]
stearic acid / ATTENTION, USE: fatty acid 18:0 (stearic acid) [F18:0]
anteisooctadecanoic acid / ATTENTION, USE: fatty acid 18:0 anteiso [F18:0AI]
heptadecanoic acid, 15-methyl / ATTENTION, USE: fatty acid 18:0 anteiso [F18:0AI]
dihydroxystearic acid / ATTENTION, USE: fatty acid 18:0 dihydroxy [F18:0DO]
heptadecanoic acid, 16-methyl / ATTENTION, USE: fatty acid 18:0 iso [F18:0I]
isostearic acid / ATTENTION, USE: fatty acid 18:0 iso [F18:0I]
petroselinic acid / ATTENTION, USE: fatty acid 18:1 n-12 cis [F18:1CN12]
petroselaidic acid / ATTENTION, USE: fatty acid 18:1 n-12 trans [F18:1TN12]
asclepic acid / ATTENTION, USE: fatty acid 18:1 n-7 cis [F18:1CN7]
vaccenic acid, cis- / ATTENTION, USE: fatty acid 18:1 n-7 cis [F18:1CN7]
vaccenic acid / ATTENTION, USE: fatty acid 18:1 n-7 trans [F18:1TN7]
oleic acid / ATTENTION, USE: fatty acid 18:1 n-9 cis (oleic acid) [F18:1CN9]
elaidic acid / ATTENTION, USE: fatty acid 18:1 n-9 trans (elaidic acid) [F18:1TN9]
ricinoleic acid / ATTENTION, USE: fatty acid 18:1 OH n-7 (ricinoleic acid) [F18:1N9O]
bovinic acid / ATTENTION, USE: fatty acid 18:2 conjugated, c9,t11 [F18:2C9T11]
rumenic acid / ATTENTION, USE: fatty acid 18:2 conjugated, c9,t11 [F18:2C9T11]
linoleic acid / ATTENTION, USE: fatty acid 18:2 n-6 cis,cis [F18:2CN6]
linolenic acid, alpha- / ATTENTION, USE: fatty acid 18:3 n-3 all-cis [F18:3CN3]
linolenelaidic acid / ATTENTION, USE: fatty acid 18:3 n-3 all-trans [F18:3TTTN3]
GLA / ATTENTION, USE: fatty acid 18:3 n-6 all-cis [F18:3CN6]
linolenic acid, gamma- / ATTENTION, USE: fatty acid 18:3 n-6 all-cis [F18:3CN6]
moroctic acid / ATTENTION, USE: fatty acid 18:4 n-3 all-cis [F18:4CN3]
stearidonic acid / ATTENTION, USE: fatty acid 18:4 n-3 all-cis [F18:4CN3]
arachidic acid / ATTENTION, USE: fatty acid 20:0 (arachidic acid) [F20:0]
isoarachidic acid / ATTENTION, USE: fatty acid 20:0 iso [F20:0I]
nonadecanoic acid, 18-methyl / ATTENTION, USE: fatty acid 20:0 iso [F20:0I]
eicosenoic acid / ATTENTION, USE: fatty acid 20:1 (eicosenoic acid) [F20:1]
icosenoic acid / ATTENTION, USE: fatty acid 20:1 (eicosenoic acid) [F20:1]
gadoleic acid / ATTENTION, USE: fatty acid 20:1 n-11 cis [F20:1CN11]
gadelaidic acid / ATTENTION, USE: fatty acid 20:1 n-11 trans [F20:1TN11]
gondoic acid / ATTENTION, USE: fatty acid 20:1 n-9 cis [F20:1CN9]
eicosadienoic acid / ATTENTION, USE: fatty acid 20:2 (eicosadienoic acid) [F20:2]
icosadienoic acid / ATTENTION, USE: fatty acid 20:2 (eicosadienoic acid) [F20:2]
dihomolinoleic acid / ATTENTION, USE: fatty acid 20:2 n-6 cis,cis [F20:2CN6]
eicosatrienoic acid / ATTENTION, USE: fatty acid 20:3 (eicosatrienoic acid) [F20:3]
icosatrienoic acid / ATTENTION, USE: fatty acid 20:3 (eicosatrienoic acid) [F20:3]
dihomolinolenic acid / ATTENTION, USE: fatty acid 20:3 n-3 all-cis [F20:3CN3]
dihomogammalinolenic acid / ATTENTION, USE: fatty acid 20:3 n-6 all-cis [F20:3CN6]
eicosatetraenoic acid / ATTENTION, USE: fatty acid 20:4 (eicosatetraenoic acid) [F20:4]
icosatetraenoic acid / ATTENTION, USE: fatty acid 20:4 (eicosatetraenoic acid) [F20:4]
arachidonic acid / ATTENTION, USE: fatty acid 20:4 n-6 all-cis [F20:4CN6]
eicopentaenoic acid / ATTENTION, USE: fatty acid 20:5 (eicopentaenoic acid) [F20:5]
icopentaenoic acid / ATTENTION, USE: fatty acid 20:5 (eicopentaenoic acid) [F20:5]
EPA / ATTENTION, USE: fatty acid 20:5 n-3 all-cis [F20:5CN3]
timnodonic acid / ATTENTION, USE: fatty acid 20:5 n-3 all-cis [F20:5CN3]
heneicosapentaenoic acid / ATTENTION, USE: fatty acid 21:5 (heneicosapentaenoic acid) [F21:5]
HPA / ATTENTION, USE: fatty acid 21:5 n-3 (heneicosapentaenoic acid) [F21:5N3]
behenic acid / ATTENTION, USE: fatty acid 22:0 (behenic acid) [F22:0]
docosenoic acid / ATTENTION, USE: fatty acid 22:1 (docosenoic acid) [F22:1]
cetoleic acid / ATTENTION, USE: fatty acid 22:1 n-11 cis (cetoleic acid) [F22:1CN11]
erucic acid / ATTENTION, USE: fatty acid 22:1 n-9 cis (erucic acid) [F22:1CN9]
brassidic acid / ATTENTION, USE: fatty acid 22:1 n-9 trans (brassidic acid) [F22:1TN9]
docosadienoic acid / ATTENTION, USE: fatty acid 22:2 (docosadienoic acid) [F22:2]
docosatetraenoic acid / ATTENTION, USE: fatty acid 22:4 (docosatetraenoic acid) [F22:4]
adrenic acid / ATTENTION, USE: fatty acid 22:4 n-6 all-cis [F22:4CN6]
docosapentaenoic acid / ATTENTION, USE: fatty acid 22:5 (docosapentaenoic acid) [F22:5]
clupanodonic acid / ATTENTION, USE: fatty acid 22:5 n-3 all-cis [F22:5CN3]
DPA / ATTENTION, USE: fatty acid 22:5 n-3 all-cis [F22:5CN3]
osbond acid / ATTENTION, USE: fatty acid 22:5 n-6 all-cis [F22:5CN6]
docosahexaenoic acid / ATTENTION, USE: fatty acid 22:6 (docosahexaenoic acid) [F22:6]
cervonic acid / ATTENTION, USE: fatty acid 22:6 n-3 all-cis [F22:6CN3]