From shopping assistants to deal bots — real patterns, working code.
Give your AI assistant real product data to back up every recommendation. When a user asks "find me a wireless keyboard under $80," your agent queries BuyWhere, receives structured SKUs with prices, specs, and purchase URLs, and returns a ranked shortlist — not a hallucinated product list. No scraping, no stale data.
import requests
API_KEY = "bw_live_your_key_here"
resp = requests.get(
"https://api.buywhere.ai/v1/search",
headers={"Authorization": f"Bearer {API_KEY}"},
params={"q": "wireless keyboard under $80", "limit": 5},
)
products = resp.json()["items"]
for p in products:
print(p["name"], p["price"], p["currency"])
print("Buy:", p["url"])Build an agent that compares prices across Singapore's retail landscape without maintaining integrations with ten different retailer APIs. BuyWhere normalises product data across merchants into a consistent schema — same fields, same units, same structure — so your agent can sort, filter, and present comparisons without parsing mismatched responses.
import requests
API_KEY = "bw_live_your_key_here"
resp = requests.get(
"https://api.buywhere.ai/v1/search",
headers={"Authorization": f"Bearer {API_KEY}"},
params={"q": "MacBook Pro M3", "limit": 20},
)
items = resp.json()["items"]
# Sort by price across all merchants
sorted_items = sorted(items, key=lambda x: x["price"])
for item in sorted_items:
print(f"{item['source']:15} {item['currency']} {item['price']:>8.2f} {item['name'][:40]}")Context-aware gift finders need catalog depth and attribute richness, not just a list of popular items. Query BuyWhere with intent-style parameters — category, budget, recipient persona — and receive products with enough metadata for your agent to reason about fit. Purchase URLs are included so every recommendation links to a real product.
import requests
API_KEY = "bw_live_your_key_here"
# LLM resolves "gifts for tech-savvy teenager under $50"
# → structured query to BuyWhere
resp = requests.get(
"https://api.buywhere.ai/v1/search",
headers={"Authorization": f"Bearer {API_KEY}"},
params={
"q": "tech gadgets gifts under $50",
"limit": 10,
},
)
gifts = resp.json()["items"]
# Return gifts with purchase URLs
recommendations = [
{"name": g["name"], "price": g["price"], "buy": g["url"]}
for g in gifts
if g["price"] <= 50 and g["is_available"]
]Let users ask "is this in stock?" and get a real answer. BuyWhere indexes availability signals alongside price and product metadata, so your agent can surface in-stock alternatives when a product is unavailable or flag restocks as they happen. No manual polling of individual merchant pages required.
import requests
API_KEY = "bw_live_your_key_here"
def find_available(product_name: str) -> list:
resp = requests.get(
"https://api.buywhere.ai/v1/search",
headers={"Authorization": f"Bearer {API_KEY}"},
params={"q": product_name, "limit": 20},
)
items = resp.json()["items"]
in_stock = [i for i in items if i["is_available"]]
out_of_stock = [i for i in items if not i["is_available"]]
if in_stock:
return in_stock
# Surface alternatives when primary is unavailable
return [{"message": "Out of stock. Showing similar items."}, *out_of_stock[:3]]Build price-drop and deal notification agents without managing your own price history infrastructure. Poll BuyWhere for a product set on a schedule, compare against a stored baseline, and trigger alerts when prices move. BuyWhere handles the catalog layer; you own the notification logic.
import requests, json, pathlib
API_KEY = "bw_live_your_key_here"
BASELINE_FILE = pathlib.Path("price_baseline.json")
def check_price_drops(queries: list[str]) -> list[dict]:
baseline = json.loads(BASELINE_FILE.read_text()) if BASELINE_FILE.exists() else {}
alerts = []
for q in queries:
resp = requests.get(
"https://api.buywhere.ai/v1/search",
headers={"Authorization": f"Bearer {API_KEY}"},
params={"q": q, "limit": 1},
)
item = resp.json()["items"][0]
prev_price = baseline.get(item["id"], item["price"])
if item["price"] < prev_price:
alerts.append({
"name": item["name"],
"was": prev_price,
"now": item["price"],
"buy": item["url"],
})
baseline[item["id"]] = item["price"]
BASELINE_FILE.write_text(json.dumps(baseline))
return alertsGet an API key and make your first query in under 5 minutes.