La investigación de Walmart Marketplace es más difícil que la de Amazon porque hay menos herramientas que la respalden. Este tutorial crea un proceso de investigación que busca productos de Walmart, rastrea precios, identifica a los más vendidos y detecta brechas en la cobertura de productos. Cada consulta cuesta $0,005 a través de la búsqueda en la plataforma Walmart de la API de Scavio.
Requisitos previos
- Python 3.8+
- solicita biblioteca
- Una clave API de Scavio de scavio.dev
- Categorías de productos para investigar
Guia paso a paso
Paso 1: Buscar productos Walmart por categoría
Consulta listados de productos de Walmart y extrae datos estructurados.
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}')Paso 2: Analizar el panorama de vendedores
Identifique los mejores vendedores, rangos de precios y posicionamiento en el mercado.
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)Paso 3: Encuentre brechas y oportunidades de productos
Compare los resultados de Walmart con los de Amazon para encontrar categorías desatendidas.
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)Ejemplo en Python
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')Ejemplo en JavaScript
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'}`);
});Salida esperada
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