Five ways to cut API spend
- Cache on demand instead of pre-syncing the whole catalogue: Fetch and cache a fragrance only when a visitor opens or filters into it, rather than running a cron job across thousands of unviewed records.
- Use
GET /v2/fragrances?view=basicfor multi-note browse grids: Filter directly by up to5notes and5accords (for exampleGET /v2/fragrances?note=bergamot,vanilla&accord=woody&view=basic) instead of pulling full detailed profiles just to filter client-side. A basic card costs$0.005(50%less thanview=detailedat$0.010) and already includesname,brand,concentration,launchYear,familyPrimary,communityScore,ratingCount, andimageUrl. Loadview=detailedonly when a user opens a product detail page. - Store permanent Noteboxd
idandslugmappings in your app database: You can keep bare identifiers forever under the Standard Licence and hydrate full records on demand. - Use
POST /v2/fragrances/enrichfor detail pages: Oneenrichcall ($0.050+$0.003/review) replaces separateget,wearing-stats,similar, andreviewsrequests ($0.084–$0.090). - Revalidate
GETendpoints withIf-None-Match: Unchanged records cost 50% off list price (up to65%off on Growth prepaid spend) both on same-day304 Not Modifiedresponses and on cross-day200 OKrefreshes (X-Noteboxd-Revalidated: image-links-refreshed) where only signed image links rotated.
Budget scenarios for discovery sites
Under $20/month on Pay as you go
- Plan: Pay as you go (
$0/mobase,3-daystatic cache window,2,500distinct fragrances / 30 days). - Pattern: Fetch
GET /v2/fragrances/{id}?view=detailed($0.010initial) lazily when a visitor views a fragrance or uses a note-matching filter, storeETagalongside the response for up to3 days, revalidate active items withIf-None-Match($0.005when unchanged), and renderimageUrldirectly in<img>tags. - Math:
$20funds2,000initial detailed lookups ($0.010),4,000unchangedIf-None-Matchrefreshes ($0.005), or up to4,000basic cards ($0.005). Because repeated reads of the same IDs do not consume extra distinct quota, a site displaying several hundred core fragrances stays well inside the2,500distinct-fragrance limit.
Keeping warm catalogues on Starter ($49/month) vs. Growth ($249/month)
- Starter (
$49/mo,$60/moincluded usage,7-daycache window,10,000distinct fragrances / 30 days):- Refreshing
1,000detailed profiles weekly (~4.3cycles/month) viaGET+If-None-Matchcosts~$21.43/monthwhen records are unchanged (~$23.57/monthassuming ~10% monthly catalogue edits, vs.~$42.86/monthonPOST /batch). That leaves~$36–$38/monthinside Starter’s$60included allowance for search, similarity, and community widgets. - Starter’s
$60/monthallowance fits up to ~2,800 unchanged warm detailed profiles (or ~1,400 at full list rate).
- Refreshing
- Growth (
$249/mo,$350/moincluded usage,14-daycache window,30,000distinct fragrances / 30 days):- Halving the refresh frequency to every
14 days(~2.14cycles/month) lets10,000warm detailed profiles cost~$107.14/monthviaGET+If-None-Matchwhen unchanged (~$117.86/month@ 10% edits), fitting comfortably inside Growth’s$350included allowance with over$230/monthleft for discovery calls.
- Halving the refresh frequency to every
Reference cache helper (TypeScript)
Respect theCache-Control: private, max-age=... header returned by the API so your cache TTL matches your plan and endpoint class automatically:
res.status === 200 with X-Noteboxd-Revalidated: image-links-refreshed is expected when the record data is unchanged and signed bottle URLs rotated — storing payload.data and res.headers.get("etag") as shown above updates your signed image links while still billing at the 50% unchanged-record discount.
Render bottle photos directly in the browser
Do not fetchimg.noteboxd.com URLs from backend cron jobs or image-resizing proxies. In React or Next.js, pass imageUrl straight to the browser:
next/image, pass unoptimized so Next.js does not proxy img.noteboxd.com through /_next/image on your server (which can trigger HTTP 403 edge restrictions).