@foodashi/api-client
v0.1.1
Published
Official TypeScript and JavaScript client for the Foodashi recipe and nutrition API.
Maintainers
Readme
@foodashi/api-client
Official TypeScript and JavaScript client for the Foodashi recipe and nutrition API. Fully typed, generated directly from the live OpenAPI spec.
Foodashi gives you thousands of recipes across 78 world cuisines, each with a food photo, per-serving and per-100g nutrition computed from 11 official government food composition databases (any AI-estimated value is flagged at lower confidence), EU 1169/2011 allergen declarations, dietary tags, taste profiles, beverage pairings, and a NutriMetric health score. Over 70 endpoints.
Install
npm install @foodashi/api-clientQuick start
import { client, getRecipes } from '@foodashi/api-client';
// Configure once
client.setConfig({
baseUrl: 'https://api.foodashi.com',
headers: { 'X-Api-Key': process.env.FOODASHI_API_KEY },
});
// Every endpoint is a typed function
const { data, error } = await getRecipes({ query: { limit: 10 } });
if (data) console.log(data);Get a free API key at foodashi.com/console. The Hobby tier includes 10,000 calls a month, no card required.
What you get
Typed functions for all 70+ endpoints, with full request and response types, so your editor autocompletes every field. A few examples:
- Recipe discovery:
getRecipes,filterRecipes,getRecipeById,getSimilarRecipes, and browse-by-cuisine, diet, time, difficulty, season, occasion, and more - Per-recipe data:
getRecipeNutrition,getRecipeAllergens,getRecipeTaste,getRecipeSustainability,scaleRecipeServings - Ingredients:
searchIngredients,getIngredientDetails,getIngredientSubstitutes,convertIngredientUnit - Pro AI endpoints:
generateMealPlan,recognizeDish,recognizeIngredients,analyzeRecipeUrl,getBeveragePairing,semanticRecipeSearch
Regenerate from the latest spec
npm run generate # pulls https://foodashi.com/openapi.json
npm run buildLinks
- Documentation: https://foodashi.com/api-recipe-documentation/
- Interactive Test Kitchen: https://foodashi.com/test-kitchen/
- OpenAPI spec: https://foodashi.com/openapi.json
License
MIT
