Autocomplete

The Autocomplete endpoint provides a list of the most popular ingredients and products in several languages, and can be used to add autocomplete functionality to your application.

GET
https://cdn.whisk.com/autocomplete/v1/{language-tag}/{file-type}.json

Parameters

ATTRIBUTETYPEDESCRIPTION
language-tag*language-tag

Language

file-type*file-type

The amount of data you will be getting in the product list

language-tag

language-tag - the language and locale of the autocomplete list. E.g “en-us”.

Language codeLocale codeDefault Locale
engb, usgb
eses, mxes
frfr
svse
dede
zhcn
ko
it
no

For English language tag could be:

  • en-us – US product names in English;
  • en-gb – GB product names in English;
  • en - same as en-gb.

file-type

file-type – this parameter allows you to control the amount of data you will be getting in the product list. Available options:

  • all – full data, all items with full content;
  • all-slim - all items are returned and the items do not include metadata information;
  • food - only food items, including metadata (check the response section for more information);
  • food-slim - only food items not including metadata.

Working with images

Our CDN provides utilities to manage image size and format. You can find more information in our: Image Load Optimization documentation.

Optimization

To reduce the amount of traffic for your application we recommend using these headers:

  1. Accept-Encoding: deflate, gzip - this will reduce the size of the response, consequently speeding up the request time.
  2. If-Modified-Since - this will download content only if it has been modified. More about it here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Modified-Since.

Sample Request

curl "https://cdn.whisk.com/autocomplete/v1/it/all.json" \ -H "Accept-Encoding: deflate, gzip" \ -H "If-Modified-Since: Wed, 04 Mar 2020 10:30:58"

Response

ATTRIBUTETYPEDESCRIPTION
namestring

The canonical name of the product, identical for all languages

displayNamestring

The name of the product in the selected language

imageUrlstring

The link to the product’s image

nounFormstring

Indicates if the product name is singular, plural or invariant

metadataMetadata

Metadata

ATTRIBUTETYPEDESCRIPTION
categorystring

The product’s category

sortingstring

The product’s storing recommendation

Sample Response

{ "products": [ { "name": "ANCHOVY", "displayName": "Acciuga", "imageUrl": "https://whisk-res.cloudinary.com/image/upload/v1550764890/graph/fooddb/cdd6c37ccd140664a46573d10e2fde25.jpg", "metadata": { "category": "MEATS AND SEAFOOD", "storing": { "pantry": { "metric": "Years", "min": 1, "max": 1 }, "defaultLocation": "Pantry" } }, "nounForm": "singular" } ] }