ScavioScavio
ToolsPricingDocs
Sign InGet Started
  1. Home
  2. Tutorials
  3. How to Automate Product Research for Dropshipping with APIs
Tutorial

How to Automate Product Research for Dropshipping with APIs

Automate dropshipping product research by querying Amazon and Walmart via the Scavio API. Find profitable products by comparing prices, ratings, and demand signals.

Get Free API KeyAPI Docs

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.

Python
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.

Python
from concurrent.futures import ThreadPoolExecutor

# Scavio has one endpoint per platform - there is no dispatcher endpoint and no
# `platform` request param, so the selector lives in your code.
SCAVIO = "https://api.scavio.dev"
SCAVIO_ENDPOINTS = {
    "google": "/api/v2/google",
    "reddit": "/api/v1/reddit/search",
    "youtube": "/api/v1/youtube/search",
    "amazon": "/api/v1/amazon/search",
    "walmart": "/api/v1/walmart/search",
}
SCAVIO_QUERY_KEY = {"youtube": "search"}
SCAVIO_RESULTS_KEY = {"google": "organic_results", "reddit": "results",
                      "youtube": "results", "amazon": "products", "walmart": "products"}

def scavio_url(platform):
    return SCAVIO + SCAVIO_ENDPOINTS[platform or "google"]

def scavio_body(platform, query):
    return {SCAVIO_QUERY_KEY.get(platform or "google", "query"): query}

def scavio_payload(payload, platform="google"):
    """Google v2 passes Google's response through as-is; every other endpoint
    wraps its payload in `data`. Item fields differ per platform (see
    https://scavio.dev/docs), so only the result list is normalised here."""
    platform = platform or "google"
    out = payload if platform == "google" else payload["data"]
    return {**out, "results": out.get(SCAVIO_RESULTS_KEY[platform], [])}


H = {"Authorization": f"Bearer {API_KEY}"}

