BuyWhere: The Product API Built for AI Agents

Southeast Asia's commerce landscape is fragmented across Shopee, Lazada, Carousell, Amazon, Fairprice, and dozens of other platforms. For AI agents, this fragmentation is a real problem: there's no unified way to search, compare, or buy products across these platforms in a single step. BuyWhere fixes that.


The Problem: AI Agents Can't Shop

When an AI agent needs to help a user purchase a product, it faces a fundamentally different challenge than a human. A human opens a browser, navigates to Shopee, searches for "Sony WH-1000XM5 headphones," scans the results, picks the cheapest, and clicks buy. An AI agent needs the same capability — but as an API.

The existing approach is grim:

  • Scrape each platform individually — brittle, slow, often against ToS, and the HTML structure changes every time a platform redesigns
  • Use each platform's own API — different schemas, different auth models, different rate limits, different error codes
  • Give up and guess — which is what most agents do today

The core issue is that product data on e-commerce platforms is not structured for programmatic access. It's structured for human websites. The data is embedded in JavaScript, behind login walls, or behind pagination that requires rendering.

This is the gap BuyWhere fills.


What Is BuyWhere?

BuyWhere is a unified product catalog API that indexes products across multiple e-commerce platforms in Singapore and Southeast Asia. With a single API call, you can:

  • Search products across 500K+ listings from Shopee, Lazada, Carousell, Amazon, Fairprice, Giant, Challenger, IKEA, Courts, Decathlon, and more
  • Compare prices for the same product across platforms automatically
  • Find the best price in milliseconds — no need to scrape anything
  • Track price history to determine if a deal is genuine or a fake discount
  • Browse by category to build product discovery flows
  • Ingest your own scraped data via a batch API if you need to extend beyond our coverage

The API is REST. The auth is a Bearer token or API key header. The response shapes are predictable JSON. It's designed to be called from Python, JavaScript, or any HTTP client your AI framework supports.

There are no redirects to parse, no HTML to scrape, no session cookies to maintain. Just clean JSON.


Your First Query

Here's the simplest possible search:

curl "https://api.buywhere.ai/v1/products?q=sony+headphones&limit=3" \
  -H "X-API-Key: $BUYWHERE_API_KEY"
{
  "total": 248,
  "limit": 3,
  "offset": 0,
  "items": [
    {
      "id": 78234,
      "sku": "SHOPEE-SG-HEP-001",
      "source": "shopee_sg",
      "name": "Sony WH-1000XM5 Wireless Headphones",
      "price": "449.00",
      "currency": "SGD",
      "buy_url": "https://shopee.sg/product/12345",
      "affiliate_url": "https://api.buywhere.ai/v1/track/abc123",
      "category": "Electronics",
      "brand": "Sony",
      "is_available": true,
      "updated_at": "2026-04-04T14:30:00Z"
    }
  ],
  "has_more": true
}

Python:

import requests

resp = requests.get(
    "https://api.buywhere.ai/v1/products",
    headers={"X-API-Key": "your_key_here"},
    params={"q": "sony headphones", "limit": 3},
    timeout=30,
)
data = resp.json()
for item in data["items"]:
    print(f"{item['name']} — {item['currency']} {item['price']} @ {item['source']}")

JavaScript:

const resp = await fetch(
  'https://api.buywhere.ai/v1/products?q=sony+headphones&limit=3',
  { headers: { 'X-API-Key': process.env.BUYWHERE_API_KEY } }
);
const { items } = await resp.json();
items.forEach(item => {
  console.log(`${item.name} — ${item.currency} ${item.price} @ ${item.source}`);
});

All responses include the buy_url for the original platform listing and an affiliate_url that lets BuyWhere track clicks for analytics. You can use either — the affiliate_url just adds attribution.


Finding the Best Price Automatically

The most useful operation for a shopping agent is finding the cheapest listing for a product. The /best-price endpoint does exactly that:

curl "https://api.buywhere.ai/v1/products/best-price?q=iphone+15+case" \
  -H "X-API-Key: $BUYWHERE_API_KEY"
{
  "id": 67890,
  "source": "lazada_sg",
  "name": "iPhone 15 Silicone Case",
  "price": 12.99,
  "currency": "SGD",
  "buy_url": "https://www.lazada.sg/products/...",
  "affiliate_url": "https://api.buywhere.ai/v1/track/xyz789",
  "brand": "Apple",
  "is_available": true
}

Python:

resp = requests.get(
    "https://api.buywhere.ai/v1/products/best-price",
    headers={"X-API-Key": api_key},
    params={"q": "iphone 15 case"},
    timeout=30,
)
cheapest = resp.json()
print(f"Best price: {cheapest['currency']} {cheapest['price']} on {cheapest['source']}")

No iteration. No scraping multiple pages. One request.


Comparing Across Platforms

Sometimes you want to show the user all options, not just the cheapest. The /products/compare endpoint shows the same product on every platform it appears:

curl "https://api.buywhere.ai/v1/products/compare?product_id=12345" \
  -H "X-API-Key: $BUYWHERE_API_KEY"
{
  "source_product_id": 12345,
  "total_matches": 5,
  "matches": [
    {
      "id": 67890,
      "source": "lazada_sg",
      "name": "ASUS VivoBook 15 Laptop",
      "price": 1249.00,
      "buy_url": "https://www.lazada.sg/products/...",
      "match_score": 0.95
    },
    {
      "id": 11111,
      "source": "shopee_sg",
      "name": "ASUS VivoBook 15 Laptop",
      "price": 1299.00,
      "buy_url": "https://shopee.sg/product/...",
      "match_score": 0.93
    }
  ]
}

