# Advanced StockX Scraper (`morkerr/advanced-stockx-scraper`) Actor

Extracts StockX's full category navigation tree and outputs it as a portable JSON database. Uses Playwright to browse stockx.com, hover over navigation menus, and parse all categories, subcategories, and leaf URLs. The output can be used as input for the StockX Scraper Chrome Extension.

- **URL**: https://apify.com/morkerr/advanced-stockx-scraper.md
- **Developed by:** [morkerr](https://apify.com/morkerr) (community)
- **Categories:** Automation, Developer tools, Integrations
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 results

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Advanced StockX Scraper - Chrome Extension



> \*\*Automatically extract StockX's full category tree\*\* — every product category, subcategory, brand group, and leaf URL — and export it as a portable JSON database.

This actor crawls `stockx.com` using **Playwright (Chromium)**, hovers over the main navigation to reveal all flyout menus, and parses every category link exactly as the [StockX Scraper Chrome Extension](https://chromewebstore.google.com/) does internally. The output is a structured, versioned category database you can feed directly into the **Advanced StockX Scraper** actor — or use as standalone market intelligence.

\---

### What You Get

|Metric|What It Means|
|-|-|
|**L1 Categories**|Top-level departments (Sneakers, Shoes, Apparel, Collectibles, Electronics, Trading Cards, etc.)|
|**L2 Subcategory Groups**|Brand collections, Shop By Gender, Shop By Activity, price tiers, and more|
|**L3 Leaf URLs**|Direct, scrape-ready category URLs with product feeds (e.g. `https://stockx.com/category/sneakers?gender=men`)|
|**Versioned JSON**|Full v2 tree structure compatible with the Advanced StockX Scraper's input schema|

\---

### Why Use This Actor?

|Need|How This Helps|
|-|-|
|**You run the Advanced StockX Scraper on Apify**|The bundled `category\_db.json` may be stale. Run this actor first to get the freshest category tree, then feed it into your scraper.|
|**You need category-level market intelligence**|Get every category URL StockX offers — discover which brands, product types, and subcategories exist without manual browsing.|
|**You want to monitor category structure changes**|Run periodically. StockX reorganises its navigation often. A fresh DB means your scrape targets never go stale.|
|**You are building a StockX data pipeline**|Use the exported JSON to programme your own scrape orchestration, feed it into a database, or power a dashboard.|

\---

### How It Works

1. **Launch** — Playwright opens `https://stockx.com/` in a headless Chromium browser (1920×1080 viewport)
2. **Wait** — Waits for the `data-testid="MainNavigation"` element to render (handles Cloudflare if it appears)
3. **Hover \& Reveal** — Injects mouseover/pointerover events on every navigation switcher `<li>`, exactly as the Chrome extension does, triggering StockX's flyout menus
4. **Parse** — Runs the same `extractAll()`/`parseSubNavigationFlyout()`/`parseAllNavMegaMenu()` JavaScript that powers the extension — no heuristic scraping, no fragile selectors
5. **Export** — Outputs a versioned `category\_db.json` to the Apify key-value store, plus a flattened dataset with `id`, `label`, `path`, `url`, and `level` for every node

\---

### Output Example

```json
{
  "exportedAt": "2026-07-25T22:30:00.000Z",
  "generator": "StockX Category DB Extractor",
  "version": 2,
  "counts": { "categories": 15, "subcategories": 120, "leaves": 3400 },
  "categories": \[
    {
      "id": "sneakers",
      "label": "Sneakers",
      "url": "https://stockx.com/category/sneakers",
      "children": \[
        {
          "id": "shop-by-gender",
          "label": "Shop By Gender",
          "url": "",
          "children": \[
            { "id": "men", "label": "Men", "url": "https://stockx.com/category/sneakers?gender=men", "children": \[] },
            { "id": "women", "label": "Women", "url": "https://stockx.com/category/sneakers?gender=women", "children": \[] }
          ]
        }
      ]
    }
  ]
}
````

\---

### Upgrade to the Full StockX Scraper — Chrome Extension

This actor gives you the **category database** — but the real power is the **StockX Scraper Chrome Extension**, which uses the exact same extraction engine and then lets you **scrape every product** behind those category URLs.

#### What the Extension Does That This Actor Doesn't

- **One-click DB build** — Open StockX in your browser, click "Build / Refresh DB" in the popup, and the entire category tree is captured instantly. No headless browser, no Docker, no setup.
- **Visual category selection** — Search and pick categories from a tree-based dropdown with cascading select-all. Free plan: up to 5 targets. **Pro plan**: unlimited.
- **Full product scraping engine** — Feed selected categories, pasted URLs, or keyword searches. Scrapes listing data (name, brand, price, image) from `\_\_NEXT\_DATA\_\_` with DOM fallback.
- **Deep scrape (detail pages)** — Visits each product's PDP for full enrichment: lowest ask, highest bid, last sale, sales volume, retail price, release date, colorway, description, style ID, GTIN.
- **Cloudflare auto-resolution** — The extension detects challenges, shows the tab, and waits for the user to solve it (or auto-solves with a recorded click position via ALT+Click).
- **CSV / JSON export** — Download results with a single click. CSV comes with BOM for Excel compatibility.
- **Image download (Pro)** — Saves product images directly to your `Downloads/StockX\_Images/` folder during deep scrape.
- **Keyword search** — Type a keyword and the extension navigates StockX's search results, paginates, and scrapes everything.
- **Positive / negative filters** — Include or exclude products by title text.
- **Persistent state** — Your category database, target selection, scrape results, and Cloudflare settings survive browser restarts.
- **No server, no API keys, no monthly fees** — Runs entirely in your browser on your machine. Data never leaves your computer unless you export it.
- **Free tier available** — Full DB build, export, import, and up to 5 selected targets at no cost.
- **Pro tier** — Unlimited target selection + image download. License key at [morkerr.com](https://morkerr.com/).

####

#### Why Start Here and Move to the Extension?

```
┌──────────────────────────────────────────────┐
│  1. Run this Apify Actor → Get category\_db   │
│  2. Import it into the Extension (Import DB) │
│  3. Visually select targets, scrape products │
│  4. Export CSV/JSON — zero coding required    │
└──────────────────────────────────────────────┘
```

Or skip straight to the extension if you prefer a GUI. The extraction engine is **identical** — the same JavaScript runs in both.

\---

### Input Parameters

|Field|Type|Default|Description|
|-|-|-|-|
|`headless`|boolean|`true`|Run browser in headless mode. Set to `false` to watch the crawl visually.|
|`outputFormat`|string|`"json"`|Output format (currently JSON only).|

\---

### Output Storage

|Store|Content|
|-|-|
|**Dataset**|Flattened category tree — one row per node with `id`, `label`, `path`, `url`, `level`|
|**Key-value store**|`category\_db.json` — full versioned tree (compatible with Advanced StockX Scraper input)|
|**Key-value store**|`OUTPUT` — same full tree, convenience key|

\---

### Use Cases

#### E-Commerce Research

Map StockX's entire product taxonomy without manual browsing. Discover which brands have dedicated category pages, which product types exist under each department, and how StockX organises its 3,400+ leaf categories.

#### Scraper Pipeline Automation

Run this actor daily/weekly via Apify scheduler. Feed the fresh `category\_db.json` into the **Advanced StockX Scraper** actor to ensure your product scrape always uses the latest category structure. No stale URLs, no broken targets.

#### Competitive Analysis

Track how StockX's category structure evolves over time. New brand pages, new product type categories, new activity groupings — capture every change as part of your market monitoring.

#### Data Integration

The output JSON is clean, versioned, and self-documenting. Import it into your own database, feed it into an analytics pipeline, or use it to build a custom StockX data dashboard.

\---

### Pro Tip — Keep Your DB Fresh

StockX updates its navigation regularly — new brands appear, categories get reorganised, sale sections change. Run this actor weekly to keep your category database current. A stale DB means the **Advanced StockX Scraper** might miss targets or scrape empty pages.

\---

### Links

- **Pro License** — <https://morkerr.com/stockx-scraper>
- **Advanced StockX Scraper Actor** — The full product scraper that consumes this category DB
- **Extension Guide** — [`https://morkerr.com/stockx-scraper-docs`](https://morkerr.com/stockx-scraper-docs)

\---

*Built for personal research and competitive intelligence. Respect StockX's Terms of Service and robots.txt. Data is extracted from publicly available navigation elements — no authentication required.*

# Actor input Schema

## `outputFormat` (type: `string`):

Choose the output format for the category database. JSON includes the full tree structure. CSV provides a flat table with one row per category node.

## Actor input object example

```json
{
  "outputFormat": "json"
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

## `categoryDb` (type: `string`):

Full category tree JSON file stored in key-value store

## `csv` (type: `string`):

Flattened category table stored in key-value store

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("morkerr/advanced-stockx-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("morkerr/advanced-stockx-scraper").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{}' |
apify call morkerr/advanced-stockx-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=morkerr/advanced-stockx-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Advanced StockX Scraper",
        "description": "Extracts StockX's full category navigation tree and outputs it as a portable JSON database. Uses Playwright to browse stockx.com, hover over navigation menus, and parse all categories, subcategories, and leaf URLs. The output can be used as input for the StockX Scraper Chrome Extension.",
        "version": "1.0",
        "x-build-id": "eF3K3q2cO2x7YF9Iw"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/morkerr~advanced-stockx-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-morkerr-advanced-stockx-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/morkerr~advanced-stockx-scraper/runs": {
            "post": {
                "operationId": "runs-sync-morkerr-advanced-stockx-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/morkerr~advanced-stockx-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-morkerr-advanced-stockx-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "outputFormat": {
                        "title": "Output Format",
                        "enum": [
                            "json",
                            "csv"
                        ],
                        "type": "string",
                        "description": "Choose the output format for the category database. JSON includes the full tree structure. CSV provides a flat table with one row per category node.",
                        "default": "json"
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