def search_platform(platform: str, query: str) -> list[dict]:
    # Amazon is its own endpoint and nests its rows under data.results.
    if platform == "amazon":
        r = requests.post(
            "https://api.scavio.dev/api/v1/amazon/search",
            headers=H,
            json={"query": query, "country": "us"}
        )
        r.raise_for_status()
        return r.json()["data"].get("products", [])[:10]
    r = requests.post(scavio_url(platform), headers=H, json=scavio_body(platform, query))
    r.raise_for_status()
    return scavio_payload(r.json(), platform).get("results", [])[: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.

Python
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.

Python
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

Python
import os
import requests
from concurrent.futures import ThreadPoolExecutor

# Scavio has one endpoint per platform - there is no dispatcher endpoint and no
# `platform` request param, so the selector lives in your code.
SCAVIO = "https://api.scavio.dev"
SCAVIO_ENDPOINTS = {
    "google": "/api/v2/google",
    "reddit": "/api/v1/reddit/search",
    "youtube": "/api/v1/youtube/search",
    "amazon": "/api/v1/amazon/search",
    "walmart": "/api/v1/walmart/search",
}
SCAVIO_QUERY_KEY = {"youtube": "search"}
SCAVIO_RESULTS_KEY = {"google": "organic_results", "reddit": "results",
                      "youtube": "results", "amazon": "products", "walmart": "products"}

def scavio_url(platform):
    return SCAVIO + SCAVIO_ENDPOINTS[platform or "google"]

def scavio_body(platform, query):
    return {SCAVIO_QUERY_KEY.get(platform or "google", "query"): query}

def scavio_payload(payload, platform="google"):
    """Google v2 passes Google's response through as-is; every other endpoint
    wraps its payload in `data`. Item fields differ per platform (see
    https://scavio.dev/docs), so only the result list is normalised here."""
    platform = platform or "google"
    out = payload if platform == "google" else payload["data"]
    return {**out, "results": out.get(SCAVIO_RESULTS_KEY[platform], [])}


API_KEY = os.environ.get("SCAVIO_API_KEY", "your_scavio_api_key")
NICHES = ["portable blender", "posture corrector", "led strip lights"]

H = {"Authorization": f"Bearer {API_KEY}"}

def search(platform: str, query: str) -> list[dict]:
    # Amazon is its own endpoint and nests its rows under data.results.
    if platform == "amazon":
        r = requests.post("https://api.scavio.dev/api/v1/amazon/search", headers=H,
                          json={"query": query, "country": "us"})
        r.raise_for_status()
        return r.json()["data"].get("products", [])[:10]
    r = requests.post(scavio_url(platform), headers=H, json=scavio_body(platform, query))
    r.raise_for_status()
    return scavio_payload(r.json(), platform).get("results", [])[:10]

def score(p: dict) -> float:
    # Amazon prices are numbers; Walmart may still send a display string.
    price = float(str(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

JavaScript
const API_KEY = process.env.SCAVIO_API_KEY || "your_scavio_api_key";
const WALMART_WALMART_ENDPOINT = "https://api.scavio.dev/api/v1/walmart/search";

const H = { Authorization: `Bearer ${API_KEY}`, "Content-Type": "application/json" };

async function search(platform, query) {
  // Amazon is its own endpoint and nests its rows under data.products.
  const isAmazon = platform === "amazon";
  const res = await fetch(isAmazon ? "https://api.scavio.dev/api/v1/amazon/search" : WALMART_ENDPOINT, {
    method: "POST",
    headers: H,
    body: JSON.stringify(isAmazon ? { query, country: "us" } : { platform, query })
  });
  const body = await res.json();
  const rows = isAmazon ? body.data?.products : body.products;
  return (rows || []).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 => {
    // Amazon prices are numbers; Walmart may still send a display string.
    const price = parseFloat(String(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

JSON
[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

Related Tutorials

    Frequently Asked Questions

    Most developers complete this tutorial in 15 to 30 minutes. You will need a Scavio API key (free tier works) and a working Python or JavaScript environment.

    Python 3.10 or higher. requests library installed. A Scavio API key. A list of product niches to research. A Scavio API key gives you 50 free credits on signup.

    Yes. The free tier includes 50 credits on signup, which is more than enough to complete this tutorial and prototype a working solution.

    Scavio has a native LangChain package (langchain-scavio), an MCP server, and a plain REST API that works with any HTTP client. This tutorial uses the raw REST API, but you can adapt to your framework of choice.

    Related Resources

    Best Of

    Best Dropshipping Research APIs for Product Discovery (2026)

    Read more
    Best Of

    Best API for Dropshipping Product Research in 2026

    Read more
    Use Case

    Walmart Seller Product Intelligence

    Read more
    Use Case

    Dropship Product Research via API

    Read more
    Glossary

    Walmart Product Data API Landscape (2026)

    Read more
    Solution

    Product Validation via Search APIs

    Read more

    Start Building

    Automate dropshipping product research by querying Amazon and Walmart via the Scavio API. Find profitable products by comparing prices, ratings, and demand signals.

    Get Free API KeyRead the Docs
    ScavioScavio

    One scraper API for every social, search and ecommerce platform. Built for AI agents.

    Product

    • Features
    • Pricing
    • Dashboard
    • Affiliates

    Developers

    • Documentation
    • API Reference
    • Quickstart
    • MCP Integration
    • Python SDK

    Alternatives

    • Tavily Alternative
    • SerpAPI Alternative
    • Firecrawl Alternative
    • Exa Alternative
    • Serper Alternative
    • Tavily vs Scavio
    • SerpAPI vs Scavio
    • All alternatives
    • Compare Scavio vs alternatives

    Search APIs

    • Google Search API
    • Amazon Product API
    • YouTube API
    • Reddit API
    • Walmart Product API
    • TikTok API
    • Instagram API

    Tools

    • All Tools

    © 2026 Scavio. All rights reserved.

    Featured on TAAFT
    Terms of ServicePrivacy Policy