/** * January AI - Nutrition Intelligence APIs * Build food and metabolic intelligence into your product — one API for understanding what people eat and how food may affect them. **Clinical-grade precision, consumer-grade experiences.** January builds the infrastructure underneath the product: turning messy health and nutrition data into reliable intelligence, so your team spends its time on the experience instead of the foundation. **Security & compliance** — **SOC 2 Type II** · **HIPAA-aligned practices** · **BAA** and **Zero Data Retention (ZDR)** available **What you can build** - **Scan food** — photo and text food recognition: detect foods and nutrition, then correct results conversationally - **Search the food database** — by name or barcode — and get healthier alternatives for any food - **Log food, water and weight** — per-user diaries with day-range queries - **Predict glucose response** to any meal — no sensor required **Getting started** 1. Create an API key in the [Developer Dashboard](https://dashboard.january.ai) — the full key is shown once, at creation. 2. Send it as `Authorization: Bearer sk-…` — click **Authorize** here to make every example below a live request. 3. On the endpoints that read or write an end user\'s logs, say whose with the `January-End-User-ID` header — each one documents it. No other endpoint takes it: everything else either asks the shared food database a question or works on the body you send, and neither depends on who the food is for. **Calling from a mobile app** — your `sk-` key must never ship inside an app. Instead, exchange it on your backend for a *client token*: a credential that lasts up to two hours, acts as exactly one of your end users, and carries only the scopes you grant it (see the **authentication** section). Your app then calls these endpoints directly, with no proxy of your own in the request path. Both credentials travel in the same `Authorization: Bearer` header, and every endpoint below opens by saying which it accepts — **API key or client token**, or **API key only**. **Support** — [support@january.ai](mailto:support@january.ai) · [Discord community](https://discord.gg/cYQeh3UnC) · [docs.january.ai](https://docs.january.ai) * * The version of the OpenAPI document: 1.2 * Contact: support@january.ai * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import * as runtime from '../runtime.js'; import { type AutocompleteFoodCategory } from '../models/AutocompleteFoodCategory.js'; import { type AutocompleteFoodsResponse } from '../models/AutocompleteFoodsResponse.js'; import { type FoodCategory } from '../models/FoodCategory.js'; import { type FoodSearchItem } from '../models/FoodSearchItem.js'; import { type FoodSearchResults } from '../models/FoodSearchResults.js'; import { type SuggestFoodAlternativesBody } from '../models/SuggestFoodAlternativesBody.js'; import { type SuggestFoodAlternativesResponse } from '../models/SuggestFoodAlternativesResponse.js'; export interface AutocompleteFoodsRequest { query: string; type?: AutocompleteFoodCategory; limit?: number; } export interface GetFoodRequest { foodId: string; } export interface LookupFoodByBarcodeRequest { barcode: string; } export interface SearchFoodsRequest { query: string; type?: FoodCategory; limit?: number; offset?: number; } export interface SuggestFoodAlternativesRequest { foodId: string; suggestFoodAlternativesBody: SuggestFoodAlternativesBody; } /** * */ export declare class FoodsApi extends runtime.BaseAPI { /** * Creates request options for autocompleteFoods without sending the request */ autocompleteFoodsRequestOpts(requestParameters: AutocompleteFoodsRequest): Promise; /** * **API key or client token.** Lightweight food suggestions for a partial name, built for type-ahead (\"ban\" → banana, banana bread, …): generic foods first, then branded, each with its id, name, brand, a thumbnail and calories. Once the user picks one, fetch `GET /v1.2/foods/{food_id}` for servings and full nutrition. `items` is empty for fewer than 2 letters or digits, no match, or a search-index error (the suggestion service fails open so a typing user is not interrupted); an unreachable service still answers with the standard 502/504. Callable with a client token carrying the `foods:read` scope. * Autocomplete food names */ autocompleteFoodsRaw(requestParameters: AutocompleteFoodsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * **API key or client token.** Lightweight food suggestions for a partial name, built for type-ahead (\"ban\" → banana, banana bread, …): generic foods first, then branded, each with its id, name, brand, a thumbnail and calories. Once the user picks one, fetch `GET /v1.2/foods/{food_id}` for servings and full nutrition. `items` is empty for fewer than 2 letters or digits, no match, or a search-index error (the suggestion service fails open so a typing user is not interrupted); an unreachable service still answers with the standard 502/504. Callable with a client token carrying the `foods:read` scope. * Autocomplete food names */ autocompleteFoods(requestParameters: AutocompleteFoodsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Creates request options for getFood without sending the request */ getFoodRequestOpts(requestParameters: GetFoodRequest): Promise; /** * **API key or client token.** One food\'s full record — most importantly the **complete list of serving sizes**. Search, barcode, and food-analysis results carry a single default serving; fetch the food here to let an end user pick \"1 cup\" vs \"100 g\" vs \"1 medium\" when logging or predicting. Nutrition is per the default serving, in the shared nutrient vocabulary. Callable with a client token carrying the `foods:read` scope. * Get a food */ getFoodRaw(requestParameters: GetFoodRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * **API key or client token.** One food\'s full record — most importantly the **complete list of serving sizes**. Search, barcode, and food-analysis results carry a single default serving; fetch the food here to let an end user pick \"1 cup\" vs \"100 g\" vs \"1 medium\" when logging or predicting. Nutrition is per the default serving, in the shared nutrient vocabulary. Callable with a client token carrying the `foods:read` scope. * Get a food */ getFood(requestParameters: GetFoodRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Creates request options for lookupFoodByBarcode without sending the request */ lookupFoodByBarcodeRequestOpts(requestParameters: LookupFoodByBarcodeRequest): Promise; /** * **API key or client token.** Exact lookup of the food a barcode names — one food, not a list. The `barcode` on the returned food is the database\'s normalized form and may differ from the digits you scanned in leading zeros, so display it rather than comparing it. For free-text search, use `GET /v1.2/foods` instead. Callable with a client token carrying the `foods:read` scope. * Look up a food by barcode */ lookupFoodByBarcodeRaw(requestParameters: LookupFoodByBarcodeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * **API key or client token.** Exact lookup of the food a barcode names — one food, not a list. The `barcode` on the returned food is the database\'s normalized form and may differ from the digits you scanned in leading zeros, so display it rather than comparing it. For free-text search, use `GET /v1.2/foods` instead. Callable with a client token carrying the `foods:read` scope. * Look up a food by barcode */ lookupFoodByBarcode(requestParameters: LookupFoodByBarcodeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Creates request options for searchFoods without sending the request */ searchFoodsRequestOpts(requestParameters: SearchFoodsRequest): Promise; /** * **API key or client token.** Full-text search over the January food database, returning up to 50 ranked matches per call. Generic foods, branded products and recipes are searched together unless `type` narrows it to one; page deeper with `offset`. To look up a scanned barcode, use `GET /v1.2/foods/barcode/{barcode}` instead. Callable with a client token carrying the `foods:read` scope. * Search foods by name */ searchFoodsRaw(requestParameters: SearchFoodsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * **API key or client token.** Full-text search over the January food database, returning up to 50 ranked matches per call. Generic foods, branded products and recipes are searched together unless `type` narrows it to one; page deeper with `offset`. To look up a scanned barcode, use `GET /v1.2/foods/barcode/{barcode}` instead. Callable with a client token carrying the `foods:read` scope. * Search foods by name */ searchFoods(requestParameters: SearchFoodsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Creates request options for suggestFoodAlternatives without sending the request */ suggestFoodAlternativesRequestOpts(requestParameters: SuggestFoodAlternativesRequest): Promise; /** * **API key or client token.** Returns healthier alternatives for a food, honoring the given dietary restrictions and preferences. Omit either array (or send `[]`) if it does not apply. An empty `alternatives` result is valid — no suitable alternatives were found. Callable with a client token carrying the `foods:read` scope. * Suggest healthier alternatives for a food */ suggestFoodAlternativesRaw(requestParameters: SuggestFoodAlternativesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * **API key or client token.** Returns healthier alternatives for a food, honoring the given dietary restrictions and preferences. Omit either array (or send `[]`) if it does not apply. An empty `alternatives` result is valid — no suitable alternatives were found. Callable with a client token carrying the `foods:read` scope. * Suggest healthier alternatives for a food */ suggestFoodAlternatives(requestParameters: SuggestFoodAlternativesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; } //# sourceMappingURL=FoodsApi.d.ts.map