Canadian Nutrient File API

Health Canada's official nutrient values for foods eaten in Canada: one record per food with energy, protein, fat, carbohydrate, sugars, fibre and sodium, every other nutrient with its unit and the household serving sizes. English or French.

$2 per 1,000 records

You pay only for the records you get. Zero records cost zero. 2,500 free records of this API to start (5,000 at the base price of $1 per 1,000), no card.

Try it
Ready-made, maintained by usRecords, 12 fieldsv1.0

Data from food-nutrition.canada.ca/api/canadian-nutrient-file/food/?lang=en&type=json

Get this data

Try it here with a few records, download the sample, fill a Google Sheet, or call it from your own code.

Try it

Searchoptional
Words of the food name, such as chicken or whole milk. Every word must appear in the name.
Example: chicken
Food codesoptional
Exact Canadian Nutrient File food codes, such as 571. One per line, or separated by commas.
Example: 571
Languageoptional
Language of food and nutrient names.

Run it on this page, or call it from your code with the endpoint in the developer section. A free key covers 2,500 records of this API, no card. Create a free key

For developers: the API and MCPThe endpoint, code in curl, JavaScript and Python, every input, and files for your tools
Endpoint
POSThttps://pullrow.dev/v1/apis/canadian-nutrient-file/run
  • Small runs answer in the same request; longer ones answer 202 with a run to poll.
  • fields returns only the fields you name. The examples send the ones picked on this page.
  • Idempotency-Key is optional. A retry with it is never charged twice.
  • You pay for records returned. Zero records cost zero.

Every run option, explained

Calling it needs a key
2,500 free records of this API to start. No card.
curl
curl -X POST "https://pullrow.dev/v1/apis/canadian-nutrient-file/run" \
  -H "Authorization: Bearer $PULLROW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input":{"search":"chicken"},"max_items":50}'

Inputs

Send them as input in the request body. Leave one out to use its default.

searchtext
Words of the food name, such as chicken or whole milk. Every word must appear in the name.
example: chicken
food_codeslist
Exact Canadian Nutrient File food codes, such as 571.
example: 571
languagetext
Language of food and nutrient names.
default: enexample: enone of: en, fr

What's in each record

12 fields: 11 here, 1 technical one under Technical details.

Basics

  • Food code

    Canadian Nutrient File food code.

    Example 5

  • Food description

    Name of the food, such as Chicken, broiler, giblets, raw.

    Example Chinese dish, chow mein, chicken

  • Energy kcal

    Energy in kilocalories per 100 g.

    Example 85

  • Protein g

    Protein in grams per 100 g.

    Example 6.76

  • Fat g

    Total fat in grams per 100 g.

    Example 2.8

  • Carbohydrate g

    Carbohydrate in grams per 100 g.

    Example 8.29

  • Sugars g

    Total sugars in grams per 100 g.

    Example 1.74

  • Fibre g

    Dietary fibre in grams per 100 g.

    Example 1

  • Sodium mg

    Sodium in milligrams per 100 g.

    Example 311

  • Nutrients

    Every nutrient of the food as objects with name, value (per 100 g), unit, standard_error and observations.

    Example 2 items: {} | {}

  • Serving sizes

    Household servings with their weight, such as 1 food guide serving = 90g.

    Example 100ml, 125ml

Technical detailsField names and types for developers, and the 1 field hidden above

Hidden by default

This field comes with each record too. It is an internal code, a note about how the record was read or a copy of what was searched for, so the lists above leave it out.

  • ID idFood code as text.

Field names and types

The names your code reads in each record. "Filled" counts how many of the 3 sample records carry the field.

Field nameTypeShown on this page asFilled
idtextID (hidden)3 of 3
food_codenumberFood code3 of 3
food_descriptiontextFood description3 of 3
energy_kcalnumberEnergy kcal3 of 3
protein_gnumberProtein g3 of 3
fat_gnumberFat g3 of 3
carbohydrate_gnumberCarbohydrate g3 of 3
sugars_gnumberSugars g2 of 3
fibre_gnumberFibre g3 of 3
sodium_mgnumberSodium mg3 of 3
nutrientslistNutrients3 of 3
serving_sizeslistServing sizes3 of 3

How it reads the site

Runs on a reader we built and maintain by hand for this site.

Sample records

Sample records
RecordFood codeFood descriptionEnergy kcalProtein gFat gCarbohydrate gSugars gFibre gSodium mgNutrientsServing sizes
15Chinese dish, chow mein, chicken856.762.88.291.7413114 items: Name: Lycopene · Value: 0 · Unit: µg | Name: Lactose · Value: 0 · Unit: g100ml, 125ml, 250ml, 1 order
28Fried chicken, mashed potatoes and vegetables17312.88.511.3—1.043444 items: Name: Alcohol · Value: 0 · Unit: g | Name: Caffeine · Value: 0 · Unit: mgno serving specified
383Egg, chicken, dried, whole60548.3743.041.530.304804 items: Name: Theobromine · Value: 0 · Unit: mg | Name: Fibre, total dietary · Value: 0 · Unit: g15ml, sifted, 100ml sifted, 250ml, sifted

Sample records from the example output this API publishes. Email addresses and phone numbers in them are masked. Hover over a column name to see the field name your code reads.

Reliability

Counted from real runs. Our own health checks are left out. A run succeeded when it finished and the site neither blocked it nor broke it.

Incidents and repairs

How it is kept working What a repair can't do

A ready-made API, maintained by us. It is not part of the daily check or the automatic rebuild yet.

  • You pay only for records returned. A run that returns none costs nothing.
Known limits
  • The file holds about 5,690 foods. Search by words in the food name (every word must appear) or give exact food codes; with neither input the run is refused.
  • Each food takes two extra requests (its nutrients and its serving sizes), so a run of 100 foods makes about 200 requests and needs a minute or two. At most 1,000 foods per run.
  • All nutrient values are per 100 g of the food as the Canadian Nutrient File states them (the 2015 release has not been updated since). A nutrient the lab never measured is listed with value 0 and 0 observations, so check observations before trusting a zero.
  • The source gives no food group, so no group field is offered. Serving sizes are empty for foods Health Canada lists without a household measure.
  • The seven headline fields (energy_kcal, protein_g, fat_g, carbohydrate_g, sugars_g, fibre_g, sodium_mg) are taken from the nutrient list and are null when the food has no such value.
  • Data: Health Canada, Canadian Nutrient File, under the Open Government Licence - Canada. Credit Health Canada when you use it; Health Canada does not endorse this API.

Version history

A run uses the live version unless the request names another one with version.