Skip to main content

Scrape any Shopify store - products, collections, pages, metadata & reviews from the public JSON API. SDK + CLI + REST API.

Project description

shopscout

PyPI Python License Downloads

Scrape any Shopify store - products, collections, pages & metadata from the public JSON API. No API key required.

Three interfaces: Python SDK, CLI, and REST API.

Installation

# Core SDK only
pip install shopscout

# With CLI (click + rich tables)
pip install shopscout[cli]

# With REST API (FastAPI + uvicorn)
pip install shopscout[api]

# Everything
pip install shopscout[all]

Quick Start

from shopscout import Shopify

shop = Shopify('spharetech.com')

# Store metadata
store = shop.store()
print(store.name, store.currency)

# All products (auto-paginated)
products = shop.products()
for p in products:
    print(p.title, p.price, p.available)

# All collections
collections = shop.collections()
for c in collections:
    print(c.title, c.products_count)

# Products in a specific collection
power_banks = shop.collection_products('power-banks')

# Single product
product = shop.product('66w-transparent-power-bank-20000mah')

# Pages
pages = shop.pages()

Pagination

Fetch everything at once or paginate manually — your choice.

shop = Shopify('spharetech.com')

# Auto-paginate: fetches ALL products in one call
all_products = shop.products()

# Manual pagination: fetch one page at a time
page1 = shop.products_page(page=1, limit=30)
page2 = shop.products_page(page=2, limit=30)

# Same for collection products
all_power_banks = shop.collection_products('power-banks')
first_page = shop.collection_products_page('power-banks', page=1, limit=10)

Exporting

from shopscout import Exporter, Shopify

shop = Shopify('spharetech.com')
products = shop.products()

exporter = Exporter(output_dir='output')
exporter.products_to_json(products)
exporter.products_to_csv(products)

Proxy Support

shop = Shopify('store.com', proxy='http://user:pass@host:port')

CLI

# Scrape products
shopscout products spharetech.com
shopscout products spharetech.com --collection power-banks
shopscout products spharetech.com --json
shopscout products spharetech.com --save products.csv

# Scrape collections
shopscout collections spharetech.com

# Store metadata
shopscout store spharetech.com

# With proxy
shopscout --proxy http://host:port products spharetech.com

REST API

# Start the API server
shopscout serve
shopscout serve --port 3000

Endpoints

Method Endpoint Description
GET /api/v1/products?domain=store.com All products
GET /api/v1/products?domain=store.com&collection=power-banks Collection products
GET /api/v1/products/{handle}?domain=store.com Single product
GET /api/v1/collections?domain=store.com All collections
GET /api/v1/store?domain=store.com Store metadata
GET /api/v1/pages?domain=store.com All pages
GET /health Health check

Interactive docs at http://localhost:8000/docs

Error Handling

from shopscout import Shopify, StoreNotFoundError, ProductNotFoundError

shop = Shopify('not-a-shopify-store.com')
try:
    store = shop.store()
except StoreNotFoundError:
    print('Not a Shopify store')

try:
    product = shop.product('nonexistent')
except ProductNotFoundError:
    print('Product not found')

Exception Hierarchy

ShopifyError
├── StoreNotFoundError
├── ProductNotFoundError
├── CollectionNotFoundError
├── PageNotFoundError
├── RateLimitError
├── RequestError
└── ParsingError

Data Models

Model Description
Store Store metadata (name, currency, counts)
Product Product with variants, images, options
Variant Pricing, stock, SKU, weight
ProductImage Image URL with dimensions
ProductOption Option name and values
Collection Collection with image and product count
Page Static page content

All models have a .to_dict() method for serialization.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shopscout-0.2.2.tar.gz (18.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shopscout-0.2.2-py3-none-any.whl (24.0 kB view details)

Uploaded Python 3

File details

Details for the file shopscout-0.2.2.tar.gz.

File metadata

  • Download URL: shopscout-0.2.2.tar.gz
  • Upload date:
  • Size: 18.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for shopscout-0.2.2.tar.gz
Algorithm Hash digest
SHA256 9924c2f5083add6890e72b05bb6ab68822472c48b143c8568077286aaa7a03f5
MD5 93e7af5bb57521661988b1d9bc69238a
BLAKE2b-256 ff14539cd5ce9b374ba97e0e1e6dff903d500d4b1d1b6d98e521ac3a82d4d730

See more details on using hashes here.

Provenance

The following attestation bundles were made for shopscout-0.2.2.tar.gz:

Publisher: publish.yml on zaidkx37/shopscout

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file shopscout-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: shopscout-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 24.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for shopscout-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2ab3c2e4f7465c7a4a11c3b9d6f75d5326d7e516ad7497c2edbae4639846b99d
MD5 ded561d53b162010d80e3d26815ffaca
BLAKE2b-256 1511e937f546a98864a80a6ce5233e646dcb1107bd5db38aa40cfbc5fbf4d42b

See more details on using hashes here.

Provenance

The following attestation bundles were made for shopscout-0.2.2-py3-none-any.whl:

Publisher: publish.yml on zaidkx37/shopscout

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page