Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions content/blog/best-time-to-buy-smartphones.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
title: "Best Time to Buy Smartphones — Seasonal Price Guide"
slug: "best-time-to-buy-smartphones"
publishedAt: "2026-06-18"
description: "Data-driven analysis of when smartphone prices drop lowest — iPhone, Samsung Galaxy, Google Pixel seasonal deals, launch cycles, and 90-day price history trends across US and Singapore retailers."
category: Blog
tags:
- "best time to buy smartphone"
- "when to buy iPhone"
- "smartphone deals"
- "price tracking"
- "Samsung Galaxy sale"
- "Google Pixel deal"
- "phone price history"
- "Black Friday phone deals"
- "Singapore phone price"
---

# Best Time to Buy Smartphones in 2026 — Seasonal Deals & Price Drop Patterns

Smartphones are one of the most price-volatile products you can buy. Prices can drop 30-40% within months of launch. Using BuyWhere's 90-day price history data across Amazon, Walmart, Shopee, and Lazada, here's when you should buy.

## The Smartphone Price Cycle

### 1. Launch Day (Worst Time to Buy)
New flagships launch at MSRP. The iPhone, Galaxy S series, and Pixel all command full price for the first 4-6 weeks. Don't buy at launch unless you absolutely need the latest hardware.

### 2. 8-12 Week Mark (First Discount)
This is the sweet spot for early adopters who want the latest model but don't want to overpay. Expect 10-15% off MSRP from third-party retailers like Amazon and Walmart.

### 3. 6-Month Mark (Deep Discount)
By month 6, flagship phones typically hit 20-25% below launch price. This is the best value-for-money window — the phone is still current-gen but the hype premium has evaporated.

### 4. Black Friday / Cyber Monday
The biggest annual discount event. In 2025, we tracked 35-40% off on Galaxy S24 series and 25-30% off on iPhone 15 models during Black Friday week.

### 5. Next-Gen Launch (Clearance)
When the next model launches, previous-gen phones hit their lowest prices — often 40-50% off. This is the best time to buy if you don't need the latest specs.

## By Brand

### iPhone
- **Best window:** Black Friday (Oct-Nov) or 2 months after September launch
- **Typical max discount:** 25-30%
- **Tip:** Refurbished iPhones from Apple hit their lowest during March-April

### Samsung Galaxy
- **Best window:** 3-4 months after February launch (May-June)
- **Typical max discount:** 35-40%
- **Tip:** Samsung runs aggressive trade-in offers — stack with retailer discounts

### Google Pixel
- **Best window:** October Prime Day or 4 months after October launch
- **Typical max discount:** 30-35%
- **Tip:** Google Store frequently bundles Pixel with Pixel Buds at no extra cost

## How to Track Prices

