API Documentation

Everything you need to integrate PriceFetch into your application.

Overview

PriceFetch is a REST API that returns the current price of any product given its URL. Send a product URL from a supported retailer, and get back structured JSON with the price, currency, stock status, and more.

Base URL
https://api.pricefetch.dev

All requests require an API key passed via the X-API-Key header. Sign up for a free account to get your API key.

Authentication

Authenticate every request by including your API key in the X-API-Key header.

bash
curl -H "X-API-Key: pf_live_abc123..." \ "https://api.pricefetch.dev/v1/price?url=https://amazon.com/dp/B0DFJ5K6JB"

API keys start with pf_live_ followed by 32 hex characters. You can generate and manage keys from your dashboard.

Keep your API key secret. Do not expose it in client-side code.

GET /v1/price

Fetch the current price of a product.

Parameters

ParameterTypeRequiredDescription
urlstringYesFull product URL from a supported retailer

Headers

HeaderRequiredDescription
X-API-KeyYesYour PriceFetch API key
bash
GET /v1/price?url=https://www.amazon.com/dp/B0DFJ5K6JB HTTP/1.1 Host: api.pricefetch.dev X-API-Key: pf_live_abc123...

Response Format

All responses follow a consistent envelope format.

Success Response (200)

json
{ "success": true, "data": { "url": "https://www.amazon.com/dp/B0DFJ5K6JB", "price": 29.99, "currency": "USD", "in_stock": true, "retailer": "amazon", "timestamp": "2026-03-22T12:00:00Z" }, "credits_remaining": 487, "request_id": "req_a1b2c3d4" }

Response Fields

FieldTypeDescription
pricenumberProduct price as a decimal number
currencystringISO 4217 currency code (USD, GBP, EUR, etc.)
in_stockbooleanWhether the product is currently in stock
retailerstringDetected retailer (amazon, walmart, newegg, iherb)
timestampstringISO 8601 timestamp of when the price was scraped
credits_remainingnumberYour remaining credit balance

Error Codes

When a request fails, the response includes a structured error object.

json
{ "success": false, "error": { "code": "UNSUPPORTED_RETAILER", "message": "The provided URL is not from a supported retailer." }, "request_id": "req_xyz789" }
HTTPCodeDescription
400VALIDATION_ERRORMissing or invalid url parameter
401INVALID_API_KEYMissing or invalid API key
402INSUFFICIENT_CREDITSNo credits remaining — top up on the billing page
422UNSUPPORTED_RETAILERURL is not from a supported retailer
422PRICE_NOT_FOUNDPage loaded but no price could be extracted
422PAGE_LOAD_FAILEDCould not load the product page (timeout, CAPTCHA, etc.)
429RATE_LIMITEDToo many requests — check Retry-After header

Rate Limits

Rate limits are applied per API key.

LimitValue
Per-second burst5 requests/second
Monthly cap10,000 requests/month

Every response includes rate limit headers:

HeaderDescription
X-RateLimit-LimitMaximum requests per second
X-RateLimit-RemainingRemaining requests in current window
X-RateLimit-ResetSeconds until the rate limit resets
X-Request-IdUnique request identifier for debugging

Supported Retailers

RetailerDomainsCurrency
Amazonamazon.com, amazon.co.uk, amazon.de, amazon.fr, amazon.co.jp, amazon.ca, amazon.com.au, +9 moreUSD, GBP, EUR, JPY, CAD, AUD, etc.
Walmartwalmart.comUSD
Neweggnewegg.com, newegg.caUSD, CAD
iHerbiherb.comUSD

More retailers coming soon. Request a retailer.

Code Examples

Python

python
import requests response = requests.get( "https://api.pricefetch.dev/v1/price", params={"url": "https://www.amazon.com/dp/B0DFJ5K6JB"}, headers={"X-API-Key": "pf_live_your_key_here"} ) data = response.json() if data["success"]: product = data["data"] print(f"Price: {product['price']} {product['currency']}") print(f"In Stock: {product['in_stock']}") else: print(f"Error: {data['error']['message']}")

JavaScript / Node.js

javascript
const response = await fetch( "https://api.pricefetch.dev/v1/price?url=https://www.amazon.com/dp/B0DFJ5K6JB", { headers: { "X-API-Key": "pf_live_your_key_here" } } ); const data = await response.json(); if (data.success) { console.log(`Price: ${data.data.price} ${data.data.currency}`); console.log(`In Stock: ${data.data.in_stock}`); } else { console.error(`Error: ${data.error.message}`); }

cURL

bash
curl -s -H "X-API-Key: pf_live_your_key_here" \ "https://api.pricefetch.dev/v1/price?url=https://www.amazon.com/dp/B0DFJ5K6JB" \ | python3 -m json.tool