Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eBay Sold Listings API: Python and Node clients

eBay sold listings API client for Python and Node: real eBay sold prices as JSON, up to 3 years of history, the accepted Best Offer price, live listings, and 12 more marketplaces on the same key. Official clients for CompsAPI, with examples.

API reference · OpenAPI 1.11.0 · Pricing · Free key (100 requests a month, no card)

Install Source
Python pip install compsapi python/
Node / TypeScript npm install compsapi node/
curl none examples/curl.sh

Quickstart

curl -H "X-API-Key: $COMPSAPI_API_KEY" \
  "https://api.compsapi.com/v1/sold?q=nintendo+switch+oled&days=30&condition=used&stats=1"
from compsapi import CompsAPI

client = CompsAPI()  # COMPSAPI_API_KEY
res = client.sold("nintendo switch oled", days=30, condition="used", stats=True)
print(res["stats"]["median"], len(res["items"]))
import { CompsAPI } from "compsapi";

const client = new CompsAPI();
const res = await client.sold({ q: "nintendo switch oled", days: 30, condition: "used", stats: true });
console.log(res.stats?.median, res.items.length);

What you get

Endpoint Returns
GET /v1/sold Sold listings for a search, newest first: price paid (USD), sale time, format, bids, units sold, shipping, link, image. Pageable, days up to 1,095 or a fixed start/end window
GET /v1/comps Median, mean, p25, p75, min, max over every matching sale, plus the 10 newest. Junk listings removed by default
GET /v1/active What is listed right now: price, shipping, format, bids, end time, seller, Best Offer enabled
source= stockx, goat, tcgplayer, reverb, grailed, poshmark, mercari, vinted, goldin, fanatics, myslabs, pristine, psa, or all
/v1/lookup, /v1/population, /v1/cert PSA spec ids, population and gem rate, cert lookup
/v1/usage, /v1/health, /v1/sources Your caps, service status, valid sources. Free

Prices are what the buyer actually paid. On an accepted Best Offer that is the offer price, not the asking price; best_offer=1 marks those rows and best_offer=only returns only them.

Replacing findCompletedItems

eBay shut down the Finding API, so findCompletedItems calls in old code (ebaysdk-python, ebay-node-api, and the like) no longer return data. eBay's Browse API covers live listings only, and Marketplace Insights, eBay's sold data API, is a limited release that needs approval. /v1/sold takes the same inputs:

findCompletedItems /v1/sold
keywords q (every word must be in the title)
itemFilter SoldItemsOnly=true always on: only sales come back
itemFilter Condition condition=new, open_box, refurbished, used, parts (comma list)
itemFilter EndTimeFrom / EndTimeTo start / end as YYYY-MM-DD, or days (1 to 1,095)
itemFilter MinPrice / MaxPrice min_price / max_price
itemFilter ListingType no filter; every row carries format (FIXED_PRICE or AUCTION) to filter on
categoryId category (comma list)
GLOBAL-ID (EBAY-GB, EBAY-DE ...) site=UK, DE, FR, IT, ES, CA, AU; off = eBay US plus international merged
paginationInput.entriesPerPage / pageNumber size (10 to 240) / page
sortOrder newest sale first, always
sellingStatus.currentPrice / convertedCurrentPrice price (USD); native_price=1 adds the original currency amount
sellingStatus.bidCount bids
listingInfo.endTime last_sold
listingInfo.bestOfferEnabled best_offer=1 goes further: true on each sale that closed as an accepted offer, and price is the offer amount
condition.conditionDisplayName condition (on each row when one condition is requested)
galleryURL / viewItemURL image / url

A full before and after: examples/python/findcompleteditems_migration.py.

Examples

File What it does
examples/curl.sh Raw HTTP calls
examples/python/quickstart.py Sold listings and stats for a search
examples/python/price_history_pandas.py A year of sales in pandas, weekly median, CSV
examples/python/card_comps.py PSA 10 vs PSA 9 vs raw for one card
examples/node/quickstart.mjs Sold listings and stats in Node
examples/node/price-guide.ts TypeScript price guide for a list of items
examples/node/new-listings-poll.mjs Alert on new live listings

FAQ

Does the eBay API return sold listings? Not for most developers. The Finding API that had findCompletedItems is shut down, the Browse API returns live listings only, and Marketplace Insights (sold items) is limited to approved partners.

How far back does the data go? Up to 1,095 days (3 years) on every plan, including the free one.

Can I get the real price of a Best Offer sale? Yes. price is the amount paid; best_offer=1 flags accepted offers and best_offer=verify adds a confidence label and the asking price next to it.

Is there a free tier? 100 requests a month, no card. Paid plans start at $9 a month; see pricing.

Can an AI agent use it? There is a hosted MCP server: see the docs.

Tests

cd python && pip install -e ".[test]" && pytest            # live tests run when COMPSAPI_TEST_KEY is set
cd node && npm install && npm test && npm run test:live

MIT licensed. Questions or a missing field: open an issue, or a ticket in the console.

Releases

Packages

Contributors

Languages