Use [BuyWhere's price alerts](https://buywhere.ai) to set your target price and get notified when it drops:

1. Search for your phone at [buywhere.ai](https://buywhere.ai/search)
2. Click "Track Price"
3. Set your target price
4. Get notified via email when the price hits your target
109 changes: 109 additions & 0 deletions content/blog/build-shopping-agent-buywhere-mcp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
---
title: "Build a Price Comparison Shopping Agent with BuyWhere MCP"
slug: "build-shopping-agent-buywhere-mcp"
publishedAt: "2026-06-18"
description: "Step-by-step tutorial for building an AI shopping agent using BuyWhere's MCP server. Search 11M+ products, compare prices across Amazon Walmart Shopee, and track deals with 50 lines of Python."
category: Blog
tags:
- "MCP"
- "shopping agent"
- "price comparison"
- "AI agent"
- "LangChain"
- "product search API"
- "price tracking"
- "developer tutorial"
---

# Build a Price Comparison Shopping Agent with BuyWhere MCP

AI shopping agents are one of the most practical applications of the Model Context Protocol (MCP). With BuyWhere's MCP server, you can build an agent that searches products, compares prices, and tracks deals across 11M+ products from Amazon, Walmart, Shopee, Lazada, and thousands of other retailers — in under 50 lines of code.

In this tutorial, you'll build a price comparison agent using Python and the `langchain-mcp-adapter` package.

## Prerequisites

- Python 3.10+
- A BuyWhere API key (free — get one at buywhere.ai/api-keys)
- `pip install langchain-mcp-adapter httpx`

## Step 1: Get Your API Key

Sign up at [buywhere.ai](https://buywhere.ai) and navigate to **API Keys**. Create a new key and save it — you'll need it to authenticate your agent.

## Step 2: Connect to BuyWhere MCP

BuyWhere exposes four MCP tools:

| Tool | Description |
|------|-------------|
| `search_products` | Full-text search across 11M+ products |
| `compare_prices` | Side-by-side price comparison |
| `get_price_history` | 90-day price trend data |
| `get_price_alerts` | Set threshold-based price drop alerts |

Here's how to connect:

```python
import json
import httpx

BUYWHERE_API_URL = "https://api.buywhere.ai/mcp/v1"
API_KEY = "your-api-key-here"

async def search_products(query: str, limit: int = 5):
"""Search products using BuyWhere MCP."""
async with httpx.AsyncClient() as client:
response = await client.post(
f"{BUYWHERE_API_URL}/search",
headers={"Authorization": f"Bearer {API_KEY}"},
json={"query": query, "limit": limit}
)
return response.json()
```

## Step 3: Build the Agent

Now let's create a ReAct agent that can search and compare prices:

```python
from langchain_mcp_adapter import MCPClient
from langchain.agents import create_react_agent, AgentExecutor
from langchain_openai import ChatOpenAI

# Initialize MCP client pointing to BuyWhere
mcp = MCPClient(
server_url="https://api.buywhere.ai/mcp/v1",
headers={"Authorization": f"Bearer {API_KEY}"}
)

# Load tools from MCP
tools = mcp.load_tools()

# Create the agent
llm = ChatOpenAI(model="gpt-4o")
agent = create_react_agent(llm, tools, prompt="You are a shopping assistant.")
executor = AgentExecutor(agent=agent, tools=tools)

# Run a query
result = executor.invoke({
"input": "Find me the cheapest RTX 4070 GPU across all retailers and compare prices"
})
print(result["output"])
```

## Step 4: Add Price Alerts

Want to know when a product drops to your target price? Use the alert tool:

```python
result = executor.invoke({
"input": "Set a price alert for Sony WH-1000XM5 headphones — notify me if it drops below $250"
})
```

## What's Next?

- Check the full [BuyWhere API docs](https://buywhere.ai/docs)
- Explore the [MCP server on GitHub](https://github.com/buywhere/buywhere-mcp)
- Browse [best deals by category](https://buywhere.ai/categories)
182 changes: 182 additions & 0 deletions content/blog/openai-agents-sdk-buywhere-mcp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
---
slug: "openai-agents-sdk-buywhere-mcp-tutorial"
title: "Build an AI Shopping Agent with OpenAI Agents SDK + BuyWhere MCP"
description: "Step-by-step tutorial showing how to build a powerful AI shopping agent using OpenAI's Agents SDK and BuyWhere's MCP server for real-time product search and price comparison."
author: "BuyWhere Team"
publishedAt: "2026-06-19"
lastUpdatedAt: "2026-06-19"
tags: ["openai", "agents-sdk", "mcp", "tutorial", "shopping-agent", "python"]
jsonLd: >
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "TechArticle",
"headline": "Build an AI Shopping Agent with OpenAI Agents SDK + BuyWhere MCP",
"description": "Step-by-step tutorial for building an AI shopping agent using OpenAI's Agents SDK and BuyWhere's MCP server for real-time product search and price comparison.",
"proficiencyLevel": "Beginner",
"dependencies": "Python 3.10+, OpenAI API key, BuyWhere API key",
"datePublished": "2026-06-19"
}
]
}
category: Blog
schema_type: TechArticle
published: true
---

In this tutorial, you will build an AI shopping agent that searches products, compares prices across retailers, and finds deals using natural language. You will use:

- **OpenAI Agents SDK** (Python) -- the official framework for building agentic AI apps
- **BuyWhere MCP API** -- a Model Context Protocol-compatible API providing real-time product search and price comparison across 50M+ products

## Prerequisites

- Python 3.10+
- An OpenAI API key
- A BuyWhere API key (free at https://buywhere.ai)

## Step 1: Set up the project


Create a new project directory and install the required packages:

```bash
mkdir shopping-agent
cd shopping-agent
python -m venv venv
source venv/bin/activate
pip install openai-agents httpx python-dotenv
```

## Step 2: Configure environment

Create a `.env` file:

```
OPENAI_API_KEY=sk-...
BUYWHERE_API_KEY=bw_...
```


## Step 3: Create the shopping agent

Create `shopping_agent.py`:

```python
import os
import json
import httpx
from dotenv import load_dotenv
from agents import Agent, Runner, function_tool

load_dotenv()

BUYWHERE_API_URL = "https://api.buywhere.ai/mcp/v1"
BUYWHERE_API_KEY = os.getenv("BUYWHERE_API_KEY")

@function_tool
async def search_products(query: str, limit: int = 10) -> str:
"""Search for products across major online retailers.

Args:
query: Natural language product search query
limit: Maximum number of results (default 10)
"""
async with httpx.AsyncClient() as client:
resp = await client.post(
f"{BUYWHERE_API_URL}/search",
headers={"Authorization": f"Bearer {BUYWHERE_API_KEY}"},
json={"q": query, "limit": limit}
)
return json.dumps(resp.json(), indent=2)

@function_tool
async def compare_prices(query: str) -> str:
"""Compare prices for a product across multiple retailers.

Args:
query: Product search query to compare across retailers
"""
async with httpx.AsyncClient() as client:
resp = await client.post(
f"{BUYWHERE_API_URL}/compare",
headers={"Authorization": f"Bearer {BUYWHERE_API_KEY}"},
json={"q": query}
)
return json.dumps(resp.json(), indent=2)

@function_tool
async def get_deals(category: str = "", min_discount: int = 0) -> str:
"""Get current deals and discounts.

Args:
category: Optional category filter
min_discount: Minimum discount percentage (default 0)
"""
async with httpx.AsyncClient() as client:
resp = await client.post(
f"{BUYWHERE_API_URL}/deals",
headers={"Authorization": f"Bearer {BUYWHERE_API_KEY}"},
json={"category": category, "min_discount": min_discount}
)
return json.dumps(resp.json(), indent=2)


async def main():
agent = Agent(
name="Shopping Agent",
instructions="You are a helpful shopping assistant. Use the BuyWhere tools to search for products, compare prices, and find deals. Always show prices in SGD and include the retailer name.",
tools=[search_products, compare_prices, get_deals],
)

result = await Runner.run(agent, "Find the best price for Sony WH-1000XM6 headphones in Singapore")
print(result.final_output)

if __name__ == "__main__":
import asyncio
asyncio.run(main())
```

## Step 4: Run it

```bash
python shopping_agent.py
```


## How It Works

The OpenAI Agents SDK manages the agent lifecycle -- reasoning, tool selection, and response generation. Each `@function_tool` decorated function becomes a tool the agent can call. BuyWhere provides the product data layer via its MCP-compatible HTTP API:

1. User asks a natural language question
2. The agent decides which BuyWhere tool to call
3. BuyWhere searches across retailers and returns structured product data
4. The agent synthesizes the results into a human-readable answer

## Available BuyWhere Tools

| Tool | Description |
|------|-------------|
| `search_products` | Full-text search across 50M+ products |
| `compare_prices` | Compare prices across retailers |
| `get_deals` | Current deals and discounts |
| `get_product` | Detailed product information by ID |
| `list_categories` | Browse available product categories |
| `find_best_price` | Find the lowest price across retailers |

## Going Further

Add price drop alerts, multi-product comparison, and deal discovery by extending the agent with additional BuyWhere tools.

## Resources

- [OpenAI Agents SDK docs](https://openai.github.io/openai-agents-python/)
- [BuyWhere API docs](https://buywhere.ai/docs)
- [Get a BuyWhere API key](https://buywhere.ai/api-keys)


---

*BuyWhere -- Compare prices across 20+ retailers. Save money. Shop smarter.*

21 changes: 0 additions & 21 deletions public/.well-known/api-catalog

This file was deleted.

Loading