Branded Foods Search

The brandedFoods query search for foods that belongs to a brand and/or have a barcode.

Branded foods are known as all the foods that belong to a brand and include a trademark and a barcode. For example "Oreo", "Hershey", "Mazola", "McCormick", etc. Find the list of brand foods on this page.

Characteristics

Within the branded food search you are able to:

  • Get the nutritional information for a specific food

  • Use pagination

  • Add a specific brand food barcode as an argument

  • Filter the information to retrieve the following results

    • ID

    • Tags

    • Nutrients

    • Name

    • Ingredients

    • Meal Time

    • Barcode

How to calculate the nutrient according to a food portion

Branded Foods are per each 100g.. For instance, each nutrient corresponds to 100g. To calculate the nutrients, use the following equation:

Where:

  • weight is equivalent to the servingSize

Available Arguments

Available Fields

Pagination

The brandedFoods query supports the use of pagination. The following fields can be used

 pageInfo{
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }

Examples

Get the nutritional information of a specific food

{
  brandedFoods(
    filter: {
      id: "QnJhbmRlZEZvb2ROb2RlOjg4MzE2OTZlLWJiMWItNDhkYi1iMmZjLWRmMzI1YjQ1NDY5OA=="
    }
  ) {
    edges {
      node {
        id
        name
        description
        gtinUpc
        brandOwner
        servingSize
        servingSizeUnit
        nutrients {
          type
          amount
          name
          unit
        }
      }
    }
  }
}

Get the list of recipes that contains "oreo"

The following example searches all the foods that contain oreo in it

{
  brandedFoods(query: "oreo", first: 2) {
    edges {
      node {
        id
        name
        gtinUpc
        brandOwner
        servingSize
        servingSizeUnit
        brandedFoodCategory
        nutrients {
          type
          amount
          name
          unit
        }
      }
    }
  }
}

Get the list of milk recipes with a specific Barcode

  • Without using query variables

{
  brandedFoods(barcode: "763528339136") 
  {
    edges {
      node {
        id
        name
        gtinUpc
        brandOwner
        servingSize
        servingSizeUnit
        nutrients {
          type
          amount
          name
          unit
        }
      }
    }
  }
}
  • Using query variables

To add a barcode as an argument in the search query, define query variables. Refer to this page for more information on how to add them.

query FoodSearch ($query: String, $first: Int, $barcode: String){
    brandedFoods(query: $query, first: $first, barcode: $barcode) {
    edges {
      node {
        id
        name
        gtinUpc
        brandOwner
        servingSize
        servingSizeUnit
        nutrients {
          id
          amount
          name
          unit
        }
      }
    }
  }
}

{
  "query": "milk",
  "first": 1,
  "barcode": "763528339136"
}

Get the first 2 results of recipes that contain "Oreo" cookies

Filter all the common foods that include the "gluten-free" and "low-carb" tags

{
  brandedFoods(first:2     
    filter:
       {
        tags:["gluten-free", "low-carb"] 
       }
   ) 
  {
    edges {
      node {
        id
        name
        gtinUpc
        brandOwner
        servingSize
        servingSizeUnit
        tags
        nutrients {
          type
          amount
          name
          unit
        }
      }
    }
  }
}

Get all the foods that contain banana filtered by specific nutrients

{
   brandedFoods(
    query: "banana"
    first: 3
    filter: {
      nutrients: [
        {nutrient:ENERGY range: {lte: 100}}
        {nutrient:PROTEIN range: {gte: 10}}
      ]
    }
  ) {
    edges {
      node {
        name
        calories
        brandOwner
        servingSize
        servingSizeUnit
      }
    }
  }
}

Last updated