The match_score indicates how confident we are that it's the same product — useful when platform titles differ slightly.


Price History: Is It Actually a Deal?

E-commerce platforms frequently show "original prices" that are inflated to make discounts look bigger. BuyWhere tracks price history so your agent can distinguish real deals from fake ones:

curl "https://api.buywhere.ai/v1/products/12345/price-history?limit=30" \
  -H "X-API-Key: $BUYWHERE_API_KEY"
{
  "product_id": 12345,
  "total": 30,
  "entries": [
    {"price": 1299.00, "currency": "SGD", "recorded_at": "2026-04-04T00:00:00Z"},
    {"price": 1349.00, "currency": "SGD", "recorded_at": "2026-03-28T00:00:00Z"},
    {"price": 1299.00, "currency": "SGD", "recorded_at": "2026-03-21T00:00:00Z"}
  ]
}

Combined with /products/{id}/price-stats, you can tell the user "this is currently 10% above its 30-day average" or "this is the lowest price we've recorded."


Ingesting Your Own Scraper Data

If you're running your own scraping pipeline and want to contribute to the catalog — or if you need to index platforms we don't yet cover — the ingestion API accepts batch upserts:

resp = requests.post(
    "https://api.buywhere.ai/v1/ingest/products",
    headers={"Authorization": f"Bearer {api_key}"},
    json={
        "source": "shopee_sg",
        "products": [
            {
                "sku": "SHOPEE-ABC123",
                "merchant_id": "shop_abc",
                "title": "Product Name",
                "price": 29.99,
                "currency": "SGD",
                "url": "https://shopee.sg/product/...",
                "image_url": "https://cf.shopee.sg/file/...",
                "brand": "BrandName",
                "category": "Electronics",
                "is_active": True,
            }
        ]
    },
)
print(resp.json())
# {"run_id": 42, "status": "completed", "rows_inserted": 1, "rows_updated": 0}

Ingestion upserts by SKU + source, so re-running your scraper updates existing products rather than duplicating them. You'll get back a run ID you can track for progress.


LangChain Integration

BuyWhere integrates naturally with LangChain as a tool. Here's a complete example:

import os
import requests
from langchain_core.tools import tool

@tool
def buywhere_search(query: str) -> str:
    """Search BuyWhere products and return the top results."""
    resp = requests.get(
        f"{os.environ['BUYWHERE_BASE_URL']}/v1/products",
        headers={"X-API-Key": os.environ["BUYWHERE_API_KEY"]},
        params={"q": query, "limit": 5},
        timeout=30,
    )
    resp.raise_for_status()
    items = resp.json().get("items", [])

    if not items:
        return f"No results for {query!r}."

    lines = []
    for item in items:
        link = item.get("affiliate_url") or item.get("buy_url")
        lines.append(
            f"{item['name']} | {item['currency']} {item['price']} | "
            f"{item['source']} | {link}"
        )
    return "\n".join(lines)

The tool returns a plain string, which is what LangChain expects. Your agent can then parse that string or pass it to another agent for formatting.

CrewAI works the same way — it's just a @tool decorator on a function that returns a string.


Pricing

TierRate LimitPrice
Free100 req/minFree
Standard500 req/minContact us
Premium1,000 req/minContact us

The free tier is designed for development, testing, and small-scale applications. It has no time limit. Upgrade to Standard or Premium when you need higher throughput for production workloads.

Rate limit headers are included on every response:

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 997
X-RateLimit-Reset: 1743787260

When you're rate limited, the API returns HTTP 429 with a Retry-After header telling you how many seconds to wait.


Getting Started

Getting from zero to your first API response takes about five minutes:

Step 1: Get an API key

curl -X POST https://api.buywhere.ai/v1/developers/signup \
  -H "Content-Type: application/json" \
  -d '{"email": "you@example.com", "name": "My Shopping Agent"}'

You'll receive a key like bw_live_xR2kP9vL7mNqT4w... in the response. Store it securely — it won't be shown again.

Step 2: Confirm the API is up

curl https://api.buywhere.ai/health
# {"status": "ok"}

Step 3: Run your first search

curl "https://api.buywhere.ai/v1/products?q= running+shoes&limit=3" \
  -H "X-API-Key: bw_live_xR2kP9vL7mNqT4w..."

Full documentation is available at https://docs.buywhere.ai, including the complete API reference, authentication guide, and code samples in Python and JavaScript.


Why Not Just Scrape?

You could. But consider what's involved: managing proxy rotation, handling CAPTCHAs, surviving platform redesigns that break your parsers, dealing with rate limiting, and normalizing product data from 10 different HTML structures. Oh, and keeping it all running 24/7 as a background job.

The scraped data is also usually incomplete — prices without original prices, no price history, no cross-platform comparison data. You end up building a worse version of BuyWhere while trying to build your actual product.

The API is $0 for development and the free tier handles real traffic for small applications. The economics are straightforward: pay for the API instead of engineering time.


What's Next

BuyWhere is actively expanding coverage across Southeast Asia. The current catalog covers Singapore, with Vietnam, Indonesia, Philippines, Malaysia, and Thailand coming in the next quarter.

If you're building an AI agent that needs to interact with e-commerce — a shopping assistant, a price comparison agent, a deal-finding bot, a product research tool — the infrastructure is already there. You don't need to build the scraping pipeline, maintain the proxies, or normalize the data schemas. You just need the API key.

Get one at https://api.buywhere.ai.