Successful dropshipping starts with finding products that have strong demand, good margins, and manageable competition. Manual product research across Amazon and Walmart is tedious and slow. This tutorial builds an automated product research pipeline that queries both platforms via the Scavio API, calculates potential margins from price differences, filters by review quality, and outputs a ranked list of product opportunities.
Prerequisites
- Python 3.10 or higher
- requests library installed
- A Scavio API key
- A list of product niches to research
Walkthrough
Step 1: Define product niches to research
Start with broad product categories that tend to perform well in dropshipping. The script will search both platforms for each niche.
NICHES = [
"portable blender",
"posture corrector",
"led strip lights",
"phone tripod",
]Step 2: Search both platforms for each niche
Query Amazon and Walmart through the Scavio API and collect the top products from each.
from concurrent.futures import ThreadPoolExecutor
def search_platform(platform: str, query: str) -> list[dict]:
r = requests.post(
"https://api.scavio.dev/api/v1/search",
headers={"x-api-key": API_KEY},
json={"platform": platform, "query": query, "marketplace": "US"}
)
r.raise_for_status()
return r.json().get("products", [])[:10]
def research_niche(niche: str) -> dict:
with ThreadPoolExecutor(max_workers=2) as ex:
amazon_fut = ex.submit(search_platform, "amazon", niche)
walmart_fut = ex.submit(search_platform, "walmart", niche)
return {"amazon": amazon_fut.result(), "walmart": walmart_fut.result()}Step 3: Score products by opportunity
Calculate an opportunity score based on price, rating, and review volume. Higher ratings with lower competition signal good opportunities.
def score_product(product: dict) -> float:
price = float(product.get("price", "0").replace("$", "").replace(",", "") or 0)
rating = float(product.get("rating", "0") or 0)
reviews = int(product.get("reviews_count", 0) or 0)
if price < 10 or price > 200:
return 0
review_score = min(reviews / 1000, 5)
return round(rating * review_score * (1 if 20 < price < 80 else 0.5), 2)Step 4: Output ranked opportunities
Sort all products across both platforms by opportunity score and print the top candidates.
def find_opportunities(niches: list[str]) -> list[dict]:
all_products = []
for niche in niches:
data = research_niche(niche)
for platform, products in data.items():
for p in products:
p["platform"] = platform
p["niche"] = niche
p["score"] = score_product(p)
all_products.append(p)
return sorted(all_products, key=lambda x: x["score"], reverse=True)[:20]Python Example
import os
import requests
from concurrent.futures import ThreadPoolExecutor
API_KEY = os.environ.get("SCAVIO_API_KEY", "your_scavio_api_key")
ENDPOINT = "https://api.scavio.dev/api/v1/search"
NICHES = ["portable blender", "posture corrector", "led strip lights"]
def search(platform: str, query: str) -> list[dict]:
r = requests.post(ENDPOINT, headers={"x-api-key": API_KEY},
json={"platform": platform, "query": query, "marketplace": "US"})
r.raise_for_status()
return r.json().get("products", [])[:10]
def score(p: dict) -> float:
price = float((p.get("price") or "0").replace("$", "").replace(",", "") or 0)
rating = float(p.get("rating") or 0)
if price < 10 or price > 200 or rating < 3.5:
return 0
return round(rating * min(int(p.get("reviews_count") or 0) / 500, 5), 2)
if __name__ == "__main__":
results = []
for niche in NICHES:
for platform in ["amazon", "walmart"]:
for p in search(platform, niche):
p["score"] = score(p)
p["src"] = platform
results.append(p)
for p in sorted(results, key=lambda x: x["score"], reverse=True)[:10]:
print(f"[{p['src']}] {p.get('title', '')[:50]} | {p.get('price')} | score: {p['score']}")JavaScript Example
const API_KEY = process.env.SCAVIO_API_KEY || "your_scavio_api_key";
const ENDPOINT = "https://api.scavio.dev/api/v1/search";
async function search(platform, query) {
const res = await fetch(ENDPOINT, {
method: "POST",
headers: { "x-api-key": API_KEY, "Content-Type": "application/json" },
body: JSON.stringify({ platform, query, marketplace: "US" })
});
const data = await res.json();
return (data.products || []).slice(0, 10);
}
async function main() {
const niches = ["portable blender", "posture corrector"];
const results = [];
for (const niche of niches) {
const [amazon, walmart] = await Promise.all([
search("amazon", niche), search("walmart", niche)
]);
amazon.forEach(p => results.push({ ...p, src: "amazon" }));
walmart.forEach(p => results.push({ ...p, src: "walmart" }));
}
results.forEach(p => {
const price = parseFloat((p.price || "0").replace(/[$,]/g, ""));
p.score = price > 10 && price < 100 ? parseFloat(p.rating || 0) * 2 : 0;
});
results.sort((a, b) => b.score - a.score).slice(0, 10)
.forEach(p => console.log(`[${p.src}] ${p.title?.slice(0, 50)} | ${p.price}`));
}
main().catch(console.error);Expected Output
[amazon] BlendJet 2 Portable Blender | $29.99 | score: 22.5
[walmart] Portable Blender USB Rechargeable | $19.99 | score: 18.0
[amazon] VOKKA Posture Corrector for Men and Women | $25.99 | score: 17.5
[amazon] Govee LED Strip Lights 50ft | $34.99 | score: 16.8