DEV Community

BuyWhere
BuyWhere

Posted on

Building AI Agents for Southeast Asia: The Commerce Data Problem

Building AI Agents for Southeast Asia: The Commerce Data Problem

Southeast Asia is one of the fastest-growing e-commerce markets in the world. Shopee and Lazada dominate. Tokopedia, JD.ID, and dozens of local platforms compete. And increasingly, developers are building AI agents to help consumers navigate all of this.

But there is a gap: where does an AI agent get its product data?

The SEA Commerce Data Landscape

Building a shopping agent for Southeast Asia means dealing with:

  • Multiple platforms: Shopee, Lazada, Tokopedia, Harvey Norman, Courts, and more
  • Real-time pricing: prices change constantly, especially during sales
  • Multi-language product listings: English, Bahasa, Chinese, Thai, Vietnamese
  • Regional availability: a product available in Singapore may not be in Malaysia

Most developers who try to solve this end up building scrapers. It is understandable — the data is right there on the product pages. But scrapers are fragile, violate ToS, and break constantly.

A Better Approach: Dedicated Commerce APIs

For Singapore specifically, BuyWhere has solved this problem. It is a real-time product catalog API that aggregates pricing from:

  • Harvey Norman
  • Shopee Singapore
  • Lazada Singapore
  • And 10+ other retailers

One API call. Structured data. Updated daily. No scraping.

curl "https://api.buywhere.ai/search?q=iPhone+16&country=sg" \
  -H "Authorization: Bearer YOUR_KEY"
Enter fullscreen mode Exit fullscreen mode

Response:

{
  "products": [
    {
      "name": "Apple iPhone 16 128GB",
      "price": 1299.00,
      "currency": "SGD",
      "retailer": "Harvey Norman",
      "url": "https://...",
      "in_stock": true
    },
    ...
  ]
}
Enter fullscreen mode Exit fullscreen mode

Building a Singapore Shopping Agent

Here is a minimal LangChain shopping agent using BuyWhere:

from langchain_openai import ChatOpenAI
from langchain.agents import create_openai_tools_agent, AgentExecutor
from langchain.tools import tool
from langchain_core.prompts import ChatPromptTemplate
import requests

BUYWHERE_KEY = "your_key_here"

@tool
def find_cheapest_in_singapore(product: str) -> str:
    """Find the cheapest price for a product in Singapore."""
    r = requests.get(
        "https://api.buywhere.ai/search",
        params={"q": product, "sort": "price_asc"},
        headers={"Authorization": f"Bearer {BUYWHERE_KEY}"}
    )
    products = r.json().get("products", [])[:3]
    if not products:
        return "No products found."
    lines = [f"{p['name']} — S${p['price']:.2f} at {p['retailer']}" 
             for p in products]
    return "\n".join(lines)

llm = ChatOpenAI(model="gpt-4o-mini")
tools = [find_cheapest_in_singapore]

prompt = ChatPromptTemplate.from_messages([
    ("system", "You are a helpful Singapore shopping assistant."),
    ("human", "{input}"),
    ("placeholder", "{agent_scratchpad}"),
])

agent = create_openai_tools_agent(llm, tools, prompt)
executor = AgentExecutor(agent=agent, tools=tools)

result = executor.invoke({"input": "Find me the cheapest 65-inch TV"})
print(result["output"])
Enter fullscreen mode Exit fullscreen mode

What is Next for SEA Agent Commerce

Singapore is the starting point, but the bigger opportunity is Southeast Asia as a whole. Thailand, Indonesia, Vietnam, Philippines — each has its own dominant platforms and consumer behaviors.

The developers who build the data layer for these markets will have a significant advantage.

BuyWhere developer docs: buywhere.ai/developers

Top comments (0)