BuyWhere Day 3 — Advanced Features + SDKs

You’ve got the basics down. Let’s level up with richer search patterns and official SDKs.

Advanced Product Queries

Best Price (cheapest listing across all sources)

curl -sS "https://api.buywhere.ai/v1/products/best-price" \
  -H "Authorization: Bearer bw_xxxxx" \
  --data-urlencode "q=nintendo switch oled"

Compare (cross-platform price matrix)

curl -sS "https://api.buywhere.ai/v1/products/compare" \
  -H "Authorization: Bearer bw_xxxxx" \
  --data-urlencode "q=iphone 15"

Categories

curl -sS "https://api.buywhere.ai/v1/categories" \
  -H "Authorization: Bearer bw_xxxxx"

Deals (current discounts)

curl -sS "https://api.buywhere.ai/v1/deals" \
  -H "Authorization: Bearer bw_xxxxx" \
  --data-urlencode "limit=20"

Python SDK

pip install buywhere
from buywhere_sdk import BuyWhere

client = BuyWhere(api_key="bw_xxxxx")

# Sync
results = client.search("laptop", limit=10)
print(f"Found {results.total} products")

# Async
from buywhere_sdk import AsyncBuyWhere

async with AsyncBuyWhere(api_key="bw_xxxxx") as client:
    results = await client.search("laptop")

JavaScript/TypeScript SDK

npm install @buywhere/sdk
import BuyWhere from '@buywhere/sdk';

const client = new BuyWhere({ apiKey: 'bw_xxxxx' });
const results = await client.search({ query: 'laptop', limit: 10 });

LangChain Integration

from buywhere_sdk.langchain import BuyWhereToolkit

toolkit = BuyWhereToolkit(api_key="bw_xxxxx")
tools = toolkit.get_tools()  # Returns search, best_price, compare tools

CrewAI Integration

from crewai.tools import tool

@tool("buywhere_best_price")
def buywhere_best_price(product_name: str) -> str:
    """Find the cheapest BuyWhere listing for a product query."""
    client = BuyWhere(api_key="bw_xxxxx")
    product = client.best_price(product_name)
    link = product.affiliate_url or product.buy_url
    return f"{product.name} | {product.currency} {product.price} | {product.source} | {link}"

Bulk Export

For large data pulls:

curl -sS "https://api.buywhere.ai/v1/products/export" \
  -H "Authorization: Bearer bw_xxxxx" \
  --data-urlencode "q=electronics" \
  --data-urlencode "limit=1000"

Day 7 Preview

Next email covers agent-building patterns: tool wrappers, multi-step commerce workflows, and how to ask for higher beta limits if you’re driving real query volume.

Questions? Reply to this email.