The Scavio search API returns Amazon product data as structured JSON when you set platform to amazon. You get titles, prices, ratings, and review counts without writing a scraper or managing proxies.
Prerequisites
- Python 3.9+ or Node.js 18+
- Scavio API key
Walkthrough
Step 1: Send a search request with platform:amazon
Add platform:"amazon" to the search payload. The API routes the query to Amazon and returns product listings.
import requests
API_KEY = "your-scavio-api-key"
response = requests.post(
"https://api.scavio.dev/api/v1/search",
json={
"query": "noise cancelling headphones under 100",
"platform": "amazon",
"num_results": 10
},
headers={"x-api-key": API_KEY}
)
products = response.json().get("organic_results", [])
for p in products:
print(p.get("title"), p.get("price"), p.get("rating"))Step 2: Parse the structured product fields
Amazon results include product-specific fields not present in Google results.
for product in products:
print({
"title": product.get("title"),
"price": product.get("price"), # e.g. "$49.99"
"rating": product.get("rating"), # e.g. 4.3
"reviews": product.get("reviews_count"), # e.g. 12847
"asin": product.get("asin"), # e.g. "B09XYZ1234"
"is_prime": product.get("is_prime"), # True/False
"url": product.get("link")
})Step 3: Filter and sort results in Python
Extract numeric prices and filter by budget.
import re
def parse_price(price_str: str) -> float:
if not price_str:
return float("inf")
match = re.search(r"[\d,.]+", price_str.replace(",", ""))
return float(match.group()) if match else float("inf")
budget_products = [
p for p in products
if parse_price(p.get("price", "")) <= 100
]
budget_products.sort(key=lambda p: p.get("rating") or 0, reverse=True)
for p in budget_products[:5]:
print(f"{p['title'][:60]} | {p.get('price')} | {p.get('rating')}")Python Example
import requests
import re
from typing import Optional
API_KEY = "your-scavio-api-key"
def search_amazon(query: str, num_results: int = 20) -> list:
r = requests.post(
"https://api.scavio.dev/api/v1/search",
json={"query": query, "platform": "amazon", "num_results": num_results},
headers={"x-api-key": API_KEY},
timeout=20
)
r.raise_for_status()
return r.json().get("organic_results", [])
def parse_price(price_str: Optional[str]) -> float:
if not price_str:
return float("inf")
cleaned = price_str.replace(",", "")
match = re.search(r"[\d.]+", cleaned)
return float(match.group()) if match else float("inf")
def find_best_value(query: str, max_price: float, min_rating: float = 4.0) -> list:
products = search_amazon(query, num_results=20)
filtered = [
p for p in products
if parse_price(p.get("price")) <= max_price
and (p.get("rating") or 0) >= min_rating
]
filtered.sort(key=lambda p: (p.get("rating") or 0) * (p.get("reviews_count") or 1), reverse=True)
return filtered
if __name__ == "__main__":
results = find_best_value("noise cancelling headphones", max_price=100, min_rating=4.0)
print(f"Found {len(results)} products under $100 with rating >= 4.0\n")
for i, p in enumerate(results[:5], 1):
print(f"{i}. {p.get('title', '')[:70]}")
print(f" Price: {p.get('price')} | Rating: {p.get('rating')} ({p.get('reviews_count', 0):,} reviews)")
print(f" ASIN: {p.get('asin')} | Prime: {p.get('is_prime')}")
print()JavaScript Example
const API_KEY = 'your-scavio-api-key';
async function searchAmazon(query, numResults = 20) {
const res = await fetch('https://api.scavio.dev/api/v1/search', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'x-api-key': API_KEY },
body: JSON.stringify({ query, platform: 'amazon', num_results: numResults })
});
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
return data.organic_results ?? [];
}
function parsePrice(priceStr) {
if (!priceStr) return Infinity;
const match = priceStr.replace(/,/g, '').match(/[\d.]+/);
return match ? parseFloat(match[0]) : Infinity;
}
const products = await searchAmazon('noise cancelling headphones', 20);
const affordable = products
.filter(p => parsePrice(p.price) <= 100 && (p.rating ?? 0) >= 4.0)
.sort((a, b) => (b.rating ?? 0) - (a.rating ?? 0));
for (const p of affordable.slice(0, 5)) {
console.log(`${p.title?.slice(0, 70)}`);
console.log(` Price: ${p.price} | Rating: ${p.rating} | ASIN: ${p.asin}`);
}Expected Output
Found 8 products under $100 with rating >= 4.0
1. Sony WH-CH720N Noise Canceling Wireless Headphones
Price: $79.99 | Rating: 4.4 (3,241 reviews)
ASIN: B0BWT7GS4L | Prime: True
2. Soundcore by Anker Q45 Adaptive Active Noise Cancelling
Price: $59.99 | Rating: 4.3 (8,102 reviews)
ASIN: B0C7JXGBND | Prime: True