- From
- Shops and sites selling in BHD
- Arrives
- Today or tomorrow
- Found by
- Claude web search, then each store page is opened and its price read from the page's own data
total = shelf price (VAT included)
+ delivery (BD 1.000 if not stated)
A shelf price is only part of the bill. fair cost takes one search, checks shops in Bahrain, stores that ship here and parcel forwarders, then adds shipping, customs and VAT so every option shows the price at your door.
Try the price engine. Pick a product and a route.
Prices from the app's demo catalog. Rates are the app's config values.
Each search runs all three at once and streams them in as they finish, so shops in Bahrain usually appear first. Every total comes from one file, lib/pricing.ts, in whole fils. The AI never adds anything up.
total = shelf price (VAT included)
+ delivery (BD 1.000 if not stated)
total = item + shipping
+ customs 5% of item + shipping, above BD 300
+ VAT 10% of all of that
total = item + shipping to warehouse
+ first half kilo + each extra half kilo
+ customs + VAT
With no API keys, fair cost runs in demo mode: an in-memory database with seeded history, a built-in catalog and a rule-based summary. These screens were captured from that mode. The live site uses the same screens with real searches.
One request to /api/search, answered as a stream of events, tier by tier. Times are typical of live runs measured during an audit of the app.
Sign-in is checked, then a sliding window allows 8 searches a minute per user.
Free accounts get 5 searches a day, premium 30, unlimited stops at a safety cap of 500. The day resets at midnight Bahrain time.
A keyword blocklist runs first. Then Claude Haiku cleans up the query, or answers that it is ambiguous, not a product, or prohibited. A stopped query costs no search.
The same normalized query within a few hours is answered from the cache.
Claude describes the exact product, its editions and variants, so each result can be labelled the right model or a different one.
Offers are matched (accessories, used items, other variants and price outliers dropped), priced, scored and sent as each tier finishes.
The cheapest exact match from a trusted seller is headlined, then a short AI summary arrives, checked number by number.
The search and its answer are saved as a chat you can reopen later.
Every query is classified before any paid price search. The AI can block a query but can never unblock one the blocklist caught.
| You type | What happens |
|---|---|
| iphone 16 | Product searched as a cleaned-up name |
| ps5 | Ambiguous asks which one you mean first |
| red roses | Product perishable, so Bahrain shops only |
| vape | Restricted searched, with a warning |
| replica rolex | Prohibited stopped by the blocklist, no AI call |
A Bahrain price found on the web is shown as verified when the store's page says the same thing, unconfirmed (and labelled) when the page can't be read, and dropped when it is in another currency or sold out. fair cost does not get around stores' bot protection.
Claude gets only finished, engine-priced offers. Before its summary is shown, validate.ts pulls every number out of the text and checks it against the numbers the engine produced. One stray number and the whole answer is replaced by a rule-based summary.
Totals, delivery days, trust scores, offer counts and anything already in the product name. Digits stuck to letters, like a model number, are names and are ignored.
The same check confirms that every offer the AI picks exists and sits in the tier it claims.
Seller trust is a Bayesian average: every rating is pulled toward 3.8 stars as if it had 40 extra reviews. Few reviews barely move it; thousands do. The best deal is the cheapest exact match from a seller scoring at least 55.
trust = ((3.8 × 40 + rating × reviews) ÷ (40 + reviews) − 1) ÷ 4 × 100
best value = 60% price + 20% speed + 20% trust, each against the best offer in the search
A Bahraini dinar has 1,000 fils. Every amount is an integer of fils, converted once from USD, AED, SAR, EUR or GBP, and formatted only at the edge as BD 289.500.
Routes talk to one repository interface. With Supabase keys it is Postgres with row level security on all 13 tables; without them it is an in-memory store, so the whole app runs with no accounts at all.
Claude, SerpApi and the Supabase service key are read only in server code. Users can't change their own role or plan, and limits are enforced in the API route, not the page.
Searches today and this month, projected monthly use against each provider's quota with a warning at 80%, cache hit rate, cost per search, top products and user management.
A full right-to-left layout, Arabic terms and privacy pages, localized errors and summaries, plus light and dark themes.
144 unit tests cover pricing, scoring, limits, matching and AI guardrails. 121 more run against the live services on demand, including a 66-query evaluation set across gadgets, furniture, food and flowers.