Grocery API
Endpoints
GET Groceries by Category

GET Groceries within a category

GET Request groceries within a given category

/groceries?category=<category>

Success 200

FieldParameterDescription
nameStringName of the Grocery.
idintID of the Grocery.
categoryStringCategory of the Grocery.
subcategoryStringSubcategory of the Grocery.
nutritionsjsonNutritions 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 Response

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