# Shopify Product Scraper (`scrape_pad/shopify-products-scraper`) Actor

- **URL**: https://apify.com/scrape\_pad/shopify-products-scraper.md
- **Developed by:** [Scrape pad](https://apify.com/scrape_pad) (community)
- **Stats:** 2 total users, 1 monthly users, 81.8% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.60 / 1,000 product scrapeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Shopify Universal Scraper

An [Apify Actor](https://apify.com/actors) that scrapes **any Shopify store's entire product catalog** — including stores with 12,500+ products.

### Features

- **Full catalog extraction** — Automatically paginates through `/products.json` and reconciles with XML sitemaps for stores exceeding Shopify's 12,500-product pagination ceiling.
- **Rich product data** — Extracts titles, descriptions (HTML + plain text), images, variants, pricing, stock status, tags, options, weight, and more.
- **Anti-bot bypass** — Uses `curl_cffi` with browser impersonation to bypass Shopify's bot detection.
- **Proxy support** — Works with Apify Proxy (residential, datacenter) or your own custom proxy URL.
- **Batch output** — Pushes results to an Apify Dataset in batches for efficient streaming.

### Input

| Field | Type | Required | Default | Description |
|-------|------|----------|---------|-------------|
| `domain` | string | ✅ | — | Shopify store domain (e.g. `gymshark.com`) |
| `maxProducts` | integer | ❌ | `0` | Max products to scrape (`0` = all) |
| `proxy` | object | ❌ | Apify Proxy | Apify proxy configuration |
| `customProxyUrl` | string | ❌ | — | Custom proxy URL (overrides Apify Proxy) |
| `concurrency` | integer | ❌ | `10` | Concurrent requests for sitemap reconciliation |
| `impersonate` | string | ❌ | `chrome120` | Browser to impersonate via curl\_cffi |

#### Example Input

```json
{
    "domain": "gymshark.com",
    "maxProducts": 100,
    "proxy": {
        "useApifyProxy": true
    },
    "concurrency": 10,
    "impersonate": "chrome120"
}
```

### Output

Each product in the dataset has this structure:

```json
{
    "store": "gymshark.com",
    "productId": 123456789,
    "handle": "speed-t-shirt",
    "vendor": "Gymshark",
    "title": "Speed T-Shirt",
    "url": "https://gymshark.com/products/speed-t-shirt",
    "featuredImage": "https://cdn.shopify.com/...",
    "imageUrls": ["..."],
    "imageCount": 5,
    "currency": "USD",
    "priceMin": 30.0,
    "priceMax": 35.0,
    "compareAtPrice": 40.0,
    "onSale": true,
    "available": true,
    "fullyOutOfStock": false,
    "variantCount": 12,
    "variants": [{ "..." }],
    "options": ["Size", "Color"],
    "productOptions": [{ "..." }],
    "productType": "T-Shirts",
    "tags": ["new-arrivals", "men"],
    "description": "Lightweight training tee...",
    "descriptionHtml": "<p>Lightweight training tee...</p>",
    "createdAt": "2024-01-15T10:00:00Z",
    "publishedAt": "2024-01-15T10:00:00Z",
    "updatedAt": "2024-06-01T08:30:00Z"
}
```

A **summary** is also saved to the default Key-Value Store under the key `SUMMARY`:

```json
{
    "store": "gymshark.com",
    "totalProducts": 1842,
    "maxProductsRequested": 0,
    "proxyUsed": true,
    "paginationCapHit": false
}
```

### How It Works

1. **Phase 1 — Bulk Pagination**: Fetches products from `/products.json?limit=250&page=N` up to page 50 (Shopify's hard limit of 12,500 products).
2. **Phase 2 — Sitemap Reconciliation** *(only if Phase 1 hits the cap)*: Parses the store's XML sitemaps to discover all product handles, then fetches any products missed by pagination via individual `/products/{handle}.json` requests.

### Local Development

The original `shopify.py` script is preserved for local development and testing:

```bash
pip install -r requirements.txt
python shopify.py
```

### Deployment

```bash
## Install the Apify CLI
npm install -g apify-cli

## Login to your Apify account
apify login

## Deploy the actor
apify push
```

### License

ISC

# Actor input Schema

## `domain` (type: `string`):

The Shopify store domain to scrape (e.g. gymshark.com, deathwishcoffee.com). Do not include https:// prefix.

## `maxProducts` (type: `integer`):

Maximum number of products to scrape. Set to 0 to scrape the entire catalog.

## `proxyGatewayUrl` (type: `string`):

Base residential proxy gateway URL. The scraper auto-injects a random session ID for per-request IP rotation. Example: http://user-package-standard-country-us:password@proxy.example.com:8989

## `concurrency` (type: `integer`):

Number of concurrent requests during sitemap reconciliation (Phase 2). Only relevant for stores with 12,500+ products.

## `impersonate` (type: `string`):

Browser profile to impersonate via curl\_cffi for anti-bot bypass.

## Actor input object example

```json
{
  "domain": "gymshark.com",
  "concurrency": 10,
  "impersonate": "chrome120"
}
```

# Actor output Schema

## `productCatalog` (type: `string`):

All scraped products with full variant, image, pricing, and availability data.

## `runSummary` (type: `string`):

High-level summary including store name, total products, proxy usage, and whether the pagination cap was hit.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "domain": "gymshark.com",
    "maxProducts": 0
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrape_pad/shopify-products-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "domain": "gymshark.com",
    "maxProducts": 0,
}

# Run the Actor and wait for it to finish
run = client.actor("scrape_pad/shopify-products-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "domain": "gymshark.com",
  "maxProducts": 0
}' |
apify call scrape_pad/shopify-products-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,scrape_pad/shopify-products-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/eC2DcZuanabkAkD8I/builds/6LHUlJSBDmRrVaI0g/openapi.json
