foods.autocomplete

Description

Returns a list of suggestions for the expression specified.

Localization (Premier Only):

Two additional optional parameters named region and language are available to premier clients. More information can be found in the Localization guide.

Note: foods.autocomplete only works for the default region / language combination.

Parameters

Required

Name Type Description
method String MUST be "foods.autocomplete"
expression String Suggestions for the given expression is returned. E.G.: "chic" will return up to four of the best suggestions that contains "chic".

Optional

Name Type Description
format String The desired response format. Valid reponse formats are "xml" or "json" (default value is "xml").
max_results Int The maximum number of results to return (default value is 4). This number cannot be greater than 10.

Response

The result of the call is the best suggestions matching the expression specified, ordered by their relevency to the expression. Up to four suggestions are returned.

Example Return XML

<?xml version="1.0" encoding="utf-8" ?>
<suggestions xmlns="http://platform.fatsecret.com/api/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://platform.fatsecret.com/api/1.0/ http://platform.fatsecret.com/api/1.0/fatsecret.xsd">
    <suggestion>chicken</suggestion>
    <suggestion>chicken breast</suggestion>
    <suggestion>chicken salad</suggestion>
    <suggestion>chiken wings</suggestion>
</suggestions>

Example Return JSON

{ "suggestions": { "suggestion": [ "chicken", "chicken breast", "chicken salad", "chiken wings" ] }}

Error Code

Code Description
13 Invalid token: "<detail>"
101 Missing required parameter: "<detail>"
107 Value out of range: "<detail>"
FatSecret Sites
For Developers

For Professionals

For Everyone

FatSecret Platform API

Developers

Support
API

About FatSecret

© 2022 FatSecret. All rights reserved.