> For the complete documentation index, see [llms.txt](https://docs.january.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.january.ai/rest-api/foods.md).

# Foods

Search the January food database, power type-ahead results, look up barcodes, fetch a food's full details and servings, and suggest healthier alternatives.

Each operation's description states what it costs — see [Credits and pricing](/rest-api/credits-and-pricing.md).

{% openapi src="<https://partners.january.ai/v1.2/openapi.json>" path="/v1.2/foods" method="get" %}
<https://partners.january.ai/v1.2/openapi.json>
{% endopenapi %}

{% openapi src="<https://partners.january.ai/v1.2/openapi.json>" path="/v1.2/foods/autocomplete" method="get" %}
<https://partners.january.ai/v1.2/openapi.json>
{% endopenapi %}

{% hint style="warning" %}
**Barcode coverage is US-only.** The database holds products sold in the United States, keyed by their UPC-A and EAN codes. Barcodes issued elsewhere — for example the GS1 prefixes 73 (Sweden), 64 (Finland), 54 (Belgium and Luxembourg), and 93 (Australia) — are not covered and return `404 not_found`. Treat that 404 as "not covered" rather than retrying: fall back to text search (`GET /v1.2/foods`) or your own product data for those markets.
{% endhint %}

{% openapi src="<https://partners.january.ai/v1.2/openapi.json>" path="/v1.2/foods/barcode/{barcode}" method="get" %}
<https://partners.january.ai/v1.2/openapi.json>
{% endopenapi %}

{% openapi src="<https://partners.january.ai/v1.2/openapi.json>" path="/v1.2/foods/{food\_id}" method="get" %}
<https://partners.january.ai/v1.2/openapi.json>
{% endopenapi %}

{% openapi src="<https://partners.january.ai/v1.2/openapi.json>" path="/v1.2/foods/{food\_id}/alternatives" method="post" %}
<https://partners.january.ai/v1.2/openapi.json>
{% endopenapi %}
