SpyREST

Supported by Mashape

Home » api.nutritionix.com Versions » v1.1 Resources » Random » POST /v1_1/search

POST /v1_1/search

Description

Response Fields

Name Type Description
total Integer
max_score Float
hits Array
hits[]._index String
hits[]._type String
hits[]._id String
hits[]._score Float
hits[].fields.item_id String
hits[].fields.item_name String
hits[].fields.brand_name String
Write
Preview

Examples

Filter all but restaurants

Filter all but restaurants

Recorded at

2015-11-03 23:26:08 UTC

Try with cURL

Request URL

POST /v1_1/search      

Request Headers

content-length: 115
content-type: application/json
accept: */*
user-agent: curl/7.37.1
      

Request Body

{"appId":"27bea288","appKey":"20e7dbd58d07239743c441a2488f3cbb","query":"Coffee","filters":{"not":{"item_type":2}}}
      

Response Headers

transfer-encoding: chunked
connection: close
content-length: 2191
x-powered-by: Express, Phusion Passenger
status: 200 OK
set-cookie: ["session=fcUbwOtT_Kn-RmyY-XCfcQ.i96knX8bImQjrmCgLiOo3dj4jpdzxajVZCOtM-mVAB4.1446593175660.86400000.Ihkl6z6UtsYz3R5TgI-BCeFiGS00p6BUmuJuSR4O_04; path=/; expires=Thu, 03 Dec 2015 23:26:15 GMT"]
server: nginx/1.6.2 + Phusion Passenger
etag: "725208954"
date: Tue, 03 Nov 2015 23:26:15 GMT
content-type: application/json; charset=utf-8
access-control-allow-origin: *
access-control-allow-methods: GET, PUT, POST, DELETE, OPTIONS
access-control-allow-headers: Content-Type, X-Requested-With, X-APP-ID, X-APP-KEY
      

Response Body

Shortened for readability

{
  "total": 3515,
  "max_score": 12.207488,
  "hits": [
    {
      "_index": "f762ef22-e660-434f-9071-a10ea6691c27",
      "_type": "item",
      "_id": "513fceb675b8dbbc21001e29",
      "_score": 12.207488,
      "fields": {
        "item_id": "513fceb675b8dbbc21001e29",
        "item_name": "Coffee - 1 tsp",
        "brand_name": "USDA"
      }
    },
    {
      "_index": "f762ef22-e660-434f-9071-a10ea6691c27",
      "_type": "item",
      "_id": "513fceb675b8dbbc21001e28",
      "_score": 12.133621,
      "fields": {
        "item_id": "513fceb675b8dbbc21001e28",
        "item_name": "Coffee - 1 packet",
        "brand_name": "USDA"
      }
    }
  ]
}