Grocery API
Endpoints
GET Groceries by Nutrition

GET Groceries by Nutrition

GET Groceries by nutrition value

/groceries/:nutrition?min=0&max=1000

Request parameters

FieldParameterDescription
minDoubleOptional minimum nutrition value Default value: 0
maxDoubleOptional minimum nutrition value Default value: 0

Success 200

FieldParameterDescription
namestringName of the Grocery
idintID of the Grocery.
categorystringCategory of the Grocery.
subcategorystringSubcategory of the Grocery.
nutritionsObjectNutritions of the Grocery.
carbohydratesintCarbohydrates of the Grocery (per 100g) in gram.
proteinintProteinof the Grocery (per 100g) in gram.
fatintFat of the Grocery (per 100g) in gram.
caloriesintCalories of the Grocery (per 100g) in gram.
sugarintSugar of the Grocery (per 100g) in gram.

Success Response

{
    "name": "Organic Brown Rice",
    "id": 1536
    "category": "Grains",
    "subcategory": "Rice",
    "images": ["https://api.foodin.ai/groceries/organic-brown-rice.jpg"],
    "nutritional_info": {
        "serving_size": "1 cup (185g)",
        "calories": 216,
        "fat": 1.8,
        "saturated_fat": 0.3,
        "trans_fat": 0,
        "cholesterol": 0,
        "sodium": 1,
        "carbohydrates": 45.8,
        "fiber": 2.8,
        "sugar": 0.7,
        "protein": 4.5,
        "vitamin_a": 0,
        "vitamin_c": 0,
        "calcium": 2,
        "iron": 10,
    },
    "restrictions": ["gluten"],
    "preferences": {
	 "is_organic ": true,
	 "is_fair_trade": false,
 "is_gluten_free": false,
    	 "is_vegan": true,
    	 "is_vegetarian": true,
    	 "is_kosher": false,
    	 "is_halal": false,
    },
    "created_at": "2022-01-01T00:00:00.000Z",
    "updated_at": "2022-01-01T00:00:00.000Z"
}

Error 4xx

NameDescription
404There was no grocery available with the given parameters.
500Internal server error

Error Responses

404 Not found
{
  "error": "Not found"
}
500 Server error
{
  "error": "Internal server error"
}