Your app integrates 10+ APIs across product lookup, recipes, images, and authentication. Here's the complete breakdown:
- Status: β Active & Working
- Endpoint:
https://world.openfoodfacts.org/api/v0/product/{barcode}.json - API Key: β Not Required (Free)
- Rate Limit: Unlimited (free, open database)
- Best For: Food products, ingredients, nutrition data
- Features:
- Product name, brand, ingredients
- Full nutrition facts
- Allergen information
- Product images
- Categories
- Location:
src/js/helpers/fetchItemInfo.js(Primary source in unified pipeline) - Proxy: β
Via unified pipeline at
server/proxy.js
- Status: β Active & Working
- Endpoint:
https://api.upcitemdb.com/prod/trial/lookup?upc={barcode} - API Key: β Not Required (Free tier)
- Rate Limit: 100 requests/day (free tier)
- Best For: General products, product images
- Features:
- Product title
- Brand information
- Product images
- Category
- Location:
server/proxy.js(Unified pipeline fallback) - Proxy: β Via unified pipeline
- Status: β Active & Working (if API key configured)
- Endpoint:
https://api.upcdatabase.org/product/{barcode} - API Key:
β οΈ Optional (Better rate limits with key) - Rate Limit: Limited without key, higher with key
- Best For: General product information
- Features:
- Product title
- Brand
- Description
- Images
- Location:
server/proxy.js(Unified pipeline final fallback) - Proxy: β
http://localhost:8787(local) or configured proxy
- Status:
β οΈ Sometimes Unavailable (DNS issues) - Endpoint:
https://www.searchupcdata.com/api/v1/product/{barcode} - API Key: β Not Required
- Rate Limit: Free tier available
- Best For: Fast lookups (sub-100ms when working)
- Features:
- Product name
- Brand/manufacturer
- Category
- Images
- Location:
src/js/helpers/fetchItemInfo.js - Note: Disabled in unified pipeline due to reliability issues
- Status: β Active & Working
- Endpoint:
https://world.openbeautyfacts.org/api/v0/product/{barcode}.json - API Key: β Not Required (Free)
- Rate Limit: Unlimited (free, open database)
- Best For: Cosmetics, beauty products
- Features:
- Product name
- Brand
- Categories
- Images
- Location:
src/js/helpers/fetchItemInfo.js
- Status:
β οΈ Sometimes Returns 404 - Endpoint:
https://gtinsearch.org/api/v1/products/{barcode} - API Key: β Not Required
- Rate Limit: Unknown
- Best For: GTIN/UPC lookups
- Features:
- Product name
- Brand
- Category
- GTIN information
- Location:
src/js/helpers/fetchItemInfo.js
- Status: β Disabled (CORS issues with demo key)
- Endpoint:
https://api.barcodelookup.com/v3/products?barcode={barcode} - API Key:
β οΈ Required (Demo key causes CORS errors) - Rate Limit: Limited with demo key
- Note: Would need real API key to work
- Location:
src/js/helpers/fetchItemInfo.js(enabled: false)
- Status: β Active & Working
- Endpoint:
https://api.spoonacular.com/recipes - API Key:
β οΈ Required (Set viaSPOONACULAR_API_KEYenv var) - Rate Limit: Free tier: 150 requests/day
- Best For: Recipe generation, nutrition info, cooking instructions
- Features:
- Recipe search by ingredients
- Full recipe details (instructions, ingredients, nutrition)
- Recipe images
- Cooking time, servings
- Missing ingredients list
- Location:
src/js/services/recipe-api.js - Proxy: β
http://localhost:8788(local) viaserver/RecipeDB.js - Caching: β 30-minute cache for searches, 1-hour for details
- Status: β Active & Working (if configured)
- Endpoint:
https://www.googleapis.com/customsearch/v1 - API Key:
β οΈ Required (Set viaGOOGLE_SEARCH_API_KEYorwindow.__GOOGLE_SEARCH_CONFIG__) - Search Engine ID:
β οΈ Required (Set viaGOOGLE_SEARCH_ENGINE_ID) - Rate Limit: Free tier: 100 requests/day
- Best For: Fast, accurate product images
- Features:
- Product packaging images
- High-quality results
- Fast response times
- Location:
src/js/services/image-search.js - Priority: Highest (tried first for speed)
- Status: β Active & Working (if configured)
- Endpoint:
https://api.unsplash.com/search/photos - API Key:
β οΈ Optional (Better with key) - Rate Limit: Free tier: 50 requests/hour
- Best For: High-quality food/product photography
- Features:
- Beautiful product images
- Multiple image sizes
- Curated content
- Location:
src/js/services/image-search.js
- Status: β Active & Working (if configured)
- Endpoint:
https://pixabay.com/api/ - API Key:
β οΈ Optional (Better with key) - Rate Limit: Free tier: 5,000 requests/hour
- Best For: General product images
- Features:
- Large image library
- Free to use
- Good coverage
- Location:
src/js/services/image-search.js - Note: Query formatting improved to prevent 400 errors
- Status: β Active & Working (if configured)
- Endpoint: Firebase Cloud
- API Key:
β οΈ Required (Set viawindow.__FIREBASE_CONFIG__) - Rate Limit: Generous free tier
- Best For: User authentication, session management
- Features:
- Email/password login
- Anonymous sign-in
- User session management
- Auto-redirect after login
- Location:
src/js/services/firebase-auth.js - Fallback: β Works without Firebase (local-only mode)
- Status: β Active & Working (if configured)
- Endpoint: Firebase Cloud
- API Key:
β οΈ Required (Set viawindow.__FIREBASE_CONFIG__) - Rate Limit: Generous free tier
- Best For: Cloud storage, data sync, offline support
- Features:
- Scan history storage
- Real-time sync across devices
- Offline support with auto-sync
- User-specific data isolation
- Location:
src/js/services/firebase-scans.js - Fallback: β Works without Firebase (localStorage)
- Status: β Always Available
- Type: Browser Native API
- API Key: β Not Required
- Best For: Detecting barcodes from camera/image
- Supported Formats:
- QR codes, UPC-A, UPC-E, EAN-13, EAN-8
- Code 128, Code 39, Code 93
- Data Matrix, PDF417, Aztec, ITF, Codabar
- Location:
src/js/helpers/BarcodeReader.js - Fallback: β
Polyfill via
barcode-detectornpm package
- Endpoint:
GET /product/:barcode(via proxy) - Location:
server/proxy.js - Strategy:
- β Firebase Cache First (30-day TTL) - Instant if cached
- β Open Food Facts (Primary source)
- β UPCitemDB (Fallback if OFF incomplete)
- β UPC Database (Final fallback)
- Benefits:
- Cache hits: < 50ms
- Cache misses: 1-3 seconds
- Normalized response format
- Automatic caching
- Multiple fallbacks for reliability
| API | Status | Key Required | Free Tier | Primary Use |
|---|---|---|---|---|
| Open Food Facts | β Active | β No | β Unlimited | Food products |
| UPCitemDB | β Active | β No | β 100/day | Product fallback |
| UPC Database | β Active | Final fallback | ||
| SearchUPCData | β No | β Yes | Fast lookups | |
| Open Beauty Facts | β Active | β No | β Unlimited | Beauty products |
| GTIN Search | β No | β Yes | GTIN lookups | |
| Barcode Lookup | β Disabled | General products | ||
| Spoonacular | β Active | β 150/day | Recipes | |
| Google Search | β Active | β 100/day | Product images | |
| Unsplash | β Active | β 50/hour | Product images | |
| Pixabay | β Active | β 5000/hour | Product images | |
| Firebase Auth | β Active | β Generous | Authentication | |
| Firebase Firestore | β Active | β Generous | Data storage | |
| Barcode Detection | β Active | β No | β Always | Barcode scanning |
-
Spoonacular API Key - For recipes
- Get from: https://spoonacular.com/food-api
- Set:
SPOONACULAR_API_KEYenv var
-
Firebase Config - For auth & storage (optional)
- Get from: Firebase Console
- Set:
window.__FIREBASE_CONFIG__inindex.html
-
Google Custom Search API Key + Engine ID - For fast images
- Get from: https://developers.google.com/custom-search
- Set:
window.__GOOGLE_SEARCH_CONFIG__inindex.html
-
Unsplash Access Key - For high-quality images
- Get from: https://unsplash.com/developers
- Set:
UNSPLASH_ACCESS_KEYenv var
-
Pixabay API Key - For more image results
- Get from: https://pixabay.com/api/docs/
- Set:
PIXABAY_API_KEYenv var
-
UPC Database API Key - For better rate limits
- Get from: https://upcdatabase.org
- Set:
UPC_API_KEYenv var
1. Scan Barcode
β
2. Check Firebase Cache (if configured)
β (if not cached)
3. Try Unified Pipeline:
- Open Food Facts (primary)
- UPCitemDB (fallback)
- UPC Database (final fallback)
β
4. Save to Firebase Cache
β
5. Display Product Info
β
6. Search for Product Image:
- Google Custom Search (if configured)
- Unsplash (if configured)
- Pixabay (if configured)
- Placeholder (fallback)
1. Select Ingredients
β
2. Check Recipe Cache (30 min TTL)
β (if not cached)
3. Try Recipe Proxy (localhost:8788)
β (if proxy fails)
4. Try Spoonacular API Direct
β
5. Cache Results
β
6. Display Recipes
- Unified Pipeline: New cache-first architecture improves speed and reliability
- Fallback Strategy: Multiple APIs ensure high success rate
- Caching: Reduces API calls and improves performance
- Proxy Support: Avoids CORS issues and keeps API keys secure
- Graceful Degradation: App works even if some APIs fail
- Configure Google Search API - Fastest image results
- Set up Firebase - Better data persistence and sync
- Get Spoonacular Key - Essential for recipe features
- Optional: Unsplash/Pixabay keys for more image options