Skip to content

Search for Food

GET
/search

Searches for food items based on a query string with pagination support and optional type filtering. Nutrient units are fixed per nutrient. See unit reference: https://newtrition-data.com/data-reference/units/

query
required
string

Search query for food name

type
string
Allowed values: all generic branded

Filter by food type (all, generic, branded). Default: all

limit
integer

Number of items per page (1-100, default: 10)

offset
integer

Number of items to skip (default: 0)

page
integer

Page number (alternative to offset)

X-Context-ID
string

Context ID of the end user (used for analytics and weighting). If not provided, defaults to client ID.

Paginated list of matching food items

Media typeapplication/json
object
data
Array<object>
object
brand
string
gtin
string
is_solid
boolean
name
string
processed_variants
Array<object>
object
big7
object
carbohydrates
object
amount
number
unit

The output units are fixed per nutrient/output! See: https://newtrition-data.com/data-reference/units/

string
Allowed values: µg mg g kg kJ ml l kJ/g kcal/g
energy
object
amount
number
unit

The output units are fixed per nutrient/output! See: https://newtrition-data.com/data-reference/units/

string
Allowed values: µg mg g kg kJ ml l kJ/g kcal/g
fat
object
amount
number
unit

The output units are fixed per nutrient/output! See: https://newtrition-data.com/data-reference/units/

string
Allowed values: µg mg g kg kJ ml l kJ/g kcal/g
protein
object
amount
number
unit

The output units are fixed per nutrient/output! See: https://newtrition-data.com/data-reference/units/

string
Allowed values: µg mg g kg kJ ml l kJ/g kcal/g
salt
object
amount
number
unit

The output units are fixed per nutrient/output! See: https://newtrition-data.com/data-reference/units/

string
Allowed values: µg mg g kg kJ ml l kJ/g kcal/g
saturated_fatty_acids
object
amount
number
unit

The output units are fixed per nutrient/output! See: https://newtrition-data.com/data-reference/units/

string
Allowed values: µg mg g kg kJ ml l kJ/g kcal/g
sugar
object
amount
number
unit

The output units are fixed per nutrient/output! See: https://newtrition-data.com/data-reference/units/

string
Allowed values: µg mg g kg kJ ml l kJ/g kcal/g
id
string
processing
string
Allowed values: raw baked boiled braised broiled deep-fried dried fried roasted steamed stewed
quantity_unit
string
quantity_value
number
search_weight
number
type
string
Allowed values: generic_single_food generic_composite_food branded_food
links
object
first
string
last
string
next
string
previous
string
self
string
pagination
object
has_next
boolean
has_previous
boolean
limit
integer
offset
integer
page
integer
total_count
integer
total_pages
integer
Example
{
"data": [
{
"processed_variants": [
{
"big7": {
"carbohydrates": {
"amount": 225.5,
"unit": "g"
},
"energy": {
"amount": 225.5,
"unit": "g"
},
"fat": {
"amount": 225.5,
"unit": "g"
},
"protein": {
"amount": 225.5,
"unit": "g"
},
"salt": {
"amount": 225.5,
"unit": "g"
},
"saturated_fatty_acids": {
"amount": 225.5,
"unit": "g"
},
"sugar": {
"amount": 225.5,
"unit": "g"
}
},
"processing": "raw"
}
],
"type": "generic_single_food"
}
]
}
X-RateLimit-Limit
integer

Maximum requests per minute

X-RateLimit-Remaining
integer

Requests remaining in current window

X-RateLimit-Reset
integer

Unix timestamp when rate limit resets

X-RateLimit-Used
integer

Requests used in current window

Missing query parameter, invalid pagination parameters, or invalid type filter

Media typeapplication/json
object
error
object
code
string
details
message
string
Examplegenerated
{
"error": {
"code": "example",
"details": "example",
"message": "example"
}
}

Unauthorized

Media typeapplication/json
object
error
object
code
string
details
message
string
Examplegenerated
{
"error": {
"code": "example",
"details": "example",
"message": "example"
}
}

Rate limit exceeded

Media typeapplication/json
object
error
object
code
string
details
message
string
Examplegenerated
{
"error": {
"code": "example",
"details": "example",
"message": "example"
}
}
X-RateLimit-Limit
integer

Maximum requests per minute

X-RateLimit-Remaining
integer

Requests remaining in current window

X-RateLimit-Reset
integer

Unix timestamp when rate limit resets

X-RateLimit-Used
integer

Requests used in current window

X-Retry-After
integer

Seconds to wait before retrying

Internal Server Error

Media typeapplication/json
object
error
object
code
string
details
message
string
Examplegenerated
{
"error": {
"code": "example",
"details": "example",
"message": "example"
}
}