Developer API
v1 · RESTful · JSON
Access real-time price comparison data, deal scores, cashback estimates, and price history across Amazon, Walmart, Best Buy, Target, eBay, and more. Build price tracking apps, browser extensions, and shopping tools.
Base URL
https://pricemirage.com/api/v1Authentication
Every request requires an API key. Pass it via the x-api-key header (recommended) or the apikey query parameter.
curl -H "x-api-key: pm_free_abc123def456" \
"https://pricemirage.com/api/v1/products?q=airpods"curl "https://pricemirage.com/api/v1/products?q=airpods&apikey=pm_free_abc123def456"Rate Limits
Rate limits are applied per API key. Every response includes rate limit headers so you can track your usage.
| Plan | Requests / Hour | Requests / Day | Price History |
|---|---|---|---|
| Free | 100 | 1,000 | Not included |
| Premium | 1,000 | 10,000 | Included |
| Pro | 10,000 | 100,000 | Included |
Response Headers
X-RateLimit-Limit—Max requests per hour for your planX-RateLimit-Remaining—Remaining requests in the current windowX-RateLimit-Reset—ISO timestamp when the hourly window resetsX-RateLimit-Plan—Your current plan nameEndpoints
/v1/productsSearch products by name, brand, UPC, or description. Results include lowest price and retailer count.
Parameters
q—requiredSearch query (name, brand, UPC)category—Filter by product categoryminPrice—Minimum price in cents (e.g. 1000 = $10.00)maxPrice—Maximum price in centssort—Sort order: relevance, price_asc, price_desc, newest, retailer_countpage—Page number (default: 1)pageSize—Results per page, max 100 (default: 20)Example Response
{
"data": [
{
"id": 42,
"name": "Apple AirPods Pro (2nd Gen)",
"brand": "Apple",
"category": "Electronics",
"lowest_price_cents": 18999,
"lowest_price": "$189.99",
"retailer_count": 5
}
],
"pagination": {
"page": 1,
"pageSize": 20,
"total": 3,
"totalPages": 1,
"hasNext": false,
"hasPrev": false
}
}/v1/products/:idPrice history: Premium+Get full product details including all retailer prices, deal score, price stats, cashback estimates, and price history (Premium/Pro only).
Parameters
id—requiredProduct ID (path parameter)range—Price history range: 7d, 30d, 90d, 1y, all (default: 90d). Premium/Pro only.Example Response
{
"data": {
"id": 42,
"name": "Apple AirPods Pro (2nd Gen)",
"brand": "Apple",
"prices": [
{
"retailer": "Amazon",
"price": "$189.99",
"in_stock": true,
"cashback": {
"estimated": "$4.75",
"rate_percent": 2.5
}
}
],
"deal": {
"score": 82,
"label": "Great Deal",
"explanation": "12% below 90-day average."
},
"stats": {
"all_time_low": "$169.99",
"all_time_high": "$249.99",
"average_price": "$214.50"
}
}
}/v1/pricesCompare prices for a single product across all tracked retailers. Includes cashback estimates and potential savings.
Parameters
productId—Product IDupc—Universal Product Codeasin—Amazon Standard Identification NumberExample Response
{
"data": {
"product": {
"id": 42,
"name": "Apple AirPods Pro (2nd Gen)"
},
"prices": [
{
"retailer": "Amazon",
"price": "$189.99",
"cashback": {
"estimated": "$4.75",
"range": "$1.90 - $7.60"
}
},
{
"retailer": "Walmart",
"price": "$199.00",
"cashback": {
"estimated": "$2.99",
"range": "$1.99 - $3.98"
}
}
],
"summary": {
"retailer_count": 5,
"lowest": { "retailer": "Amazon", "price": "$189.99" },
"highest": { "retailer": "Best Buy", "price": "$249.99" },
"potential_savings": { "amount": "$60.00", "percent": "24.0%" }
}
}
}/v1/dealsGet top-scoring deals across all products. Filter by category and minimum deal score.
Parameters
category—Filter by product categoryminScore—Minimum deal score 0-100 (default: 0)limit—Max results, up to 100 (default: 20)Example Response
{
"data": [
{
"id": 42,
"name": "Apple AirPods Pro (2nd Gen)",
"lowest_price": "$189.99",
"deal": {
"score": 82,
"label": "Great Deal",
"explanation": "12% below 90-day average."
}
}
],
"meta": {
"total": 15,
"filters": { "category": null, "minScore": 60, "limit": 20 }
}
}Error Handling
All errors return a consistent JSON structure with an error field and an HTTP status code.
| Status | Meaning |
|---|---|
400 | Bad Request — Missing or invalid parameters |
401 | Unauthorized — Missing or invalid API key |
404 | Not Found — Product or resource does not exist |
429 | Too Many Requests — Rate limit exceeded |
500 | Internal Server Error — Something went wrong on our end |
Code Examples
# Search for products
curl -H "x-api-key: YOUR_API_KEY" \
"https://pricemirage.com/api/v1/products?q=airpods&pageSize=5"
# Get product details
curl -H "x-api-key: YOUR_API_KEY" \
"https://pricemirage.com/api/v1/products/42"
# Compare prices by UPC
curl -H "x-api-key: YOUR_API_KEY" \
"https://pricemirage.com/api/v1/prices?upc=190199882775"
# Get top deals in electronics
curl -H "x-api-key: YOUR_API_KEY" \
"https://pricemirage.com/api/v1/deals?category=electronics&minScore=60"const API_KEY = 'YOUR_API_KEY';
const BASE = 'https://pricemirage.com/api/v1';
// Search products
async function searchProducts(query, options = {}) {
const params = new URLSearchParams({
q: query,
page: options.page || 1,
pageSize: options.pageSize || 20,
...(options.category && { category: options.category }),
...(options.minPrice && { minPrice: options.minPrice }),
...(options.maxPrice && { maxPrice: options.maxPrice }),
});
const res = await fetch(`${BASE}/products?${params}`, {
headers: { 'x-api-key': API_KEY },
});
if (!res.ok) throw new Error(`API error: ${res.status}`);
return res.json();
}
// Get product with prices
async function getProduct(id) {
const res = await fetch(`${BASE}/products/${id}`, {
headers: { 'x-api-key': API_KEY },
});
return res.json();
}
// Usage
const results = await searchProducts('airpods', { maxPrice: 25000 });
console.log(results.data);import requests
API_KEY = "YOUR_API_KEY"
BASE = "https://pricemirage.com/api/v1"
HEADERS = {"x-api-key": API_KEY}
def search_products(query, **kwargs):
params = {"q": query, **kwargs}
resp = requests.get(f"{BASE}/products", headers=HEADERS, params=params)
resp.raise_for_status()
return resp.json()
def get_product(product_id):
resp = requests.get(f"{BASE}/products/{product_id}", headers=HEADERS)
resp.raise_for_status()
return resp.json()
def compare_prices(product_id=None, upc=None, asin=None):
params = {}
if product_id:
params["productId"] = product_id
if upc:
params["upc"] = upc
if asin:
params["asin"] = asin
resp = requests.get(f"{BASE}/prices", headers=HEADERS, params=params)
resp.raise_for_status()
return resp.json()
def get_deals(category=None, min_score=0, limit=20):
params = {"minScore": min_score, "limit": limit}
if category:
params["category"] = category
resp = requests.get(f"{BASE}/deals", headers=HEADERS, params=params)
resp.raise_for_status()
return resp.json()
# Usage
results = search_products("airpods", category="electronics")
for product in results["data"]:
print(f"{product['name']} — {product['lowest_price']}")
deals = get_deals(min_score=70, limit=10)
for deal in deals["data"]:
print(f"[{deal['deal']['score']}] {deal['name']} — {deal['lowest_price']}")Ready to build?
Get your free API key and start integrating real-time price data in minutes. Upgrade anytime for higher limits and price history access.