[
    {
        "role": "user",
        "content": "I%20use%20Leasey%2C%20which%20is%20a%20set%20of%20scripts%20for%20the%20JAWS%20screen%20reader.%20They%20have%20a%20number%20of%20searches%20that%20are%20predefined%20and%20make%20it%20easy%20to%20access%20lots%20of%20information.%20I%20realized%20that%20one%20thing%20they%20didn%27t%20have%20were%20tools%20to%20look%20up%20calories%20and%20carbs%20and%20such.%20I%20assume%20they%27ll%20need%20sites%20that%20use%20an%20API%20to%20provide%20information%2C%20and%20preferably%20things%20that%20don%27t%20costt%20a%20fortune.%20I%20was%20thinking%20of%20Calorie%20King%2C%20but%20their%20site%20seemed%20bogged%20down%20and%20sluggish%20today.%20What%20tools%20are%20out%20there%20that%20we%20could%20use%3F"
    },
    {
        "role": "assistant",
        "content": "If you\u2019re building \u201clookups\u201d in Leasey for nutrition info (calories, carbs, etc.), there are several APIs and data sources that are a good fit\u2014some are free, some have costs, and most support JSON responses with endpoints you can script against. Below is a curated list of what I found, with pros/cons and key details to help you choose what works best for Leasey.\n\n---\n\n## \u2705 Top Free / Low-Cost Nutrition API Options\n\n| API / Data Source | What kinds of foods are covered | Free Tier / Cost | What data you get (calories, macros, etc.) | Considerations for use with Leasey |\n|---|---|---|---|---|\n| **USDA FoodData Central** | Generic foods, foundation foods, branded products via Branded Foods DB ([en.wikipedia.org](https://en.wikipedia.org/wiki/USDA_National_Nutrient_Database?utm_source=openai)) | Free; requires API key. Rate-limited to ~1,000 requests/hour per IP by default. ([fdc.nal.usda.gov](https://fdc.nal.usda.gov/api-guide?utm_source=openai)) | Calories, protein, carbs, fat, plus many micronutrients for most foods. Search and fetch by FDC ID. ([fdc.nal.usda.gov](https://fdc.nal.usda.gov/api-guide?utm_source=openai)) | Very reliable, official data. Good fallback when branded data is missing. Best when working with generic items (\u201cbanana\u201d, \u201cbrown rice\u201d, etc.). |\n| **Open Food Facts** | Packaged/branded products globally (esp. with UPC/barcode), ingredients, nutrition labels, metadata ([openpublicapis.com](https://openpublicapis.com/api/open-food-facts?utm_source=openai)) | Free; read-access doesn\u2019t need auth. Must follow rate limits (e.g. product endpoint, search, etc.) ([openfoodfacts.github.io](https://openfoodfacts.github.io/documentation/docs/Product-Opener/api/?utm_source=openai)) | Nutrition values from labels\u2014macros like carbs, calories, fat, protein; ingredients; sometimes micronutrients; images. ([openpublicapis.com](https://openpublicapis.com/api/open-food-facts?utm_source=openai)) | Excellent for packaging lookups. Because it\u2019s crowdsourced, some entries vary in completeness. Needs parsing for barcodes or product name searches. |\n| **OpenNutrition** | Combines multiple open sources (USDA, Open Food Facts, etc.), includes generic & branded & restaurant foods; fairly large database ([reddit.com](https://www.reddit.com/r/opensource/comments/1jui248/opennutrition_a_free_odbllicensed_nutrition/?utm_source=openai)) | Appears free / open data; licensing is ODbL ([reddit.com](https://www.reddit.com/r/opensource/comments/1jui248/opennutrition_a_free_odbllicensed_nutrition/?utm_source=openai)) | Broad coverage: calories/macros; branded items and some restaurant chains. | If there\u2019s an API end-point, this is promising. Might cover some of the gaps in Open Food Facts. Find out whether the API is stable and what latency is like. |\n| **YMove Nutrition API** | ~3M products from 180+ countries; mixes USDA + Open Food Facts data ([ymove.app](https://ymove.app/nutrition-api?utm_source=openai)) | Free trial; then paid tiers start (~US$19/month) for more requests & features ([ymove.app](https://ymove.app/nutrition-api?utm_source=openai)) | Calories, macros, serving size, barcode lookup, full nutrition profile; can also generate meal plans, etc. ([ymove.app](https://ymove.app/nutrition-api?utm_source=openai)) | If you can afford a modest monthly fee, this may give the cleanest integration, especially if you want barcode searches + branded products. |\n\n---\n\n## \u2699\ufe0f Extra Options (More Specific / Mixed Cases)\n\n- **DietaryMatrix API** \u2014 more advanced, with many nutrients and countries; free tier with limited requests per day but costs go up fast. ([dietarymatrix.com](https://www.dietarymatrix.com/?utm_source=openai))  \n- **Chomp Food API** \u2014 large branded foods list (1.2M+ items), but free plan is restrictive; paid plans give more flexibility. ([chompthis.com](https://chompthis.com/api/?utm_source=openai))  \n- **FooDB** \u2014 mostly unprocessed/generic foods; extensive chemical/micronutrient info, but less useful for branded or packaged goods unless generic equivalents suffice. ([en.wikipedia.org](https://en.wikipedia.org/wiki/FooDB?utm_source=openai))  \n\n---\n\n## \ud83d\udd27 Which One Makes Sense for Leasey?\n\nHere are some recommendations based on typical Leasey usage:\n\n- For generic lookups (e.g. \u201cspinach\u201d, \u201cchicken breast\u201d, \u201csweet potato\u201d), **USDA FoodData Central** is very reliable, free, and fairly straightforward to script for.  \n- For barcode or branded products, **Open Food Facts** is almost essential\u2014it has a massive product database and easy read-only access without auth.  \n- If you want both generic + branded + a better interface (and don\u2019t mind a modest cost), **YMove** could be worth subscribing to.  \n- For breadth (restaurant chain items, etc.), **OpenNutrition** may fill in the gaps, especially where USDA and OFF don\u2019t have entries.\n\n---\n\n## \u26a0\ufe0f Things to Watch Out For\n\n- **Rate limits**: APIs like USDA limit requests per hour or per IP; Open Food Facts has limits for certain query types. You\u2019ll need to manage that in scripting (e.g. caching, batching). ([openfoodfacts.github.io](https://openfoodfacts.github.io/documentation/docs/Product-Opener/api/?utm_source=openai))  \n- **Data completeness & consistency**: Crowdsourced data (Open Food Facts, etc.) can be patchy. Sometimes fields like fiber, sugar, or specific micronutrients are missing.  \n- **Naming differences**: \u201cChicken breast, skinless, cooked\u201d might appear in multiple ways; generic vs branded names vary. You\u2019ll want to allow fuzzy matching, synonyms, or checklist prompts in the script.  \n- **Licensing**: Open source/ public domain (like USDA data) tend to have few restrictions; Open Food Facts is under ODbL (Open Database License) and Database Contents License \u2014 permissible, but you should follow attribution or license terms. ([openfoodfacts.github.io](https://openfoodfacts.github.io/documentation/docs/Product-Opener/api/?utm_source=openai))\n\n---\n\nIf you like, I can put together a small cheat-sheet with endpoints (URL patterns) and sample JSON responses for a few of these APIs that are easiest to prototype with (so you can drop them into Leasey). Do you want me to build that?"
    }
]