# StockX Trading Cards Flip-Margin Tracker — Pokemon TCG (`bovi/stockx-trading-cards-flip-tracker`) Actor

Track per-size bid, ask, and last-sale prices on StockX for trading-card sealed products (Pokemon TCG boxes, bundles) over time, with flip-margin signals (lastSale minus lowestAsk minus fees). Same time-series engine as our sneaker actor, retargeted at trading cards.

- **URL**: https://apify.com/bovi/stockx-trading-cards-flip-tracker.md
- **Developed by:** [Vitalii Bondarev](https://apify.com/bovi) (community)
- **Categories:** E-commerce, Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.10 / 1,000 stockx trading cards flip-margin tracker — pokemon tcgs

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

## StockX Trading Cards Flip-Margin Tracker — Pokemon TCG

Track **per-size bid, ask, and last-sale prices on StockX** over time and receive
precise flip-margin signals. Unlike generic product-dump scrapers or StockX's own
free catalog tools, this actor captures the *time-series* dimension: every scheduled
run produces a snapshot, computes **change-detection deltas** vs the previous run,
and emits a **flip-margin signal** (lastSale − lowestAsk − estimated fees) per size.

### Why this actor

| | Free StockX catalog APIs | Competitor dumps ($1.50–$4.50/1k) | This actor |
|---|---|---|---|
| Per-size bid/ask | Aggregated only | One-shot dump | **Yes** |
| Time-series / history | Paid €79+/mo | No | **Yes (KV-persisted across runs)** |
| Change-detection deltas | No | No | **Yes — ask dropped %, new ATL** |
| Flip-margin calc | No | No | **Yes — lastSale − ask − fees** |
| Scheduling-friendly | No | No | **Yes — KV state survives across runs** |
| Access | N/A | Breaks on rotation | **Browser + residential (baked in)** |

### Modes

#### `stealth` (default — no StockX account needed)

Launches a browser through an **Apify RESIDENTIAL proxy**.
The actor uses behavioral page warming to pass StockX's protection before extracting
`script#__NEXT_DATA__`, which contains the full `variants[].market.bidAskData`
per-size market data.

On a 403 challenge, the actor automatically retries on a fresh residential IP
(up to `maxRetries` attempts). **Billing is per successful result only** — failed
attempts produce zero billed events.

#### `api` (optional — buyer-supplied StockX API key)

If you have access to the StockX developer API (apply at
[developer.stockx.com](https://developer.stockx.com)), supply your `stockxApiKey`
and `stockxApiToken`. The actor routes market data through the official
`GetVariantMarketData` endpoint at **zero access friction**, 25k requests/24h.
Falls back to `stealth` mode automatically if the API call fails.

### What you get (per size, per run)

- `lowest_ask`, `highest_bid`, `last_sale`, `number_of_asks`, `number_of_bids`
- `sales_last_72h` — recent velocity signal
- `flip_margin_usd` — lastSale − lowestAsk − estimated fees (configurable via `feesPct`)
- `flip_roi_pct` — margin as % of the ask price
- `ask_delta_pct` — change since last run (negative = ask dropped)
- `ask_drop_alert` — true if ask dropped by ≥ `alertAskDropPct` %
- `new_low_alert` — true if this is the lowest ask ever seen for this size
- `margin_alert` — true if flip margin exceeds `alertFlipMarginMin` USD

### Scheduling

The actor is designed for repeated scheduled runs. Pair it with an Apify schedule
(daily, every 12h, etc.) and set a fixed `kvStoreName`. On each run the actor loads
the previous snapshot from the named KV store, computes deltas, then saves the new
snapshot. History accumulates across runs (up to 365 data points per size).

### Input example

These live StockX Pokemon TCG product slugs were verified by search and page fetch on 2026-07-15.

```json
{
  "mode": "stealth",
  "slugs": [
    "pokemon-tcg-scarlet-violet-151-6pk-booster-bundle",
    "pokemon-tcg-scarlet-violet-15-elite-trainer-box",
    "pokemon-tcg-classic-special-set-japanese"
  ],
  "alertAskDropPct": 5,
  "alertNewLowAsk": true,
  "alertFlipMarginMin": 20,
  "feesPct": 12.5,
  "kvStoreName": "stockx-flip-state",
  "maxRetries": 3,
  "proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] }
}
```

### Proxy requirement

StockX blocks all datacenter IPs. **Apify RESIDENTIAL proxy is required** in browser
mode. In api mode, no proxy is needed.

### Pricing

Pay-per-result: one billing event per successful per-size market row. Failed mint
attempts (blocked pages) produce zero billed events.

### Integrations

Built for trading-card resellers and collectors monitoring bid/ask spreads and size-level price movements of sealed Pokemon TCG products over time — the JSON/dataset output drops into the tools you already run, no glue code:

- **n8n / Make / Zapier** — trigger a run or pipe every new dataset item into 500+ apps (Google Sheets, Airtable, Slack, HubSpot, your database) with no code: [n8n](https://docs.apify.com/platform/integrations/n8n), [Make](https://docs.apify.com/platform/integrations/make), [Zapier](https://docs.apify.com/platform/integrations/zapier).
- **Webhooks** — fire your own endpoint the moment a run finishes, to push results straight into your pipeline ([docs](https://docs.apify.com/platform/integrations/webhooks)).
- **MCP server** — expose this actor as a tool to Claude, Cursor, or any [MCP client](https://mcp.apify.com) so an AI agent can pull this data mid-conversation ([guide](https://blog.apify.com/how-to-use-mcp/)).
- **API & SDKs** — fetch the dataset as JSON, CSV, or Excel through the Apify REST API or the Python / JS SDKs.

See all [Apify integrations](https://apify.com/integrations).

# Actor input Schema

## `mode` (type: `string`):

stealth = Playwright + Apify residential proxy (default; no StockX account needed). api = buyer-supplied StockX API key via official GetVariantMarketData endpoint (zero access friction, 25k req/24h; recommended if you have API access).

## `slugs` (type: `array`):

StockX product slugs or full URLs to track. Example: 'nike-air-jordan-1-retro-high-og-chicago-2015' or 'https://stockx.com/nike-air-jordan-1-retro-high-og-chicago-2015'. Each slug is tracked for every size found on the product page.

## `stockxApiKey` (type: `string`):

Your personal StockX API key for mode='api'. Obtained from StockX developer portal (https://developer.stockx.com). Gives access to GetVariantMarketData with zero access friction. Never stored by this actor — used only for the duration of the run.

## `stockxApiToken` (type: `string`):

StockX OAuth2 Bearer JWT token for mode='api'. Required alongside the API key. Obtain via StockX developer portal OAuth flow.

## `alertAskDropPct` (type: `number`):

Flag a result as 'ask\_drop\_alert' if the lowest ask for any size fell by this percentage or more since the last run. 0 = disabled. Example: 5 means alert if ask dropped 5% or more.

## `alertNewLowAsk` (type: `boolean`):

Flag a result as 'new\_low\_alert' if the current lowest ask is the lowest ever seen for that slug+size combination across all runs stored in the KV state.

## `alertFlipMarginMin` (type: `number`):

Flag a result as 'margin\_alert' when the computed flip margin (lastSale − lowestAsk − estimated fees) exceeds this threshold in USD. 0 = disabled.

## `feesPct` (type: `number`):

Total fees to subtract when computing flip margin. Default 12.5 covers the typical StockX seller fee (9.5%) + payment processing (~3%). Adjust to match your actual fee tier.

## `kvStoreName` (type: `string`):

Name of the Apify key-value store used to persist historical data across scheduled runs. Using the same name across scheduled runs lets the actor accumulate change-detection history. Change to isolate a fresh run.

## `maxRetries` (type: `integer`):

How many times to retry the Playwright mint step on a 403 / PX challenge. Each retry uses a fresh residential IP. Higher values increase robustness at the cost of more compute units consumed on failures.

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

REQUIRED for stealth mode on Apify cloud — StockX is not reliable from datacenter IPs. Use Apify RESIDENTIAL. Ignored in api mode.

## `headless` (type: `boolean`):

Run Playwright in headless mode. Always true on Apify cloud. Set false only for local debugging to watch the browser.

## Actor input object example

```json
{
  "mode": "stealth",
  "slugs": [
    "nike-air-jordan-1-retro-high-og-chicago-2015",
    "adidas-yeezy-boost-350-v2-zebra"
  ],
  "alertAskDropPct": 5,
  "alertNewLowAsk": true,
  "alertFlipMarginMin": 0,
  "feesPct": 12.5,
  "kvStoreName": "stockx-trading-cards-flip-state",
  "maxRetries": 3,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  },
  "headless": true
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset containing Stockx Flip Tracker records (product\_name, slug, size, lowest\_ask, highest\_bid, last\_sale, flip\_margin\_usd, flip\_roi\_pct, ask\_delta\_pct, number\_of\_asks, sales\_last\_72h, scraped\_at).

# 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 = {
    "slugs": [
        "pokemon-tcg-scarlet-violet-151-6pk-booster-bundle",
        "pokemon-tcg-scarlet-violet-15-elite-trainer-box",
        "pokemon-tcg-classic-special-set-japanese"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("bovi/stockx-trading-cards-flip-tracker").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 = { "slugs": [
        "pokemon-tcg-scarlet-violet-151-6pk-booster-bundle",
        "pokemon-tcg-scarlet-violet-15-elite-trainer-box",
        "pokemon-tcg-classic-special-set-japanese",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("bovi/stockx-trading-cards-flip-tracker").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 '{
  "slugs": [
    "pokemon-tcg-scarlet-violet-151-6pk-booster-bundle",
    "pokemon-tcg-scarlet-violet-15-elite-trainer-box",
    "pokemon-tcg-classic-special-set-japanese"
  ]
}' |
apify call bovi/stockx-trading-cards-flip-tracker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,bovi/stockx-trading-cards-flip-tracker"
        }
    }
}

```

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/J4yYwtfruipI0QaU3/builds/fSpvLLhTTy5rw7aPY/openapi.json
