Food Logging
Add food logging to your health app in an afternoon
Search, scan, log. Simple API, complete data, zero friction. Your users find what they ate on the first try.
Food diary apps live or die by search quality
If users can't find what they ate quickly, they stop logging. Every failed search is a churned user.
- Failed food searches frustrate users and kill retention
- Slow API responses make logging feel sluggish
- No barcode scanning means manual entry for packaged foods
- Enterprise API pricing kills early-stage apps
- Complex auth flows slow down development
How ChowAPI solves this
Typo-tolerant search
Users log quickly with imperfect spelling. 12ms average response time.
1.6M+ foods
Branded products, restaurant items, generic foods. Users find what they ate.
Barcode scanning
Scan packaged foods for instant logging. 400K+ barcodes.
Simple auth
One API key in the header. No OAuth, no IP whitelists, no session tokens.
Build a food search component
A debounced search that finds foods as the user types.
FoodSearch.tsx
import { ChowAPI } from 'chowapi'
import { useState, useEffect } from 'react'
const chow = new ChowAPI('chow_live_YOUR_KEY')
function FoodSearch({ onSelect }: { onSelect: (food: any) => void }) {
const [query, setQuery] = useState('')
const [results, setResults] = useState([])
useEffect(() => {
if (query.length < 2) return
const timer = setTimeout(async () => {
const { results } = await chow.search(query, { limit: 8 })
setResults(results)
}, 300) // 300ms debounce
return () => clearTimeout(timer)
}, [query])
return (
<div>
<input value={query} onChange={e => setQuery(e.target.value)}
placeholder="What did you eat?" />
{results.map(food => (
<button key={food.id} onClick={() => onSelect(food)}>
{food.name} {food.brand && `(${food.brand})`}
- {food.nutrients.calories} cal
</button>
))}
</div>
)
}Relevant endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /v1/search?q={query} | Fuzzy food search for logging |
| GET | /v1/barcode/{code} | Scan and log packaged foods |
| GET | /v1/account/usage | Track API usage for your app |