Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Open Food Standard | 87 | 12 years ago | 5 | JavaScript | ||||||
Collaborating on an open food data standard and API for the world. | ||||||||||
Boston Food Truck Schedule Api | 3 | 8 years ago | mit | PHP | ||||||
Gf Loves Food | 2 | 2 years ago | artistic-2.0 | Haskell | ||||||
Simple twitter bot that tweets about very italian food and ather stuff in various languages (powered by www.grammaticalframework.org) |
Open food documentation
The general idea for the API is that we will create ‘things’ as a way to collect as much properties for a food, ingredient, farm, source, boat, etc.
A relationship can be created by simply adding a property to a ‘farm’ called ‘grows’ with the string value ‘tomato’. The value of that property is not checked but another lookup can be performed to see information on a ‘tomato’
This was mainly created this way so that we can add ‘foodtree_id’, ‘freebase_id’ properties to items in the database. We want to be able to associate links to existing sources of information rather than replicate or sync it across.
The primary focus was to gather as much data on an item, easily put it into one place and be able to query it.
HTTP GET to /foods.json
curl http://open-foods.org/foods.json
Example response of 2 foods responded
[{"created_at":"2012-03-08T20:48:26Z","name":"Alcohol","updated_at":"2012-03-08T20:48:26Z","uuid":"0dbaf2b6-6960-11e1-8308-12313933849a","properties":[{"created_at":"2012-03-08T20:48:27Z","name":"Classification: Family","updated_at":"2012-03-08T20:48:27Z","value":"Alcohol"}]},{"created_at":"2012-03-08T20:48:27Z","name":"Garlic","updated_at":"2012-03-08T20:48:27Z","uuid":"0dfeeef8-6960-11e1-8308-12313933849a","properties":[{"created_at":"2012-03-08T20:48:27Z","name":"Classification: Family","updated_at":"2012-03-08T20:48:27Z","value":"allium"}]}]
HTTP GET to /foods.json with name parameter to find a certain food
curl http://open-foods.org/foods.json?name=apple
Example response
[{"created_at":"2012-03-08T20:49:00Z","name":"Custard-apple","updated_at":"2012-03-08T20:49:00Z","uuid":"223aa0a6-6960-11e1-8308-12313933849a","properties":[{"created_at":"2012-03-08T20:49:01Z","name":"Classification: Family","updated_at":"2012-03-08T20:49:01Z","value":"fruit"}]}]
HTTP POST to /foods.json with a 'food' object containing a 'name' attribute with properties.
Example json to post to create a new food:
{“food” : { “name” : “Apple”,
“properties” : [
{“name” : “color”, “value” : “green”}
{“name” : “type_of”, “value” : “fruit”}
]
}
HTTP POST to /foods/{food_uuid}/properties.json
Example json to post:
{ “properties” :
[
{“name” : “color”, “value” : “green”}
{“name” : “type_of”, “value” : “”}
]
}
HTTP GET to /foods/{food_uuid}.json
Example response with json representation of the food:
{"created_at":"2012-03-08T20:50:21Z","name":"Black Pineapple","updated_at":"2012-03-08T20:50:21Z","uuid":"51f896b8-6960-11e1-8308-12313933849a","properties":[{"created_at":"2012-03-08T20:50:21Z","id":3166,"name":"Scientific name","updated_at":"2012-03-08T20:50:21Z","value":"Solanum lycopersicum"},{"created_at":"2012-03-08T20:50:21Z","id":3165,"name":"Simple Name","updated_at":"2012-03-08T20:50:21Z","value":"Tomato"},{"created_at":"2012-03-08T20:50:21Z","id":3164,"name":"Classification: Family","updated_at":"2012-03-08T20:50:21Z","value":"tomato"}]}
As open food we want to know who added data (and when)
As a developer I would like to query recipes associated with particular foods
A developer wants to use data about the top counties for production in certain foods (like tomatoes, leafy greens, eggs and pork) to estimate how far these foods travel on average to reach major population centers.
Visit http://open-food.org for more information