Tracking 0+ products across 0 retailers

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

All requests use this base URLtext
https://pricemirage.com/api/v1

Authentication

Every request requires an API key. Pass it via the x-api-key header (recommended) or the apikey query parameter.

Header (recommended)bash
curl -H "x-api-key: pm_free_abc123def456" \
  "https://pricemirage.com/api/v1/products?q=airpods"
Query parameterbash
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.

PlanRequests / HourRequests / DayPrice History
Free1001,000Not included
Premium1,00010,000Included
Pro10,000100,000Included

Response Headers

X-RateLimit-LimitMax requests per hour for your plan
X-RateLimit-RemainingRemaining requests in the current window
X-RateLimit-ResetISO timestamp when the hourly window resets
X-RateLimit-PlanYour current plan name

Endpoints

GET/v1/products

Search products by name, brand, UPC, or description. Results include lowest price and retailer count.

Parameters

qrequiredSearch query (name, brand, UPC)
categoryFilter by product category
minPriceMinimum price in cents (e.g. 1000 = $10.00)
maxPriceMaximum price in cents
sortSort order: relevance, price_asc, price_desc, newest, retailer_count
pagePage number (default: 1)
pageSizeResults 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
  }
}
GET/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

idrequiredProduct ID (path parameter)
rangePrice 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"
    }
  }
}
GET/v1/prices

Compare prices for a single product across all tracked retailers. Includes cashback estimates and potential savings.

Parameters

productIdProduct ID
upcUniversal Product Code
asinAmazon Standard Identification Number

Example 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%" }
    }
  }
}
GET/v1/deals

Get top-scoring deals across all products. Filter by category and minimum deal score.

Parameters

categoryFilter by product category
minScoreMinimum deal score 0-100 (default: 0)
limitMax 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.

StatusMeaning
400Bad Request — Missing or invalid parameters
401Unauthorized — Missing or invalid API key
404Not Found — Product or resource does not exist
429Too Many Requests — Rate limit exceeded
500Internal Server Error — Something went wrong on our end

Code Examples

cURLbash
# 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"
JavaScript (fetch)javascript
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);
Python (requests)python
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.