SearchByName - Resource
Summary
Searches published foods returning those which case-insensitively match the supplied name, or which contain a food with the name.
Note: If you are upgrading to Gen API 3.1 (or later) you will want to reference this page.
Resource
POST
/rest/FoodQueryService.svc/SearchByName
Request
Parameter | Type | Description |
---|---|---|
request | PublishedFoodsByNameRequest | A JSON serialized PublishedFoodsByNameRequest object, with the "Name" property set to a string contained in the target food name. |
Examples
Example Request
request={"FoodName":"Sample"}
Example Response
{ "Foods": [{ "HaccpData": [], "CookMethod": null, "CookTemperature": null, "CookTime": null, "Instructions": null, "HaccpHeadingLevel": null, "PanSize": null, "PreparationTime": null, "ContentClaimReferenceId": null, "DefinedServingWeightConversion": null, "UseStaticAdditionalAllergenStatement": false, "UseStaticAllergenStatement": false, "UseStaticIngredientStatement": false, "FoodType": 82, "Name": { "en-US": "SAMPLE, Peas, seasoned" }, "CommonName": { "en-US": "SAMPLE, Peas, seasoned" }, "Description": { "en-US": "" }, "FoodTypeName": null, "VarietyName": null, "PrimaryDescriptor": null, "Title": null, "PreparationName": null, "OtherDescriptor": null, "ContentName": null, "MiscName": null, "DefiningAmount": { "Quantity": { "Value": 0.0 }, "UnitId": "00000000-0000-0000-0000-000000000000" }, "AmountCost": { "Amount": { "Quantity": { "Value": 0.0 }, "UnitId": "00000000-0000-0000-0000-000000000000" }, "Cost": 0.0 }, "DefaultWeightUnitId": null, "ConversionMapId": null, "Conversions": [], "Items": [{ "FoodId": "dbfac0f0-afa6-0000-27c3-41e8c688e289", "Amount": { "Quantity": { "Value": 0.08 }, "UnitId": "a7df0af5-0006-0000-7484-751e8eaf05c6" }, "Note": "" }, { "FoodId": "dbfac0f0-659e-0000-27c3-41e8c688e289", "Amount": { "Quantity": { "Value": 0.03 }, "UnitId": "a7df0af5-0002-0000-7484-751e8eaf05c6" }, "Note": "" }, { "FoodId": "dbfac0f0-13fe-0000-27c3-41e8c688e289", "Amount": { "Quantity": { "Value": 0.2 }, "UnitId": "a7df0af5-0007-0000-7484-751e8eaf05c6" }, "Note": "" }], "GlycemicIndex": { "Value": 0.0 }, "Created": { "DateTime": "2015-01-09T18:09:00", "Offset": "00:00:00" }, "Modified": { "DateTime": "2015-04-12T03:34:00", "Offset": "00:00:00" }, "LegacyKey": 1473530857, "LegacyNutrientRefNum": null, "LegacyYieldKey": null, "UserCode": "2", "UsdaCode": null, "EshaCode": null, "OwnerName": "", "AlternateNames": [], "AllergenStatements": [{ "AllergenStatementText": { "en-US": "", "es-MX": "", "fr-CA": "" }, "Authority": { "Name": { "en-US": "United States" }, "Iso3166Alpha2": "US", "Iso3166Alpha3": "USA", "Iso3166Numeric": 840, "Id": "bbf4846d-8400-43bb-944d-6021fda98225" }, "AllergenGroups": [], "IsUserGenerated": false, "Id": null }], "IngredientStatements": [{ "AlternateName": "", "AlternateText": "Peas, green, ckd f/fzn, drained, cup, Margarine, hard, hydrog corn oil, stick, Salt, table.", "Language": "en-US", "LanguageCode": 1, "Id": null }, { "AlternateName": "", "AlternateText": ".", "Language": "es-MX", "LanguageCode": 2, "Id": null }, { "AlternateName": "", "AlternateText": ".", "Language": "fr-CA", "LanguageCode": 3, "Id": null }], "Brand": { "Supplier": "", "Product": "", "Id": null }, "GroupsIds": [], "NutrientTransformIds": [], "Images": [], "Id": "dbfac0f0-4be9-57d4-27c3-41e8c688e289" }], "Status": 0 }