Shopify Spy
Product and collection scraper for Shopify, WooCommerce, Magento, BigCommerce, Squarespace and other stores, built for scripts and AI coding agents.

Shopify Spy is a command-line tool and Python library for scraping product and collection data from ecommerce stores. It supports Shopify, WooCommerce, Magento, BigCommerce, Squarespace and other stores out of the box, using the first four platforms' public JSON and GraphQL endpoints and, for Squarespace and any other store, the schema.org Product data (JSON-LD or microdata) on the product pages their sitemaps list or their links lead to, so it needs no API keys or store access. It's designed to be driven by AI agents as much as by people: coding agents such as Claude Code, Codex and GitHub Copilot, and personal agents such as Hermes and OpenClaw, or any agent that can run a shell command or a Python script.
Installation
# The command (spy and shopify-spy)
uv tool install shopify-spy
# The library, in a project
uv add shopify-spy # or: pip install shopify-spy
# Or run either once, nothing to install
uvx shopify-spy scrape --peek https://www.example.com
uv run --with 'shopify-spy>=0.7' python script.py
# Excel output (--format xlsx) needs the excel extra: install 'shopify-spy[excel]'
A uv tool install provides only the command, so import shopify_spy needs the library install. With uvx, name the package (uvx shopify-spy ...), since uvx spy would fetch an unrelated package. Python 3.11 or later is required. Installation covers pipx, inline script metadata and Nix.
Quick Start
Command line
# Scrape a store, detecting its platform (the default)
spy scrape https://www.example.com
# Name the platform to skip detection, here a WooCommerce store
spy scrape --platform woocommerce https://www.example.com
# Scrape a Magento store
spy scrape --platform magento https://www.example.com
# Scrape a BigCommerce store
spy scrape --platform bigcommerce https://www.example.com
# Scrape a Squarespace store, from its product pages (one request per product)
spy scrape --platform squarespace https://www.example.com --limit 100
# Any other store, from its product pages' schema.org data (one request per product)
spy scrape --platform generic https://www.example.com --limit 100
# Several stores of any platforms, with collections (Shopify only) and images
spy scrape https://store1.com https://store2.com --collections --images
# Sample 10 items
spy scrape https://www.example.com --limit 10
# Print one item to stdout, writing nothing, and pipe it to jq
spy scrape --peek https://www.example.com 2>/dev/null | jq '.product.title'
Results are saved as JSONL in ./output (change it with --output), with a live item counter while it runs. --format picks JSON, CSV, Excel (XLSX) or XML instead, and --schema unified gives one row per variant with the same columns on every platform. Command line lists every option and the config file, and Output describes what's written.
Python
The same engine is a library, so a script can scrape, filter and save in one pass. Install the library first (see Installation).
import shopify_spy as spy
# Items are plain dicts in their platform's shape (a Shopify store's here),
# yielded while the stores are scraped
for item in spy.scrape("https://www.example.com", max_items_per_store=100):
print(item["product"]["title"])
# Several stores to a file, then check which ones failed and why
run = spy.scrape(["store1.com", "store2.com"], on_failure="warn")
spy.write_items(run, "products.jsonl")
for store in run.result.failed:
print(store.input_url, store.status, store.hint)