HTTP API documentation.
================================
The API requires that the client sends User-Agent
and X-Authorization
headers.
User-Agent: <any string>
X-Authorization: EAD-TOKENS apiKey="quoted-string"
================================
Just add a ?callback
parameter to any GET
call to have the results wrapped in a JSON function.
================================
Get a list of food additives.
- optional string
category
- get additives only from given category id - optional string
sort
- sort bycode
,name
orlast_update
- optional string
order
- sort order. One ofasc
ordesc
; the default isdesc
- optional string
locale
- eitheren
orbg
; the default is alwaysen
GET /additives HTTP/1.1
HTTP/1.1 200 OK
[
{
"code": "100",
"last_update": "2013-09-08T14:00:48+0300",
"name": "Curcuma (turmeric)",
"url": "http://hostname/additives/100"
},
{
"code": "101",
"last_update": "2013-09-08T14:00:48+0300",
"name": "Riboflavin (Vitamin B2)",
"url": "http://hostname/additives/101"
},
]
================================
Search food additives.
- string
q
- a string to search for - optional string
category
- search only in given category id - optional string
sort
- sort bycode
,name
orlast_update
- optional string
order
- sort order. One ofasc
ordesc
; the default isdesc
- optional string
locale
- eitheren
orbg
; the default is alwaysen
GET /additives/search?q=cu&sort=code&order=desc&locale=en HTTP/1.1
HTTP/1.1 200 OK
[
{
"id": "190",
"code": "410",
"name": "Locust bean gum; carob gum",
"url": "http://hostname/additives/410"
},
{
"id": "1",
"code": "100",
"name": "Curcuma (turmeric)",
"url": "http://hostname/additives/100"
}
]
================================
Get information about single additive.
- string
code
- additive code - optional string
locale
- eitheren
orbg
; the default is alwaysen
GET /additives/100 HTTP/1.1
HTTP/1.1 200 OK
{
"id": "1",
"code": "100",
"last_update": "2013-09-08T20:16:36+0300",
"name": "Curcuma (turmeric)",
"status": "Safe",
"veg": null,
"function": "food coloring (yellow-orange)",
"foods": "Fats and oils, curry, processed cheese and fish fingers.",
"notice": "Safe in recommended doses. High doses should not be taken by people with gallstones, obstructive jaundice, acute bilious colic or toxic liver disorders.",
"info": "Orange-yellow colouring extracted from the rhizomes of the turmeric plant.",
"url": "http://hostname/additives/100"
}
================================
Get a list of additives categories.
- optional string
sort
- sort byid
,name
orlast_update
; the default isid
- optional string
order
- sort order. One ofasc
ordesc
; the default isdesc
- optional string
locale
- eitheren
orbg
; the default is alwaysen
GET /categories HTTP/1.1
HTTP/1.1 200 OK
[
{
"id": "1",
"last_update": "2013-09-08T14:00:45+0300",
"name": "colors",
"additives": "76",
"url": "http://hostname/categories/1"
},
{
"id": "2",
"last_update": "2013-09-08T14:00:45+0300",
"name": "preservatives",
"additives": "52",
"url": "http://hostname/categories/2"
},
]
================================
Get information about single category.
- integer
id
- category id - optional string
locale
- eitheren
orbg
; the default is alwaysen
GET /categories/6 HTTP/1.1
HTTP/1.1 200 OK
{
"id": "6",
"name": "flavour enhancers",
"description": "Flavor enhancers enhance a food's existing flavors. They may be extracted from natural sources (through distillation, solvent extraction, maceration, among other methods) or created artificially.",
"last_update": "2013-09-08T20:13:32+0300",
"additives": "20",
"url": "http://hostname/categories/6"
}