SDKs
Official and community SDKs for integrating with the BuyWhere API.
Official SDKs
Python SDK
The official Python SDK with sync and async support.
Repository: buywhere at /home/paperclip/buywhere-py
Installation:
pip install buywhere
Quick Start:
from buywhere_sdk import BuyWhere
client = BuyWhere(api_key="bw_live_xxxxx")
results = client.search("laptop", limit=10)
print(f"Found {results.total} products")
Async Support:
from buywhere_sdk import AsyncBuyWhere
async with AsyncBuyWhere(api_key="bw_live_xxxxx") as client:
results = await client.search("laptop")
JavaScript/TypeScript SDK
Repository: Available at buywhere_sdk in the repository
Installation:
npm install @buywhere/sdk
Quick Start:
import BuyWhere from '@buywhere/sdk';
const client = new BuyWhere({ apiKey: 'bw_live_xxxxx' });
const results = await client.search({ query: 'laptop', limit: 10 });
Community SDKs
LangChain Integration
BuyWhere ships first-class LangChain tools in the Python SDK for AI agent workflows.
from buywhere_sdk.langchain import BuyWhereToolkit
toolkit = BuyWhereToolkit(api_key="bw_live_xxxxx")
tools = toolkit.get_tools()
See the LangChain Integration Guide for a full step-by-step tutorial, including installation, agent setup, result handling, and error handling.
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_live_xxxxx")
product = client.best_price(product_name)
return f"{product.name} | {product.currency} {product.price} | {product.source}"
Raw HTTP
If no SDK is available for your stack, use raw HTTP:
import requests
response = requests.get(
"https://api.buywhere.ai/v1/search",
headers={"Authorization": "Bearer bw_live_xxxxx"},
params={"q": "laptop", "limit": 10},
)
data = response.json()
See the Quickstart Guide for more raw HTTP examples.