Foods

Function-calling namespace: foods

  • Base URL: https://api.aivida.in
  • Engine endpoint: POST /api
  • Auth: Stack token middleware enabled in optional mode.
  • Send token in header: x-stack-access-token: <access_token> (or Authorization: Bearer <access_token>).
  • In optional mode: no token is allowed; invalid token is rejected with 401.

analyze

Source: backend/endpoints/foods/analyze

Input Fields

FieldTypeRequired
image_urlstringNo
image_base64stringNo

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "foods",
  "apiName": "analyze",
  "data": {
    "image_url": "value",
    "image_base64": "value"
  }
}'

Example Response

{ "status": "ok", "data": {} }

bulk

Source: backend/endpoints/foods/bulk

Input Fields

FieldTypeRequired
items[]FoodItemYes

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "foods",
  "apiName": "bulk",
  "data": {
    "items": []
  }
}'

Example Response

{ "status": "ok", "data": {} }

create

Source: backend/endpoints/foods/create

Input Fields

FieldTypeRequired
namestringYes
categorystringNo
caloriesintNo
proteinfloat64No
carbsfloat64No
fatfloat64No
fiberfloat64No
serving_sizestringNo
ingredients[]stringNo
image_urlstringNo

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "foods",
  "apiName": "create",
  "data": {
    "name": "value"
  }
}'

Example Response

{ "status": "ok", "data": {} }

delete

Source: backend/endpoints/foods/delete

Input Fields

FieldTypeRequired
idstringYes

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "foods",
  "apiName": "delete",
  "data": {
    "id": "id_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }

get

Source: backend/endpoints/foods/get

Input Fields

FieldTypeRequired
idstringYes

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "foods",
  "apiName": "get",
  "data": {
    "id": "id_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }

list

Source: backend/endpoints/foods/list

Input Fields

FieldTypeRequired
pageintNo
page_sizeintNo

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "foods",
  "apiName": "list",
  "data": {
    "page": 1,
    "page_size": 1
  }
}'

Example Response

{ "status": "ok", "data": {} }

Source: backend/endpoints/foods/search

Input Fields

FieldTypeRequired
querystringNo
categorystringNo
min_caloriesintNo
max_caloriesintNo

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "foods",
  "apiName": "search",
  "data": {
    "query": "value",
    "category": "value",
    "min_calories": 1,
    "max_calories": 1
  }
}'

Example Response

{ "status": "ok", "data": {} }

update

Source: backend/endpoints/foods/update

Input Fields

FieldTypeRequired
idstringYes
name*stringNo
category*stringNo
calories*intNo
protein*float64No
carbs*float64No
fat*float64No
fiber*float64No
serving_size*stringNo
ingredients*[]stringNo
image_url*stringNo

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "foods",
  "apiName": "update",
  "data": {
    "id": "id_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }