A lightweight Python tool to export your Shopify store’s products with all image URLs into a CSV.
Perfect for backups, analysis, or migrating content.
- Fetches all products with pagination
- Extracts every image per product (not just the featured image)
- Outputs a clean CSV you can open in Excel/Google Sheets
- Basic error handling and retries for transient network/rate-limit issues
- Python 3.9+
- A Shopify Admin API access token
- Your store’s
myshopify.comdomain (e.g.,example-store.myshopify.com)
pip install requests python-dotenv urllib3Create a .env file in the project root:
SHOPIFY_SHOP=your-store.myshopify.com
SHOPIFY_ACCESS_TOKEN=shpat_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
SHOPIFY_API_VERSION=2024-07python export_products.pyWhen it finishes, you’ll get products_with_all_images.csv next to the script.
Columns:
handletitleimage_urls— all image URLs joined by;
Example row:
my-product-handle, "Premium Seat Cover", "https://cdn.shopify.com/s/files/.../1.jpg;https://cdn.shopify.com/s/files/.../2.jpg"
- Change API version in
.envviaSHOPIFY_API_VERSION. - For large stores, consider adding small delays between requests to avoid rate limits.
.envis included in.gitignore(do not commit it).- If you previously committed a token:
- Remove it from the code and commit
- (If needed) scrub history (e.g.,
git filter-repo) - Revoke the exposed token in Shopify and create a new one
Create a tiny test.py that loads .env and hits a simple Shopify endpoint to verify your credentials. Keep the token only in environment variables.
- Filters (by publish status, tags, collections)
- JSON output alongside CSV
- CLI with
argparseand more flags - Dockerfile for reproducible runs
Made with ❤️ to make Shopify exports painless.