Skip to content

Instantly share code, notes, and snippets.

@mattsilv
mattsilv / keybase.md
Created March 29, 2021 13:48
keybase.md

Keybase proof

I hereby claim:

  • I am mattsilv on github.
  • I am mattsilv (https://keybase.io/mattsilv) on keybase.
  • I have a public key ASAItkAS14VU2DRAuzN33Vl6OUXV10Mwc8Lzrtx_bju_Vwo

To claim this, I am signing this object:

Verifying my Blockstack ID is secured with the address 1KYH9LSLa4SLDzVXDXHiLpYVg38Q9a3ghm https://explorer.blockstack.org/address/1KYH9LSLa4SLDzVXDXHiLpYVg38Q9a3ghm
@mattsilv
mattsilv / example.md
Last active November 17, 2023 10:49
Nutritionix API v2 - Example GET Request to /search/item Endpoint
@mattsilv
mattsilv / example.md
Last active February 27, 2024 21:39
Nutritionix API v2: Natural Exercise Endpoint Sample

POST /v2/natural/exercise

headers:

  • x-app-id
  • x-app-key
  • Content-Type: application/json

POST request body:

{
 "query":"ran 3 miles",
@mattsilv
mattsilv / autocomplete.md
Last active August 12, 2022 21:20
Nutritionix API v2: Autocomplete

API V2: Autocomplete

The V2 autocomplete API aims to allow users the convenience of "as you type" suggestions.

HTTP GET to /v2/autocomplete

To make perform a search, make an HTTP GET request to the /v2/autocomplete endpoint.

GET Parameters

@mattsilv
mattsilv / nutritionix-usda.md
Last active May 22, 2017 19:20
Nutritionix API USDA Documentation

USDA Getting Started

Example NXQL Queries

// returns items that are not restaurants and nf_serving_weight_grams is not null
// includes usda_fields in the results so items that contain those fields will return
// fields.usda_fields
{
  "fields":["item_name","brand_name","keywords","usda_fields"],
  "query":"celery",

Nutritionix Querying Language (NXQL)

NXQL allows developers to write more advanced queries against our data pool. Examples of what you can do with an advanced query:

  • Filter items by their type (show ONLY USDA items or ONLY CPG items)
  • Filter nutrient ranges (>100 calories AND <500 calories)

All requests are POST and require a valid JSON object be sent to https://api.nutritionix.com/v1_1/search You can paste any of the below JSON examples into this curl request and they will retrieve results assuming you have added your appKey, and appId.

Request Requirements