# StockX Portfolio Spread-Movers Index (`xtracto/stockx-portfolio-index`) Actor

Compute per-size bid/ask spread and rank the widest StockX arbitrage gaps across a list of products.

- **URL**: https://apify.com/xtracto/stockx-portfolio-index.md
- **Developed by:** [Farhan Febrian Nauval](https://apify.com/xtracto) (community)
- **Categories:** E-commerce, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.33 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## StockX Portfolio Spread-Movers Index

Turn a list of StockX products into a ranked arbitrage-scan report: the live bid/ask spread for every size, and which sizes have the widest gap between what buyers will pay and what sellers are asking right now.

### Why use this actor

- **No account required** — reads public StockX market data; no login or API key needed.
- **Spread computed for every size** — `lowestAsk - highestBid` and that gap as a percentage, calculated for you on every size of every product.
- **Automatic ranking** — one summary record lists the widest spreads across your whole list, sorted from biggest gap to smallest, so you don't have to sort a spreadsheet yourself.
- **Optional trend mode** — turn on `useHistory` and the actor remembers each size's spread between runs, so the ranking can show which spreads *widened or narrowed the most* since your last run, not just which are widest today.
- **Stable JSON output** — one row per size plus one ranking summary row, ready for a spreadsheet or database with no clean-up.
- **Localized pricing** — configure ship-to country and display currency per run.

### How it works

1. You give the actor a list of StockX product URLs (or slugs).
2. For each product, it fetches the current market data for every size.
3. For every size that has both a live ask and a live bid, it calculates the spread (`lowestAsk - highestBid`) and the spread as a percentage of the asking price.
4. All sizes across all products are combined into one ranked list, from widest spread to narrowest.
5. If `useHistory` is on, each size's spread is compared to the last time you ran the actor, and the ranking shows the biggest movers instead of just the biggest gaps.
6. Results land in Apify's dataset, exportable as JSON, CSV, or Excel.

You don't need to manage any browsers, scrapers, or your own database to track spreads over time — the actor remembers for you when `useHistory` is on.

### Input

```json
{
    "productUrls": [
        { "url": "https://stockx.com/air-jordan-1-retro-low-og-banned" },
        { "url": "https://stockx.com/adidas-yeezy-boost-350-v2-zebra-kids" }
    ],
    "skus": [],
    "useHistory": false,
    "maxItems": 50,
    "country": "US",
    "currency": "USD",
    "maxConcurrency": 2,
    "maxRequestRetries": 6,
    "proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] }
}
```

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `productUrls` | URL\[] | — | StockX product URLs (`https://stockx.com/<slug>`). Use this OR `skus`. |
| `skus` | string\[] | `[]` | StockX slugs (the part after `stockx.com/`), e.g. `"air-jordan-1-retro-low-og-banned"`. Only used if `productUrls` is empty. |
| `useHistory` | boolean | `false` | When ON, remembers each size's spread between runs and ranks by the biggest *change* since last time. First run (or any size seen for the first time) has no prior data yet, so those rows simply won't have a change value — never a made-up one. When OFF, ranks by the widest spread *right now*. |
| `maxItems` | integer | `50` | How many rows to include in the final ranked list (across all products/sizes combined). |
| `country` | string | `"US"` | Two-letter ISO country code for pricing locale. |
| `currency` | string | `"USD"` | ISO currency code (e.g. `USD`, `EUR`, `GBP`). |
| `maxConcurrency` | integer | `2` | Number of parallel workers. |
| `maxRequestRetries` | integer | `6` | Retry budget per request before skipping. |
| `proxyConfiguration` | object | RESIDENTIAL | Apify Proxy or custom proxy list. RESIDENTIAL group recommended. |

### Output

**One row per size** (`recordType: "SIZE_SPREAD"`) — real output from a live run:

```json
{
    "recordType": "SIZE_SPREAD",
    "sourceUrl": "https://stockx.com/air-jordan-1-retro-low-og-banned",
    "scrapedAt": "2026-08-06T09:51:27.041377Z",
    "productId": "6a224a43-164d-4f6f-b854-0466f8e79c60",
    "urlKey": "air-jordan-1-retro-low-og-banned",
    "title": "Jordan 1 Retro Low OG Banned",
    "variantId": "019b0523-93b3-7271-bf18-01d6503fe8f0",
    "variantIndex": 1,
    "size": null,
    "lowestAsk": 133,
    "highestBid": 27,
    "spread": 106,
    "spreadPercent": 79.7,
    "numberOfAsks": 3,
    "numberOfBids": 2,
    "historyStatus": "no_prior_snapshot"
}
```

With `useHistory: true`, a size that was also seen in a previous run additionally carries the prior numbers and the change — this is real output from a second run of the same product:

```json
{
    "recordType": "SIZE_SPREAD",
    "urlKey": "air-jordan-1-retro-low-og-banned",
    "variantId": "019b0523-93b3-7271-bf18-01d6503fe8f0",
    "lowestAsk": 133,
    "highestBid": 27,
    "spread": 106,
    "spreadPercent": 79.7,
    "prevSpread": 106,
    "prevSpreadPercent": 79.7,
    "prevScrapedAt": "2026-08-06T09:52:56.776593Z",
    "spreadChange": 0,
    "spreadPercentChange": 0.0,
    "historyStatus": "compared_to_prior_run"
}
```

**One ranking summary row** (`recordType: "MOVERS_RANKING"`) at the end of each run — real output, `maxItems: 15` across 3 products / 60 sizes:

```json
{
    "recordType": "MOVERS_RANKING",
    "scrapedAt": "2026-08-06T09:51:27.787090Z",
    "rankedBy": "spread",
    "useHistory": false,
    "totalCandidates": 60,
    "returned": 15,
    "movers": [
        {
            "rank": 1,
            "urlKey": "air-jordan-1-retro-low-og-sp-travis-scott-sail-tropical-pink",
            "title": "Jordan 1 Retro Low OG SP Travis Scott Sail Tropical Pink",
            "variantId": "019cfdb6-e638-730d-b804-2e04fd6dd7f6",
            "lowestAsk": 1600,
            "highestBid": 451,
            "spread": 1149,
            "spreadPercent": 71.81,
            "spreadChange": null,
            "spreadPercentChange": null,
            "historyStatus": "no_prior_snapshot"
        },
        {
            "rank": 2,
            "urlKey": "air-jordan-1-retro-low-og-sp-travis-scott-sail-tropical-pink",
            "spread": 266,
            "spreadPercent": 40.61
        },
        "... 13 more"
    ]
}
```

| Field | Type | Description |
| --- | --- | --- |
| `recordType` | string | `"SIZE_SPREAD"` for a per-size row, `"MOVERS_RANKING"` for the summary row, `"ERROR"` if a product could not be read. |
| `urlKey` | string | StockX slug for the product. |
| `title` | string | Product display title. |
| `variantId` | string | StockX's internal ID for this size. |
| `size` | string | null | Human-readable size label, when StockX includes it on the size record (often absent — identify sizes by `variantId` when it's null). |
| `lowestAsk` | number | Current lowest ask for this size. |
| `highestBid` | number | Current highest bid for this size. |
| `spread` | number | `lowestAsk - highestBid` — the bid/ask gap, in the run's currency. |
| `spreadPercent` | number | The spread as a percentage of the lowest ask. |
| `numberOfAsks` / `numberOfBids` | integer | How many asks / bids stand on the book for this size. |
| `prevSpread` / `prevSpreadPercent` / `prevScrapedAt` | number / number / string | This size's spread the last time it was seen (only present when `useHistory` is on AND a prior run recorded this size). |
| `spreadChange` / `spreadPercentChange` | number | Change vs. the prior run (only present with `useHistory` and a prior snapshot). |
| `historyStatus` | string | `"no_prior_snapshot"` or `"compared_to_prior_run"` — tells you honestly whether the change fields are real or simply not yet available. |
| `rankedBy` | string | `"spread"` (widest current gap) or `"spreadChange"` (biggest mover since last run — only once history exists). |
| `movers` | array | The ranked list, widest/biggest-mover first, capped at `maxItems`. |

### A note on "movers"

Every StockX product page shows the *current* spread, but not how it changed. This actor is the only way in this suite to see that change over time: turn `useHistory` on, run it on a schedule (e.g. once a day in the Apify Console), and each run's ranking shows which sizes had the biggest swing since the last run — a genuine day-over-day mover signal, not a single-snapshot guess. Without `useHistory`, you still get a fully real, useful ranking of the widest gaps *today* — just not a trend.

### Other StockX Scrapers

| Actor | What it does |
| --- | --- |
| [StockX Search Scraper](https://apify.com/stockx-search-scraper) | Search keywords or categories; get every result tile with live market data. |
| [StockX Product Scraper](https://apify.com/stockx-product-scraper) | Full product detail — market snapshot, traits, stats — from a list of product URLs. |
| [StockX Orderbook Scraper](https://apify.com/stockx-orderbook-scraper) | Live per-size bid/ask orderbook with spread and 72-hour velocity for any product. |
| [StockX Sales History Scraper](https://apify.com/stockx-sales-history-scraper) | Multi-bucket sales statistics (annual, 90-day, 72-hour) plus per-size breakdowns. |
| [StockX Release Calendar Scraper](https://apify.com/stockx-release-calendar-scraper) | Upcoming and recent drops with release dates and pre-release bid/ask signals. |
| [StockX Portfolio Spread-Movers Index](https://apify.com/stockx-portfolio-index) | Per-size spread and ranked spread-movers across a list of products — this actor. |

# Actor input Schema

## `productUrls` (type: `array`):

List of StockX product URLs (https://stockx.com/<slug>) to index. Use this OR `skus` below.

## `skus` (type: `array`):

StockX URL slugs (the part after stockx.com/), e.g. "air-jordan-1-retro-low-og-banned". Only used if `productUrls` is empty.

## `useHistory` (type: `boolean`):

When ON, saves each run's spreads to a persistent store and computes the change in spread since the last run for each size — the real "mover" signal. First run (or any size seen for the first time) has no prior data yet, so its delta fields will be empty. When OFF (default), the actor ranks by the widest CURRENT spread in this single run only.

## `maxItems` (type: `integer`):

How many rows to include in the final ranked movers list (across all products/sizes combined).

## `country` (type: `string`):

Two-letter ISO country code that drives marketplace pricing (e.g. US, GB, DE, ID).

## `currency` (type: `string`):

ISO currency code returned in lowestAsk / highestBid.

## `maxConcurrency` (type: `integer`):

Parallel workers. Keep low — each product is one market-data fetch.

## `maxRequestRetries` (type: `integer`):

Per-request retry budget; profile rotation kicks in on each retry.

## `proxyConfiguration` (type: `object`):

Apify Proxy or your own list. RESIDENTIAL is strongly recommended.

## Actor input object example

```json
{
  "productUrls": [
    {
      "url": "https://stockx.com/air-jordan-1-retro-low-og-banned"
    },
    {
      "url": "https://stockx.com/adidas-yeezy-boost-350-v2-zebra-kids"
    }
  ],
  "skus": [],
  "useHistory": false,
  "maxItems": 50,
  "country": "US",
  "currency": "USD",
  "maxConcurrency": 2,
  "maxRequestRetries": 6,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `recordType` (type: `string`):

Which kind of row this is.

## `sourceUrl` (type: `string`):

Link to the source.

## `scrapedAt` (type: `string`):

Scraped At as reported by the source.

## `productId` (type: `string`):

Product Id as reported by the source.

## `urlKey` (type: `string`):

Url Key as reported by the source.

## `title` (type: `string`):

Title of the item.

## `variantId` (type: `string`):

Variant Id as reported by the source.

## `variantIndex` (type: `string`):

Variant Index as reported by the source.

## `size` (type: `string`):

Size of the item.

## `lowestAsk` (type: `string`):

Lowest Ask as reported by the source.

## `highestBid` (type: `string`):

Highest Bid as reported by the source.

## `spread` (type: `string`):

Spread as reported by the source.

## `spreadPercent` (type: `string`):

Spread Percent as reported by the source.

## `numberOfAsks` (type: `string`):

Number Of Asks.

## `numberOfBids` (type: `string`):

Number Of Bids.

## `historyStatus` (type: `string`):

History Status.

## `prevSpread` (type: `string`):

Prev Spread as reported by the source.

## `prevSpreadPercent` (type: `string`):

Prev Spread Percent as reported by the source.

## `prevScrapedAt` (type: `string`):

Prev Scraped At as reported by the source.

## `spreadChange` (type: `string`):

Spread Change as reported by the source.

## `spreadPercentChange` (type: `string`):

Spread Percent Change as reported by the source.

## `rankedBy` (type: `string`):

Ranked By as reported by the source.

## `totalCandidates` (type: `string`):

Total Candidates.

## `returned` (type: `string`):

Returned as reported by the source.

## `movers` (type: `string`):

Movers.

## `error` (type: `string`):

Error as reported by the source.

## `rank` (type: `string`):

Position in the ranking. Whole number.

# 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 = {
    "productUrls": [
        {
            "url": "https://stockx.com/air-jordan-1-retro-low-og-banned"
        },
        {
            "url": "https://stockx.com/adidas-yeezy-boost-350-v2-zebra-kids"
        }
    ],
    "skus": [],
    "country": "US",
    "currency": "USD",
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("xtracto/stockx-portfolio-index").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 = {
    "productUrls": [
        { "url": "https://stockx.com/air-jordan-1-retro-low-og-banned" },
        { "url": "https://stockx.com/adidas-yeezy-boost-350-v2-zebra-kids" },
    ],
    "skus": [],
    "country": "US",
    "currency": "USD",
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("xtracto/stockx-portfolio-index").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 '{
  "productUrls": [
    {
      "url": "https://stockx.com/air-jordan-1-retro-low-og-banned"
    },
    {
      "url": "https://stockx.com/adidas-yeezy-boost-350-v2-zebra-kids"
    }
  ],
  "skus": [],
  "country": "US",
  "currency": "USD",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call xtracto/stockx-portfolio-index --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,xtracto/stockx-portfolio-index"
        }
    }
}
```

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/67OK9hJsBSyBJZARg/builds/zwQxFFjjq1PnV2IFZ/openapi.json
