Skip to main content
Modify Nutrition Record
curl --request PATCH \
  --url https://app-api.spikeapi.com/v3/nutrition_records/{nutrition_record_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "consumed_at": "2023-11-07T05:31:56Z",
  "serving_size": 123
}
'
import requests

url = "https://app-api.spikeapi.com/v3/nutrition_records/{nutrition_record_id}"

payload = {
"consumed_at": "2023-11-07T05:31:56Z",
"serving_size": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({consumed_at: '2023-11-07T05:31:56Z', serving_size: 123})
};

fetch('https://app-api.spikeapi.com/v3/nutrition_records/{nutrition_record_id}', 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://app-api.spikeapi.com/v3/nutrition_records/{nutrition_record_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'consumed_at' => '2023-11-07T05:31:56Z',
'serving_size' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://app-api.spikeapi.com/v3/nutrition_records/{nutrition_record_id}"

payload := strings.NewReader("{\n \"consumed_at\": \"2023-11-07T05:31:56Z\",\n \"serving_size\": 123\n}")

req, _ := http.NewRequest("PATCH", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.patch("https://app-api.spikeapi.com/v3/nutrition_records/{nutrition_record_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"consumed_at\": \"2023-11-07T05:31:56Z\",\n \"serving_size\": 123\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://app-api.spikeapi.com/v3/nutrition_records/{nutrition_record_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"consumed_at\": \"2023-11-07T05:31:56Z\",\n \"serving_size\": 123\n}"

response = http.request(request)
puts response.read_body
{
  "dish_name": "<string>",
  "serving_size": 1.01,
  "consumed_at": "2023-11-07T05:31:56Z",
  "dish_description": "<string>",
  "dish_description_translated": "<string>",
  "dish_name_translated": "<string>",
  "failure_reason": "<string>",
  "ingredients": [
    {
      "name": "<string>",
      "serving_size": 123,
      "name_translated": "<string>",
      "nutritional_fields": {
        "calcium_mg": 123,
        "carbohydrate_g": 123,
        "cholesterol_mg": 123,
        "energy_kcal": 123,
        "fat_monounsaturated_g": 123,
        "fat_polyunsaturated_g": 123,
        "fat_saturated_g": 123,
        "fat_total_g": 123,
        "fat_trans_g": 123,
        "fiber_total_dietary_g": 123,
        "folate_mcg": 123,
        "iron_mg": 123,
        "magnesium_mg": 123,
        "manganese_mcg": 123,
        "niacin_mg": 123,
        "phosphorus_mg": 123,
        "potassium_mg": 123,
        "protein_g": 123,
        "riboflavin_mg": 123,
        "salt_g": 123,
        "salt_mg": 123,
        "sodium_g": 123,
        "sodium_mg": 123,
        "sugars_total_g": 123,
        "thiamin_mg": 123,
        "vitamin_a_rae_mcg": 123,
        "vitamin_b12_mcg": 123,
        "vitamin_b6_mg": 123,
        "vitamin_c_mg": 123,
        "vitamin_d_mcg": 123,
        "vitamin_e_mg": 123,
        "vitamin_k_mcg": 123,
        "zinc_mg": 123
      }
    }
  ],
  "modified_at": "2023-11-07T05:31:56Z",
  "nutri_score": "<string>",
  "nutritional_fields": {
    "calcium_mg": 123,
    "carbohydrate_g": 123,
    "cholesterol_mg": 123,
    "energy_kcal": 123,
    "fat_monounsaturated_g": 123,
    "fat_polyunsaturated_g": 123,
    "fat_saturated_g": 123,
    "fat_total_g": 123,
    "fat_trans_g": 123,
    "fiber_total_dietary_g": 123,
    "folate_mcg": 123,
    "iron_mg": 123,
    "magnesium_mg": 123,
    "manganese_mcg": 123,
    "niacin_mg": 123,
    "phosphorus_mg": 123,
    "potassium_mg": 123,
    "protein_g": 123,
    "riboflavin_mg": 123,
    "salt_g": 123,
    "salt_mg": 123,
    "sodium_g": 123,
    "sodium_mg": 123,
    "sugars_total_g": 123,
    "thiamin_mg": 123,
    "vitamin_a_rae_mcg": 123,
    "vitamin_b12_mcg": 123,
    "vitamin_b6_mg": 123,
    "vitamin_c_mg": 123,
    "vitamin_d_mcg": 123,
    "vitamin_e_mg": 123,
    "vitamin_k_mcg": 123,
    "zinc_mg": 123
  },
  "record_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "uploaded_at": "2023-11-07T05:31:56Z",
  "user_time_offset_minutes": 123
}
{
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}
{
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}
{
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}
{
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}
{
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

nutrition_record_id
string
required

Nutrition report record ID

Body

application/json
consumed_at
string<date-time>

The UTC time when food was consumed

Examples:

"2006-01-02T15:04:05"

"2006-01-02T15:04:05Z"

serving_size
number<double>

Serving size in metric units

Example:

120

Response

OK

dish_name
string
required

Detected dish name

Example:

"beef and broccoli stir-fry"

serving_size
number<double>
required

Serving size in metric units

Required range: x >= 0.01
Example:

120

unit
enum<string>
required

Metric unit (g for solids, ml for liquids)

Available options:
g,
mg,
mcg,
ml,
kcal
Example:

"g"

consumed_at
string<date-time>

The UTC time when food was consumed. By default, it is set to the record update time

Examples:

"2006-01-02T15:04:05"

"2006-01-02T15:04:05Z"

dish_description
string

Detected dish description

Example:

"beef, ground, lean, cooked with broccoli, raw and rice, brown, cooked"

dish_description_translated
string

Dish description translated to target language

Example:

"Rindfleisch, Hackfleisch, mager, gekocht mit Brokkoli, roh und Reis, braun, gekocht"

dish_name_translated
string

Dish name translated to target language

Example:

"Rindfleisch und Brokkoli Pfanne"

failure_reason
string
read-only

Reason for processing failure

Example:

"Unable to identify food items"

ingredients
object[] | null

List of detected ingredients with nutritional information

input_type
enum<string>
read-only

Nutrition record input type

Available options:
image,
manual,
push,
text
Example:

"image"

modified_at
string<date-time>
read-only

Update timestamp in UTC

Example:

"2025-09-15T10:30:12.132Z"

nutri_score
string

Nutri-Score known as the 5-Colour Nutrition label (A-E)

Example:

"B"

nutritional_fields
object

Nutritional values in the given serving size

record_id
string<uuid>
read-only

Report record ID

Example:

"6ba7b810-9dad-11d1-80b4-00c04fd430c8"

status
enum<string>
read-only

Processing status

Available options:
pending,
processing,
completed,
failed,
updated
Example:

"completed"

uploaded_at
string<date-time>
read-only

Upload timestamp in UTC

Example:

"2025-09-15T10:30:04.521Z"

user_time_offset_minutes
integer<int32>

User's local timezone offset in minutes

Example:

-540