GET api/Foods?EmailAddress={EmailAddress}&APIKey={APIKey}&Count={Count}&searchCriterion={searchCriterion}
This API will get the list of foods with their ingredients and nutrional information matching your search criterion.
Request Information
URI Parameters
Name | Description | Type | Additional information |
---|---|---|---|
EmailAddress |
Client's email address given when they requested an API Key. |
string |
Required |
APIKey |
Client's API Key check your email for this after your request of an API Key. |
string |
Required |
Count |
Range 1 to 20, limits number of result records returned. The actual number of records may be less than this Count value depending upon result set for your search criterion. |
integer |
Default value is 1 |
searchCriterion |
Name of the food product or the food product's UPC code. (The default search uses the UPC code for Planters Lightly Salted Mixed Nuts.) |
string |
Default value is 029000016699 |
Body Parameters
None.
Response Information
Resource Description
This API returns apiResponseFoods which includes state information about the call and if successful a collection of food records. See the apiResponseFoods definition below.
apiResponseFoodsName | Description | Type | Additional information |
---|---|---|---|
responseStatus |
The status of GetFoodsAPI GET api/Foods call. |
FoodsResponseEnum |
None. |
foodsList |
Foods list containing the foods returned by search if status == Success. |
Collection of foodResult |
None. |
allTimeNumberOfCallsToThisAPI |
The all time number of calls made by this client to the GetFoodsAPI. (Will always return 1 for failed calls to the API.) |
integer |
None. |
Response Formats
application/json, text/json
{ "responseStatus": 0, "foodsList": [ { "foodInformation": { "fdc_id": 1, "Name": "sample string 2", "UPC": "sample string 3", "Manufacturer": "sample string 4", "BrandName": "sample string 5", "SubBrandName": "sample string 6", "ModifiedDate": "2024-12-23T12:47:06.9629421-06:00", "AvailableDate": "2024-12-23T12:47:06.9629421-06:00", "Ingredients": "sample string 9", "NotASourceOf": "sample string 10", "ServingSize": 11.0, "ServingSizeUOM": "sample string 12", "HouseholdServing": "sample string 13" }, "nutrionalInformation": [ { "fdc_id": 1, "name": "sample string 2", "amount": 3.0, "unit_name": "sample string 4" }, { "fdc_id": 1, "name": "sample string 2", "amount": 3.0, "unit_name": "sample string 4" } ] }, { "foodInformation": { "fdc_id": 1, "Name": "sample string 2", "UPC": "sample string 3", "Manufacturer": "sample string 4", "BrandName": "sample string 5", "SubBrandName": "sample string 6", "ModifiedDate": "2024-12-23T12:47:06.9629421-06:00", "AvailableDate": "2024-12-23T12:47:06.9629421-06:00", "Ingredients": "sample string 9", "NotASourceOf": "sample string 10", "ServingSize": 11.0, "ServingSizeUOM": "sample string 12", "HouseholdServing": "sample string 13" }, "nutrionalInformation": [ { "fdc_id": 1, "name": "sample string 2", "amount": 3.0, "unit_name": "sample string 4" }, { "fdc_id": 1, "name": "sample string 2", "amount": 3.0, "unit_name": "sample string 4" } ] } ], "allTimeNumberOfCallsToThisAPI": 1 }
application/xml, text/xml
<apiResponseFoods xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/PasswordGeneratorAPI.Controllers"> <allTimeNumberOfCallsToThisAPI>1</allTimeNumberOfCallsToThisAPI> <foodsList> <foodResult> <foodInformation xmlns:d4p1="http://schemas.datacontract.org/2004/07/PasswordGeneratorAPI.Models"> <d4p1:AvailableDate>2024-12-23T12:47:06.9629421-06:00</d4p1:AvailableDate> <d4p1:BrandName>sample string 5</d4p1:BrandName> <d4p1:HouseholdServing>sample string 13</d4p1:HouseholdServing> <d4p1:Ingredients>sample string 9</d4p1:Ingredients> <d4p1:Manufacturer>sample string 4</d4p1:Manufacturer> <d4p1:ModifiedDate>2024-12-23T12:47:06.9629421-06:00</d4p1:ModifiedDate> <d4p1:Name>sample string 2</d4p1:Name> <d4p1:NotASourceOf>sample string 10</d4p1:NotASourceOf> <d4p1:ServingSize>11</d4p1:ServingSize> <d4p1:ServingSizeUOM>sample string 12</d4p1:ServingSizeUOM> <d4p1:SubBrandName>sample string 6</d4p1:SubBrandName> <d4p1:UPC>sample string 3</d4p1:UPC> <d4p1:fdc_id>1</d4p1:fdc_id> </foodInformation> <nutrionalInformation xmlns:d4p1="http://schemas.datacontract.org/2004/07/PasswordGeneratorAPI.Models"> <d4p1:FoodNutrientsQueryResults> <d4p1:amount>3</d4p1:amount> <d4p1:fdc_id>1</d4p1:fdc_id> <d4p1:name>sample string 2</d4p1:name> <d4p1:unit_name>sample string 4</d4p1:unit_name> </d4p1:FoodNutrientsQueryResults> <d4p1:FoodNutrientsQueryResults> <d4p1:amount>3</d4p1:amount> <d4p1:fdc_id>1</d4p1:fdc_id> <d4p1:name>sample string 2</d4p1:name> <d4p1:unit_name>sample string 4</d4p1:unit_name> </d4p1:FoodNutrientsQueryResults> </nutrionalInformation> </foodResult> <foodResult> <foodInformation xmlns:d4p1="http://schemas.datacontract.org/2004/07/PasswordGeneratorAPI.Models"> <d4p1:AvailableDate>2024-12-23T12:47:06.9629421-06:00</d4p1:AvailableDate> <d4p1:BrandName>sample string 5</d4p1:BrandName> <d4p1:HouseholdServing>sample string 13</d4p1:HouseholdServing> <d4p1:Ingredients>sample string 9</d4p1:Ingredients> <d4p1:Manufacturer>sample string 4</d4p1:Manufacturer> <d4p1:ModifiedDate>2024-12-23T12:47:06.9629421-06:00</d4p1:ModifiedDate> <d4p1:Name>sample string 2</d4p1:Name> <d4p1:NotASourceOf>sample string 10</d4p1:NotASourceOf> <d4p1:ServingSize>11</d4p1:ServingSize> <d4p1:ServingSizeUOM>sample string 12</d4p1:ServingSizeUOM> <d4p1:SubBrandName>sample string 6</d4p1:SubBrandName> <d4p1:UPC>sample string 3</d4p1:UPC> <d4p1:fdc_id>1</d4p1:fdc_id> </foodInformation> <nutrionalInformation xmlns:d4p1="http://schemas.datacontract.org/2004/07/PasswordGeneratorAPI.Models"> <d4p1:FoodNutrientsQueryResults> <d4p1:amount>3</d4p1:amount> <d4p1:fdc_id>1</d4p1:fdc_id> <d4p1:name>sample string 2</d4p1:name> <d4p1:unit_name>sample string 4</d4p1:unit_name> </d4p1:FoodNutrientsQueryResults> <d4p1:FoodNutrientsQueryResults> <d4p1:amount>3</d4p1:amount> <d4p1:fdc_id>1</d4p1:fdc_id> <d4p1:name>sample string 2</d4p1:name> <d4p1:unit_name>sample string 4</d4p1:unit_name> </d4p1:FoodNutrientsQueryResults> </nutrionalInformation> </foodResult> </foodsList> <responseStatus>Success</responseStatus> </apiResponseFoods>