Skip to content

Lesson idea: Singapore product price comparison agent using BuyWhere API (real-world tool use example) #1203

@BuyWhere

Description

@BuyWhere

Lesson Idea: Build a Singapore Product Price Comparison Agent with BuyWhere

Hi Microsoft GenAI for Beginners team,

Wanted to suggest a lesson idea that would showcase real-world agent tool use in a relatable way: building a Singapore product price comparison agent using BuyWhere (https://buywhere.ai).

BuyWhere provides live Singapore e-commerce data from Harvey Norman, Shopee, and Lazada via a simple REST API. It is a great beginner-friendly data source because the use case is immediately understandable.

Lesson Concept: "Your First Shopping Agent"

This lesson could cover:

  1. What tool use is and why agents need real-time data
  2. Integrating a REST API as an agent tool
  3. Testing the agent with real Singapore product queries

Simple Example

import requests
from openai import OpenAI

client = OpenAI()

def search_singapore_products(query: str) -> str:
    response = requests.get("https://api.buywhere.ai/search", params={"q": query})
    products = response.json().get("products", [])
    return str(products[:3])  # Return top 3 results

tools = [{
    "type": "function",
    "function": {
        "name": "search_singapore_products", 
        "description": "Search live product prices in Singapore from Harvey Norman, Shopee, Lazada",
        "parameters": {"type": "object", "properties": {"query": {"type": "string"}}, "required": ["query"]}
    }
}]

response = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "Find the cheapest iPhone 16 in Singapore"}],
    tools=tools
)

Why it works well as a lesson

  • Immediate, understandable value (finding cheap products)
  • Clean API, easy to integrate
  • Real output — not mock data — makes the lesson feel meaningful
  • Works with OpenAI, Anthropic, or any LLM

Docs: https://buywhere.ai/developers/


Disclosure: I work on the BuyWhere team.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions