StockX sales history API in Python: live, cached and daily sales
Fetch StockX sales history in Python with Packet's live and cached endpoints. Page back through sales, filter to one size and build a daily series, with real output from a Jordan 1 and the quirks we found.
On this page
This tutorial ends with a Python script that pulls the StockX sales history of a sneaker, pages back through it, narrows it to a single size and turns it into a daily price series you can check. It is for developers and resellers building inventory valuation, price charts or release analytics who need actual sale prices, not asks. It uses three Packet endpoints: one live and two cached. All output below comes from calls made on November 14, 2026 against the Jordan 1 Retro High OG "Chicago Lost and Found" (DZ5485-612). Packet is an independent service and is not affiliated with StockX.
The StockX API overview lists every StockX endpoint and explains live versus cached data. This post covers what the sales endpoints return in practice: how far back a page goes, how the cursors behave, and where the cached data and the live data disagree.
Get the last 50 sales of a product
You need the StockX product UUID first. A name or SKU search on the cached StockX search endpoint returned 9a4d44f9-4b16-4abc-ba58-c0db340ee791 for the Lost and Found, with 82 weekly orders. The same search also returned a "(Size 8.5)" listing with the same SKU and 0 weekly orders, so pick by weekly_orders and not by the first hit. The price tracker post has a lookup function that does this.
With the UUID, the live sales history endpoint returns the 50 most recent sales for 1 credit:
import os
import requests
API = "https://api.pckt.sh"
HEADERS = {"Authorization": f"Bearer {os.environ['PCKT_API_KEY']}"}
PRODUCT_ID = "9a4d44f9-4b16-4abc-ba58-c0db340ee791" # Jordan 1 Chicago Lost and Found
r = requests.get(f"{API}/v1/stockx/history", headers=HEADERS, params={"id": PRODUCT_ID}, timeout=30)
r.raise_for_status()
edges = r.json()["data"]["product"]["market"]["sales"]["edges"]
print(len(edges), "sales from", edges[-1]["node"]["createdAt"], "to", edges[0]["node"]["createdAt"])
for e in edges[:5]:
n = e["node"]
print(n["createdAt"], n["orderType"], n["amount"], n["associatedVariant"]["id"])
50 sales from 2026-11-10T02:37:09.814Z to 2026-11-14T06:00:00.604Z
2026-11-14T06:00:00.604Z STANDARD 260 35dc165e-d39d-4a6e-a035-c3475a3d47a2
2026-11-14T05:53:21.728Z STANDARD 259 d5455547-b463-44a7-9d09-67086c66a613
2026-11-14T04:05:30.751Z STANDARD 230 e3f6d44e-7611-4c6b-886a-1a6ba6e1a3ff
2026-11-14T02:01:39.749Z STANDARD 205 3df8dd0b-be49-4ae3-9db6-088f64c7cb8b
2026-11-13T23:26:26.219Z STANDARD 265 3df8dd0b-be49-4ae3-9db6-088f64c7cb8b
Some things to know about this response:
- The data sits deep in the nesting:
data.product.market.sales.edges. Each edge has acursorand anodewithamount,createdAt,orderTypeandassociatedVariant.id. amountis whole dollars in the requested currency (USD by default;country_codeandcurrency_codechange it).orderTypeon sales isSTANDARDorEXPRESS. The prices endpoints split express asks intoEXPRESS_SHIPPED,EXPRESS_EXPEDITEDandEXPRESS_NEXTDAY, so don't expect the labels to match.- The variant is an ID, not a size. To map IDs to sizes, read
variants[].idandvariants[].base_sizefrom/v1/catalog/stockx/product. For this shoe,013880e1-acbf-4843-b050-f012f43607b7is US M 4.5.
For a shoe selling at this rate, 50 sales covered about four days, across all sizes, with prices from $190 to $455 and a median of $258.50. That range mixes sizes and shipping types, so a product-level median is a rough number. The next section narrows it down.
Page back and filter to one size
Each edge's cursor is a base64 timestamp. The last one on the first page, MjAyNi0xMS0xMCAwMjozNzowOQ==, decodes to 2026-11-10 02:37:09. Pass it back as after and you get the next 50. In my run the second page started at 2026-11-10T00:44:16.466Z, so the boundary sale was not repeated, and it reached back to 2026-11-06T01:46:32.947Z. Treat the token as opaque and always take it from the response. The docs example (eyJjdXJzb3IiOjUwfQ==) uses a different format.
The response has no pageInfo or "has more" flag, so the loop stops on an empty page or after a fixed number of pages:
import os
import time
import requests
API = "https://api.pckt.sh"
HEADERS = {"Authorization": f"Bearer {os.environ['PCKT_API_KEY']}"}
def live_history(item_id, pages=1, is_variant=False):
sales, after = [], None
for _ in range(pages):
params = {"id": item_id}
if is_variant:
params["is_variant"] = "true"
if after:
params["after"] = after
r = requests.get(f"{API}/v1/stockx/history", headers=HEADERS, params=params, timeout=30)
r.raise_for_status()
data = r.json()["data"]
edges = (data["variant"] if is_variant else data["product"])["market"]["sales"]["edges"]
if not edges:
break
sales += [e["node"] for e in edges]
after = edges[-1]["cursor"]
time.sleep(1.1) # Free plan allows 1 request per second
return sales
sales = live_history("9a4d44f9-4b16-4abc-ba58-c0db340ee791", pages=2)
print(len(sales), "sales from", sales[-1]["createdAt"], "to", sales[0]["createdAt"])
100 sales from 2026-11-06T01:46:32.947Z to 2026-11-14T06:00:00.604Z
The time.sleep is there for a reason. When I sent requests back to back on a Free key, one came back as HTTP 426 with {"status":false,"message":"rate limit exceeded"}. The pricing page confirms that 426 is the status for both a rate limit hit and an empty credit balance.
For a single size, pass the variant ID with is_variant=true. The response then nests under data.variant instead of data.product, and nodes have no associatedVariant field. That is why the function switches keys. One size sells more slowly than the whole product, so 50 sales go back much further:
from statistics import median
# uses live_history() from the previous snippet
sales = live_history("efa55889-eb85-4e58-a76b-1c6f5a65f1ab", is_variant=True)
print(len(sales), "sales from", sales[-1]["createdAt"][:10], "to", sales[0]["createdAt"][:10])
for order_type in ("STANDARD", "EXPRESS"):
amounts = [s["amount"] for s in sales if s["orderType"] == order_type]
print(f"{order_type:<9} n={len(amounts):<3} median ${median(amounts):<6} mean ${sum(amounts) / len(amounts):.0f} "
f"min ${min(amounts)} max ${max(amounts)}")
50 sales from 2026-10-08 to 2026-11-13
STANDARD n=32 median $265.0 mean $297 min $222 max $438
EXPRESS n=18 median $278.5 mean $289 min $261 max $480
One page bought 36 days of history for this size. The gap between mean and median is the main point here. Most standard sales for this variant sat between $250 and $275. Then four sales on October 27 went for $368 to $413 within five hours, and one on November 6 went for $438. Those few sales pull the standard mean $32 above the median. If you value inventory on recent sales, use the median, and keep express and standard apart. Express sales cleared $13.50 higher at the median.
Cached sales: cheaper, about a day behind
The cached sales endpoint costs 0.6 credits per request and returns a flat JSON array, 100 sales per page by default (page_size changes it):
{"stockx_product_id": "9a4d44f9-4b16-4abc-ba58-c0db340ee791",
"stockx_variant_id": "efa55889-eb85-4e58-a76b-1c6f5a65f1ab",
"amount": 265, "order_type": "STANDARD", "market": "US", "currency": "USD",
"created_at": "2026-11-12T23:29:44.934Z"}
I compared it against the live pages from the same morning. This is what I found:
| Observation | Detail from the run |
|---|---|
| Freshness | Newest cached sale: 2026-11-12T23:29:44.934Z. The live endpoint had 12 later sales, the newest at 2026-11-14T06:00:00.604Z. |
| Cursor is inclusive | Setting cursor to the last created_at (2026-11-12T15:21:52.005Z) returned that same sale again as the first row of page 2. |
| Cursor accepts any timestamp | cursor=2026-11-08T12:00:00.000Z returned sales starting at 2026-11-08T10:43:31.815Z. You can jump straight to a date. |
| Cache keeps a sale live omits | A $485 sale at 2026-11-07T15:27:26.372Z was in the cache but not in the live history. |
variant_id filter is thin |
For efa55889-… it returned 3 sales, all on November 12. The unfiltered cache held at least 5 more sales of that variant from November 6 to 11. For 013880e1-… (US M 4.5) it returned [], although the unfiltered cache had a $219 sale in that size on November 8. |
In practice: dedupe on (created_at, stockx_variant_id) when paging. For one size from the cache, page the whole product and filter on your side, or use the live endpoint with is_variant. This function pages back to a cutoff date and drops the repeated boundary row:
import os
import time
import requests
API = "https://api.pckt.sh"
HEADERS = {"Authorization": f"Bearer {os.environ['PCKT_API_KEY']}"}
def cached_sales(product_id, since, page_size=100):
"""Individual sales with created_at >= since (e.g. "2026-11-06"), newest first."""
sales, seen, cursor = [], set(), None
while True:
params = {"id": product_id, "page_size": page_size}
if cursor:
params["cursor"] = cursor
r = requests.get(f"{API}/v1/catalog/stockx/sales", headers=HEADERS, params=params, timeout=30)
r.raise_for_status()
page = r.json()
new = [s for s in page if (s["created_at"], s["stockx_variant_id"]) not in seen]
if not new:
break
for s in new:
seen.add((s["created_at"], s["stockx_variant_id"]))
if s["created_at"] >= since:
sales.append(s)
if page[-1]["created_at"] < since:
break
cursor = page[-1]["created_at"]
time.sleep(1.1)
return sales
ISO timestamps in the same format sort as strings, so >= against "2026-11-06" works without parsing dates.
Daily aggregates, checked against individual sales
The daily sales endpoint returns one row per day with avg_amount and orders, also at 0.6 credits for up to 100 days. For the Lost and Found, page_size=14 returned rows from 2026-11-12 back to 2026-10-25. There was no row for November 13, which fits the cache being about a day behind. Several other dates had no row either: November 7, 4 and 3, October 31 and 26.
I grouped the individual sales by UTC date and compared them with the daily rows:
| Date (UTC) | Daily orders |
Daily avg_amount |
Individual sales | Their average |
|---|---|---|---|---|
| 2026-11-12 | 14 | 267 | 14 | 267 |
| 2026-11-11 | 2 | 264 | 16 | 270 |
| 2026-11-10 | 9 | 241 | 9 | 241 |
| 2026-11-09 | 2 | 240 | 13 | 290 |
| 2026-11-08 | 11 | 287 | 11 | 287 |
| 2026-11-07 | no row | 9 | 280 | |
| 2026-11-06 | 4 | 243 | 19 | 267 |
The counts for November 9 and 8 come from the live pages. The others come from the cache, and November 7 includes the $485 sale that only the cache had. On three days the two sources matched exactly. Those matches show that days are cut at UTC midnight and that avg_amount is truncated, not rounded: November 10 averages $241.67 and the row says 241. On the other four days the daily row undercounts or is missing.
So the daily endpoint is fine for a long-range trend line, but for recent exact counts, build the series yourself from individual sales:
from collections import defaultdict
# uses cached_sales() from the previous snippet
by_day = defaultdict(list)
for s in cached_sales("9a4d44f9-4b16-4abc-ba58-c0db340ee791", since="2026-11-06"):
by_day[s["created_at"][:10]].append(s["amount"])
for day in sorted(by_day, reverse=True):
amounts = by_day[day]
print(day, len(amounts), sum(amounts) // len(amounts))
If you only need a summary, /v1/catalog/stockx/product returns analytics for 0.4 credits. For this shoe, last_90_days reported 1,157 sales at an average of $253, ranging from $96 to $464.
What it costs
Credit costs per request come from the API spec. The pages-per-period figures come from this shoe's volume (about 100 sales per 8 days across all sizes), so scale them to your product.
| Job | Endpoint | Credits × requests | Total |
|---|---|---|---|
| Last 50 sales of a product | /v1/stockx/history |
1 × 1 | 1 |
| About a month of product sales, live | /v1/stockx/history |
1 × 4 | 4 |
| 36 days of one size, live | /v1/stockx/history |
1 × 1 | 1 |
| About a month of product sales, cached | /v1/catalog/stockx/sales |
0.6 × 4 | 2.4 |
| A year of daily rows | /v1/catalog/stockx/sales/daily |
0.6 × 4 | 2.4 |
| 90-day and annual summary | /v1/catalog/stockx/product |
0.4 × 1 | 0.4 |
For a recurring job: refreshing 20 products once a day with one live page each costs 20 × 30 × 1 = 600 credits a month. That is over the Free plan's 500 credits. The same job on one cached page each costs 20 × 30 × 0.6 = 360 credits, which fits, and new accounts can earn up to 550 bonus credits on top. The pricing calculator works out other mixes.
Bulk history and where to go next
Paging through the API makes sense for a watchlist. It doesn't scale to the whole catalog. The StockX Sales History US dataset has about 3.6 million sales covering one year, delivered as compressed JSONL, from $199 a month. Load it once, then keep it current with cached pages using the dedupe logic above.
To act on these numbers, the StockX price tracker tutorial watches lowest asks by size. Comparing an ask against the median of a size's recent standard sales, as computed above, is a better alert threshold than a fixed target price.
Victor Lourme
Working at pckt.sh