Use canonical desktop product URLs. Shortened URLs (amzn.to), affiliate redirects, mobile URLs (m.amazon.com), and search/category pages don't work.
PriceFetch accepts direct product page URLs from supported retailers. Here are the formats that work:
**Amazon:** - `https://www.amazon.com/dp/B0EXAMPLE` (short product URL) - `https://www.amazon.com/Product-Name/dp/B0EXAMPLE` (full product URL) - `https://www.amazon.com/gp/product/B0EXAMPLE` (alternate format) - All country domains: `.co.uk`, `.ca`, `.de`, `.fr`, `.co.jp`, `.com.au`
**Walmart:** - `https://www.walmart.com/ip/Product-Name/123456789` - `https://www.walmart.com/ip/123456789`
**Other supported retailers** follow similar patterns — direct product page URLs with a product identifier in the path.
These URL formats return UNSUPPORTED_RETAILER or VALIDATION_ERROR:
**Shortened URLs** — `amzn.to/3xYz123`, `bit.ly/abc`. These are redirects, not product URLs. Resolve them first by following the redirect, then pass the final URL to PriceFetch.
**Affiliate URLs** — `amazon.com/dp/B0EXAMPLE?tag=affiliate-20` usually works (the tag parameter is ignored), but affiliate redirect services like `shareasale.com/r.cfm?...` or `commission-junction.com/...` don't work. Resolve to the actual product URL.
**Mobile URLs** — `m.amazon.com/dp/B0EXAMPLE` may not work. Use the desktop URL (`www.amazon.com/...`).
**Search and category pages** — `amazon.com/s?k=bluetooth+headphones` or `amazon.com/b?node=12345` are not product pages. PriceFetch needs a specific product URL.
**URLs with locale parameters** — some retailers use query parameters for language/region. These usually work, but strip unnecessary parameters if you're getting errors.
When in doubt, open the URL in your browser. If it shows a single product with a price, it should work with PriceFetch.
import requests
def resolve_shortened_url(short_url: str) -> str:
"""Follow redirects to get the canonical product URL."""
resp = requests.head(short_url, allow_redirects=True, timeout=10)
return resp.url
# Convert shortened URL to canonical URL
canonical = resolve_shortened_url("https://amzn.to/3xYz123")
# canonical is now something like:
# https://www.amazon.com/Product-Name/dp/B0EXAMPLE?ref=...
# Strip tracking parameters (optional)
from urllib.parse import urlparse, urlencode, parse_qs
parsed = urlparse(canonical)
clean_url = f"{parsed.scheme}://{parsed.netloc}{parsed.path}"Still stuck?
Our support team can help debug your integration.
Sign up in 30 seconds. No credit card required. One credit per successful API call.