# Routes & Descriptions

## Get Product By Product Code

### Summary

Given a product code, such as `698241110109` from UPC/Barcode scanning, get the detailed information and nutrients of the corresponding food product.

{% openapi src="https://api.passiolife.com/v2/products/napi/docs/openapi.json" path="/v2/products/napi/food/productCode/{productCode}" method="get" %}
[https://api.passiolife.com/v2/products/napi/docs/openapi.json](https://api.passiolife.com/v2/products/napi/docs/openapi.json)
{% endopenapi %}

##

## Get Product By Food ID

### Summary

Given a food items ID, such as `698241110109` get the detailed information and nutrients of the corresponding food product.

{% openapi src="https://api.passiolife.com/v2/products/napi/docs/openapi.json" path="/v2/products/napi/food/{externalFoodId}" method="get" %}
[https://api.passiolife.com/v2/products/napi/docs/openapi.json](https://api.passiolife.com/v2/products/napi/docs/openapi.json)
{% endopenapi %}

##

## Get Product By Reference Code

## Summary

All items returned from our API come with a Reference Code. This can be used to retreive the same item later, and to store custom data if necessary.

{% openapi src="https://api.passiolife.com/v2/products/napi/docs/openapi.json" path="/v2/products/napi/food/search/result/refCode/:refCode" method="get" %}
[https://api.passiolife.com/v2/products/napi/docs/openapi.json](https://api.passiolife.com/v2/products/napi/docs/openapi.json)
{% endopenapi %}

##

## Search Foods

### Summary

This route allows text search against our entire database of foods, products, and recipes.

Simply **URL Encode** your search term to take care of special characters, and send the request!\
The default limit (max results returned) is 50. This is the recommended setting, but can be adjusted as needed.

{% openapi src="https://api.passiolife.com/v2/products/napi/docs/openapi.json" path="/v2/products/napi/food/search/advanced" method="get" %}
[https://api.passiolife.com/v2/products/napi/docs/openapi.json](https://api.passiolife.com/v2/products/napi/docs/openapi.json)
{% endopenapi %}



## (Deprecated) Get Search Result Details \[use [Reference Codes](#get-product-by-reference-code)]

### Summary

**This route remains to support backward compatibility.** [**Reference Codes**](reference-codes) **should be used instead for all new implementations.**&#x20;

* `labelId` If the selected result has a labelId, pass it as this parameter.\
  If the labelId is empty, pass an all 0's uuid:\
  `00000000-0000-0000-0000-000000000000`\

* `type` All search results will have a `type` field which will be one of synonym, recipe, or reference. Pass this value to the type parameter\

* `resultId` all search results will have a `resultId`. Pass this value to the resultId parameter

{% openapi src="https://api.passiolife.com/v2/products/napi/docs/openapi.json" path="/v2/products/napi/food/search/result/:labelId/:type/:resultId" method="get" %}
[https://api.passiolife.com/v2/products/napi/docs/openapi.json](https://api.passiolife.com/v2/products/napi/docs/openapi.json)
{% endopenapi %}
