eBay sold listings API in Python

To get eBay sold listings in Python, call GET https://www.soldcomps.io/v1/sold with requests and a Bearer key: one call returns up to 200 eBay sales from the last 90 days with the median, p25 and p75 already worked out, at 20 credits per search + 1 per sale returned, and the free plan includes 2,000 credits a month.
Python: sold listings and the median for one item
import os, time, requests

API = "https://www.soldcomps.io/v1/sold"
KEY = os.environ["SOLDCOMPS_KEY"]  # free key: soldcomps.io/signup

def sold(q, **params):
    """eBay sold listings for one search. Retries 429/502, which are never billed."""
    for attempt in range(4):
        r = requests.get(API, params={"q": q, **params},
                         headers={"Authorization": f"Bearer {KEY}"}, timeout=30)
        if r.status_code in (429, 502):
            time.sleep(int(r.headers.get("Retry-After", 2 ** attempt)))
            continue
        r.raise_for_status()
        return r.json()
    r.raise_for_status()

data = sold("nintendo switch oled", condition="used", limit=20)
s = data["stats"]
print(f'{data["count"]} sales, median {s["median"]} {s["currency"]} (p25 {s["p25"]}, p75 {s["p75"]})')
for item in data["items"]:
    if not item["flags"]:  # flagged sales (lots, parts, outliers) are left out of stats
        print(item["sold_at"], item["sold_price"]["value"], item["title"])

Get a free API key

The job

Python is where most pricing scripts, notebooks and repricers start, and the first thing they need is what an item actually sold for. eBay's Finding API, which used to answer that with findCompletedItems, was decommissioned on 2025-02-04, and the Marketplace Insights API that replaced it for sold data isn't open to new developers.

The code above is the whole integration: one GET request with requests, a retry for rate limits, and the stats eBay's own search doesn't give you. No eBay keyset, OAuth or scraping.

How to do it

  1. Get a key and export it. Sign up free at /signup (2,000 credits a month, no card), then export SOLDCOMPS_KEY=sh_live_... in your shell or .env.
  2. Install requests. pip install requests. There's no SDK to install: it's one GET endpoint, so requests or httpx is all you need.
  3. Call /v1/sold. Pass q plus any filters: condition, site (EBAY_US, EBAY_GB, EBAY_DE), days, min_price / max_price, buying_format and limit.
  4. Use stats, not your own average. stats.median, p25 and p75 come from clean sales only. Each item has flags; an empty list means it was counted.
  5. Retry 429 and 502. Honor Retry-After on 429; back off on 502. Neither is billed, so retrying costs nothing.

What five Python calls returned (eBay US, snapshot Nov 13, 2026)

ItemConditionMedianMiddle halfClean salesLeft outAuctionsSales from
Nintendo Switch OLEDused$165.00$159.50 to $182.5035920%Nov 11, 2026 to Nov 12, 2026
iPhone 15 Pro 128GB (unlocked)used$425.00$410.14 to $455.0041312%Oct 20, 2026 to Nov 12, 2026
NVIDIA RTX 4070used$619.00$550.00 to $650.0041310%Nov 1, 2026 to Nov 12, 2026
LEGO 75192 Millennium Falcon (sealed)new$875.00$844.25 to $911.8340410%Oct 14, 2026 to Nov 12, 2026
Sony A7 III (body only)used$828.00$770.00 to $914.0539410%Oct 14, 2026 to Nov 11, 2026

Source: the eBay Sold Comps Index, eBay US sold listings, snapshot 2026-11-13. Prices exclude shipping. “Left out” = lots, for-parts units, outliers and hidden Best Offers (methodology).

Cost per call

limit (sales listed)Credits per searchSearches on Free (2,000 credits)Searches on Starter ($5, 50,000 credits)
121952,380
1030661,666
2040501,250
507028714
2002209227

Code

curl
curl "https://www.soldcomps.io/v1/sold?q=rolex+submariner&condition=used" \
  -H "Authorization: Bearer sh_live_xxxxxxxx"
JavaScript
const url = new URL("https://www.soldcomps.io/v1/sold");
url.searchParams.set("q", "charizard 4/102 \"psa 9\"");
url.searchParams.set("buying_format", "auction");

const res = await fetch(url, { headers: { Authorization: `Bearer ${process.env.SOLDCOMPS_KEY}` } });
if (!res.ok) throw new Error(`${res.status} ${(await res.json()).error.code}`);
const { count, stats, items } = await res.json();
Python
import requests

r = requests.get(
    "https://www.soldcomps.io/v1/sold",
    params={"q": "rolex submariner 126610ln", "condition": "used"},
    headers={"Authorization": "Bearer sh_live_xxxxxxxx"},
    timeout=30,
)
r.raise_for_status()
data = r.json()
print(data["count"], "sales, median", data["stats"]["median"])

No code: add the MCP server https://www.soldcomps.io/mcp to Claude, ChatGPT or Cursor (setup). Full reference in the API docs.

When SoldComps.io is not the right tool

Frequently asked questions

Is there a Python SDK?

No, and you don't need one: the API is a single GET endpoint that returns JSON, so requests or httpx covers it in a few lines.

How do I load the sales into pandas?

pd.json_normalize(data["items"]) gives one row per sale, with nested fields flattened into columns such as sold_price.value and shipping.value. Filter out rows whose flags list isn't empty to match the stats.

Can I search eBay UK or Germany from Python?

Yes. Add site="EBAY_GB" or site="EBAY_DE" to the params; prices come back in GBP or EUR.

How do I keep costs down?

Set limit to the number of sales you'll actually show (often 10 to 20). Stats use every matching sale regardless, and you pay 20 credits per search + 1 per sale returned. Repeat searches within 12 hours are served from cache.

Related