How to Get WooCommerce Product Data via API
March 6, 2026 · 6 min read
WooCommerce powers over 6 million online stores — more than any other e-commerce platform. Whether you're building a price comparison app, monitoring competitors, or feeding data into an AI pipeline, you need a reliable way to extract WooCommerce product data.
The challenge: WooCommerce's REST API requires admin credentials. For your own store, that's fine. For competitor stores or third-party data, you need a different approach.
Option 1: WooCommerce REST API (Your Own Store)
If you're extracting from a store you own, use the official REST API:
curl https://yourstore.com/wp-json/wc/v3/products -u consumer_key:consumer_secret
# Returns paginated JSON with all products
# Max 100 per page, use ?page=2 for moreThis works well but requires generating API credentials in WooCommerce → Settings → Advanced → REST API. You cannot use this for stores you don't own.
Option 2: ShelfRun API (Any Public WooCommerce Store)
ShelfRun detects WooCommerce automatically and extracts product data from the store's public endpoints — no admin credentials needed. This works on any public WooCommerce store.
from shelfrun import ShelfRun
sr = ShelfRun(api_key="sr_live_your_key")
# Detect platform and get all products
result = sr.quickscan("woocommerce-store.com")
print(f"Platform: {result['platform']}") # "woocommerce"
print(f"Products: {result['products_found']}")
for product in result['products'][:10]:
print(product['name'] + ": $" + str(product['price']))What You Get from WooCommerce Stores
ShelfRun's WooCommerce extractor returns standardized JSON for every product:
{
"platform": "woocommerce",
"products_found": 312,
"products": [
{
"name": "Organic Cotton T-Shirt",
"price": 29.99,
"compare_at_price": 39.99,
"currency": "USD",
"in_stock": true,
"stock_quantity": 45,
"sku": "OCT-BLK-M",
"categories": ["Clothing", "T-Shirts"],
"image_url": "https://...",
"product_url": "https://...",
"variants": [
{"name": "Size", "options": ["S", "M", "L", "XL"]},
{"name": "Color", "options": ["Black", "White", "Navy"]}
]
}
]
}Handling Pagination
Large WooCommerce stores can have thousands of products. ShelfRun handles pagination automatically:
# ShelfRun automatically paginates through all products
result = sr.quickscan("large-store.com")
# All products are returned, regardless of catalog size
print(f"Total products: {len(result['products'])}")Set Up Ongoing Monitoring
For continuous price tracking, add the store to ShelfRun's monitoring:
import requests
# Add store with daily sync
response = requests.post(
"https://api.shelfrun.com/v1/stores",
headers={"X-API-Key": "sr_live_..."},
json={
"url": "woocommerce-store.com",
"sync_frequency": "daily",
"webhook_url": "https://yourapp.com/webhook"
}
)
store_id = response.json()["store_id"]
print(f"Monitoring store: {store_id}")Filter by Category or Price Range
Once you have products, filter them in Python:
# Get all products under $50 that are in stock
affordable = [
p for p in result["products"]
if p["price"] < 50 and p["in_stock"]
]
# Get products in a specific category
clothing = [
p for p in result["products"]
if "Clothing" in p.get("categories", [])
]
print(f"Affordable items: {len(affordable)}")
print(f"Clothing items: {len(clothing)}")WooCommerce vs Shopify: What's Different?
ShelfRun normalizes data across platforms, but there are some WooCommerce-specific features worth knowing:
- Variable products: WooCommerce uses variable products for size/color variants — ShelfRun returns all variant combinations
- Stock management: Per-variation stock is common in WooCommerce; ShelfRun reports it at both product and variant level
- Custom fields: WooCommerce stores often use ACF or custom meta — ShelfRun includes these in the
metadatafield when available