List meals
curl --request GET \
--url https://api.onvy.health/users/{user_id}/nutrition/meals \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.onvy.health/users/{user_id}/nutrition/meals"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.onvy.health/users/{user_id}/nutrition/meals', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.onvy.health/users/{user_id}/nutrition/meals",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.onvy.health/users/{user_id}/nutrition/meals"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.onvy.health/users/{user_id}/nutrition/meals")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onvy.health/users/{user_id}/nutrition/meals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"meals": [
{
"id": "meal_01JCXVK5N3P4Q2R7S8T9U0V1W2",
"user_id": "<string>",
"project_id": "<string>",
"meal_time": "2024-10-28T12:00:00Z",
"analysis_status": "complete",
"created_at": "2024-10-28T12:05:00Z",
"updated_at": "2024-10-28T12:10:00Z",
"description": "Grilled chicken breast with quinoa and steamed broccoli",
"image_url": "https://s3.amazonaws.com/bucket/meals/image.jpg?X-Amz-...",
"portion_multiplier": 1.5,
"comment": "Homemade healthy lunch",
"analysis_error": "Failed to analyze meal: Image is not food-related",
"summary_id": "aisummary_01JCXVK5N3P4Q2R7S8T9U0V1W2",
"ai_generated": true,
"title": "Meal Summary",
"text": "Great balanced meal! This chicken with broccoli and brown rice provides excellent protein (35g) with moderate carbs.",
"name": "Grilled Chicken with Vegetables",
"ingredients": "chicken breast, broccoli, brown rice, olive oil",
"calories": 450,
"protein_grams": 35,
"fat_grams": 12,
"carbohydrate_grams": 45,
"sugar_grams": 5,
"fiber_grams": 6,
"glucose_spike_mg_dl": 25,
"healthiness_score": "A"
}
],
"pagination": {
"limit": 500,
"total": 1,
"page": "<string>",
"next_page": "<string>"
}
}{
"error": "<string>"
}meals
List meals
Get paginated list of meals for a user
GET
/
users
/
{user_id}
/
nutrition
/
meals
List meals
curl --request GET \
--url https://api.onvy.health/users/{user_id}/nutrition/meals \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.onvy.health/users/{user_id}/nutrition/meals"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.onvy.health/users/{user_id}/nutrition/meals', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.onvy.health/users/{user_id}/nutrition/meals",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.onvy.health/users/{user_id}/nutrition/meals"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.onvy.health/users/{user_id}/nutrition/meals")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onvy.health/users/{user_id}/nutrition/meals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"meals": [
{
"id": "meal_01JCXVK5N3P4Q2R7S8T9U0V1W2",
"user_id": "<string>",
"project_id": "<string>",
"meal_time": "2024-10-28T12:00:00Z",
"analysis_status": "complete",
"created_at": "2024-10-28T12:05:00Z",
"updated_at": "2024-10-28T12:10:00Z",
"description": "Grilled chicken breast with quinoa and steamed broccoli",
"image_url": "https://s3.amazonaws.com/bucket/meals/image.jpg?X-Amz-...",
"portion_multiplier": 1.5,
"comment": "Homemade healthy lunch",
"analysis_error": "Failed to analyze meal: Image is not food-related",
"summary_id": "aisummary_01JCXVK5N3P4Q2R7S8T9U0V1W2",
"ai_generated": true,
"title": "Meal Summary",
"text": "Great balanced meal! This chicken with broccoli and brown rice provides excellent protein (35g) with moderate carbs.",
"name": "Grilled Chicken with Vegetables",
"ingredients": "chicken breast, broccoli, brown rice, olive oil",
"calories": 450,
"protein_grams": 35,
"fat_grams": 12,
"carbohydrate_grams": 45,
"sugar_grams": 5,
"fiber_grams": 6,
"glucose_spike_mg_dl": 25,
"healthiness_score": "A"
}
],
"pagination": {
"limit": 500,
"total": 1,
"page": "<string>",
"next_page": "<string>"
}
}{
"error": "<string>"
}Authorizations
OAuth bearer token for Health API authentication
Path Parameters
User ID (e.g., google_104940819145861640201)
Query Parameters
Page Key for pagination
Number of items per page
Required range:
1 <= x <= 1000Was this page helpful?