/** * 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 type { NutritionFacts } from './NutritionFacts.js'; import type { ServingOption } from './ServingOption.js'; /** * * @export * @interface FoodSearchItem */ export interface FoodSearchItem { /** * Opaque id — pass it back verbatim to log, predict, or fetch this food. * @type {string} * @memberof FoodSearchItem */ id: string; /** * What kind of food this is: `generic` for a database staple ("banana"), `branded` for a packaged product, `recipe` for a multi-ingredient dish. * @type {FoodSearchItemTypeEnum} * @memberof FoodSearchItem */ type: FoodSearchItemTypeEnum; /** * Null only when the database has no name for the row. * @type {string} * @memberof FoodSearchItem */ name: string | null; /** * null for generic foods and recipes, which have no brand. * @type {string} * @memberof FoodSearchItem */ brandName: string | null; /** * * @type {NutritionFacts} * @memberof FoodSearchItem */ nutrients: NutritionFacts; /** * Glycemic index; null when the database has none for this food. * @type {number} * @memberof FoodSearchItem */ glycemicIndex: number | null; /** * Glycemic load; null when the database has none for this food. * @type {number} * @memberof FoodSearchItem */ glycemicLoad: number | null; /** * URL of a picture of the food; null when the database has none. * @type {string} * @memberof FoodSearchItem */ imageUrl: string | null; /** * The product's barcode; null for foods that have none. Named for the code rather than one of its encodings — the same field carries a UPC, an EAN or a GTIN. It is the database's normalized form, so it may differ from the digits you scanned in leading zeros: display it, do not string-compare it. * @type {string} * @memberof FoodSearchItem */ barcode: string | null; /** * Search and barcode results carry the default serving only; `GET /v1.2/foods/{food_id}` returns the complete list to choose from. * @type {Array} * @memberof FoodSearchItem */ servings: Array; } /** * @export */ export declare const FoodSearchItemTypeEnum: { readonly generic: 'generic'; readonly branded: 'branded'; readonly recipe: 'recipe'; readonly unknownDefaultOpenApi: '11184809'; }; export type FoodSearchItemTypeEnum = typeof FoodSearchItemTypeEnum[keyof typeof FoodSearchItemTypeEnum]; /** * Check if a given object implements the FoodSearchItem interface. */ export declare function instanceOfFoodSearchItem(value: object): value is FoodSearchItem; export declare function FoodSearchItemFromJSON(json: any): FoodSearchItem; export declare function FoodSearchItemFromJSONTyped(json: any, ignoreDiscriminator: boolean): FoodSearchItem; export declare function FoodSearchItemToJSON(json: any): FoodSearchItem; export declare function FoodSearchItemToJSONTyped(value?: FoodSearchItem | null, ignoreDiscriminator?: boolean): any; //# sourceMappingURL=FoodSearchItem.d.ts.map