Walmart Marketplace research is harder than Amazon because fewer tools support it. This tutorial builds a research pipeline that searches Walmart products, tracks pricing, identifies top sellers, and spots gaps in product coverage. Each query costs $0.005 through the Scavio API's Walmart platform search.
Prerequisites
- Python 3.8+
- requests library
- A Scavio API key from scavio.dev
- Product categories to research
Walkthrough
Step 1: Search Walmart products by category
Query Walmart product listings and extract structured data.
import os, requests, json
from datetime import datetime
from collections import Counter, defaultdict
API_KEY = os.environ['SCAVIO_API_KEY']
SH = {'x-api-key': API_KEY, 'Content-Type': 'application/json'}
def search_walmart(query):
data = requests.post('https://api.scavio.dev/api/v1/search',
headers=SH, json={'query': query, 'platform': 'walmart', 'country_code': 'us'}, timeout=10).json()
products = []
for r in data.get('organic_results', []):
products.append({
'title': r.get('title', ''),
'link': r.get('link', ''),
'price': r.get('price', r.get('extracted_price', '')),
'rating': r.get('rating', ''),
'seller': r.get('source', r.get('displayed_link', '')),
'position': r.get('position', 0),
})
return products
CATEGORIES = [
'organic protein powder',
'wireless security camera outdoor',
'kids educational tablet',
]
all_products = {}
for cat in CATEGORIES:
products = search_walmart(cat)
all_products[cat] = products
print(f'\n{cat}: {len(products)} products')
for p in products[:3]:
print(f' #{p["position"]} {p["title"][:45]}')
print(f' Price: {p["price"]} | Seller: {p["seller"][:25]}')
print(f'\nCost: ${len(CATEGORIES) * 0.005:.3f}')Step 2: Analyze seller landscape
Identify top sellers, price ranges, and market positioning.
def analyze_category(category, products):
if not products:
return
sellers = Counter(p['seller'] for p in products if p['seller'])
prices = []
for p in products:
try:
price = float(str(p['price']).replace('$', '').replace(',', '').split('-')[0].strip())
prices.append(price)
except (ValueError, IndexError):
pass
print(f'\n=== {category} ===')
print(f' Products found: {len(products)}')
if prices:
print(f' Price range: ${min(prices):.2f} - ${max(prices):.2f}')
print(f' Avg price: ${sum(prices)/len(prices):.2f}')
print(f' Median price: ${sorted(prices)[len(prices)//2]:.2f}')
print(f' Top sellers:')
for seller, count in sellers.most_common(5):
print(f' {seller[:30]:30} | {count} products')
# Price tiers
if prices:
budget = sum(1 for p in prices if p < sum(prices)/len(prices) * 0.7)
mid = sum(1 for p in prices if sum(prices)/len(prices) * 0.7 <= p <= sum(prices)/len(prices) * 1.3)
premium = sum(1 for p in prices if p > sum(prices)/len(prices) * 1.3)
print(f' Price tiers: Budget {budget} | Mid {mid} | Premium {premium}')
for cat, products in all_products.items():
analyze_category(cat, products)Step 3: Find product gaps and opportunities
Compare Walmart results with Amazon to find underserved categories.
def find_gaps(categories):
print(f'\n=== Walmart vs Amazon Gap Analysis ===')
for cat in categories:
walmart = search_walmart(cat)
amazon_data = requests.post('https://api.scavio.dev/api/v1/search',
headers=SH, json={'query': cat, 'platform': 'amazon', 'country_code': 'us'}, timeout=10).json()
amazon = amazon_data.get('organic_results', [])
wm_count = len(walmart)
am_count = len(amazon)
print(f'\n {cat[:40]}')
print(f' Walmart: {wm_count} results | Amazon: {am_count} results')
if wm_count < am_count:
print(f' GAP: Walmart has fewer options. Opportunity for sellers.')
elif wm_count > am_count:
print(f' Walmart has more competition than Amazon.')
else:
print(f' Similar competition levels.')
print(f'\n Total cost: ${len(categories) * 2 * 0.005:.3f} (Walmart + Amazon per category)')
print(f' Monthly (daily scans): ${len(categories) * 2 * 0.005 * 30:.2f}')
find_gaps(CATEGORIES)Python Example
import os, requests
SH = {'x-api-key': os.environ['SCAVIO_API_KEY'], 'Content-Type': 'application/json'}
def walmart_search(query):
data = requests.post('https://api.scavio.dev/api/v1/search',
headers=SH, json={'query': query, 'platform': 'walmart', 'country_code': 'us'}, timeout=10).json()
for r in data.get('organic_results', [])[:3]:
print(f'{r.get("title", "")[:45]} | {r.get("price", "N/A")}')
walmart_search('organic protein powder')
print('Cost: $0.005')JavaScript Example
const SH = { 'x-api-key': process.env.SCAVIO_API_KEY, 'Content-Type': 'application/json' };
const data = await fetch('https://api.scavio.dev/api/v1/search', {
method: 'POST', headers: SH,
body: JSON.stringify({ query: 'organic protein powder', platform: 'walmart', country_code: 'us' })
}).then(r => r.json());
(data.organic_results || []).slice(0, 3).forEach(r => {
console.log(`${r.title?.slice(0, 45)} | ${r.price || 'N/A'}`);
});Expected Output
organic protein powder: 10 products
#1 Orgain Organic Plant Based Protein Powder
Price: $27.98 | Seller: walmart.com
#2 Garden of Life Raw Organic Protein
Price: $32.49 | Seller: walmart.com
=== organic protein powder ===
Products found: 10
Price range: $18.99 - $54.99
Avg price: $31.50
Top sellers:
walmart.com | 6 products
amazon.com | 2 products
=== Walmart vs Amazon Gap Analysis ===
organic protein powder
Walmart: 10 results | Amazon: 10 results
Total cost: $0.030