Disclosure: we build CompsAPI, the sold-price API this post is about. It was drafted with AI assistance, and every figure comes from CompsAPI's published test notes. A free key needs no card.
CompsAPI's new AI filter labels each sale as the item itself or as junk (a lot, a part, an accessory, an empty box, a mystery pack, a replica, a digital code). It is opt-in, and it is right most of the time. This post is about the rest: how to look at what it removed, in about 25 lines, so you can check the rows that matter before you trust a median.
Where the filter slips
The published test notes are specific about the failure modes:
- eBay, 690 listings from 20 unseen searches: about 92% agreement with CompsAPI's own labels. It wrongly removed 24 of 413 real items (5.8%) and kept 30 of 277 junk listings (10.8%).
- Bundles are the known weak spot. A console sold with its own dock and controller should be kept, and usually is, but 2 of 23 higher-priced removed Xbox Series X listings, 2 of 21 for Nintendo Switch OLED, 1 of 18 for PS5 and 5 of 68 for PlayStation 4 Slim were single consoles.
- Other slips: multipacks sold as one product can be treated as lots, and "body only" cameras can be treated as parts.
Notice the pattern: the wrongly removed rows are real items, so they tend to sit at real-item prices. A removed accessory usually sells for far less than the item. That gives a cheap heuristic for where to look.
The audit script
With ai=1, nothing is removed and every row carries a label, so one request gives you both sides. The script computes the median of the rows the filter would keep, then lists the removed rows priced at or above that median, least confident first:
import os
import statistics
import sys
import requests
QUERY = " ".join(sys.argv[1:])
SOURCE = os.environ.get("SOURCE", "ebay")
resp = requests.get(
"https://api.compsapi.com/v1/sold",
params={"source": SOURCE, "q": QUERY, "ai": 1},
headers={"X-API-Key": os.environ["COMPSAPI_KEY"]},
timeout=30,
)
resp.raise_for_status()
# A very recent sale can arrive before it has a label, so skip unlabelled rows.
rows = [row for row in resp.json().get("items", []) if row.get("ai")]
kept = [row for row in rows if not row["ai"]["junk"]]
removed = [row for row in rows if row["ai"]["junk"]]
if not kept:
sys.exit("Nothing was kept, so there is no median to compare against.")
median = statistics.median(row["price"] for row in kept)
suspects = sorted(
(row for row in removed if row["price"] >= median),
key=lambda row: row["ai"]["confidence"],
)
print(f"{len(rows)} sales, {len(removed)} removed, median of kept rows ${median:,.2f}")
print(f"{len(suspects)} removed rows priced at or above that median:\n")
for row in suspects[:15]:
ai = row["ai"]
print(f'{ai["confidence"]:.2f} {ai["kind"]:<10} ${row["price"]:>9,.2f} {row["title"][:70]}')
Run it on any search:
python audit.py "nintendo switch oled"
Set SOURCE=reverb (or another marketplace) to audit a different one.
How to read the output
- A removed row at a real-item price is worth a look. If the title says "console with dock and controller", the filter may have mistaken a bundle for a lot. If it says "lot of 5", it was right.
- Low confidence matters more than the kind. The list is sorted so the rows the model was least sure about come first.
- An empty list is a good sign, not proof. It means every removed row sold for less than the kept median, which is what accessories and parts usually do.
- Lots will show up here legitimately. A real lot can sell for more than one item. The script points you at rows to read, it does not decide.
What it costs
One request per search. On the free plan (100 requests a month, 10 a minute) that is 100 audits a month.
Limits worth knowing
- The price rule is my heuristic, not something the API reports. It finds rows worth reading, and plenty of correctly removed lots will appear in the list.
- It cannot find junk the filter kept. The 10.8% of eBay junk that slipped through is not in this list. For that, sort the kept rows by price and read the top few.
- The test labels are CompsAPI's own, checked twice independently and reviewed, but not by an outside party.
-
I have not run this script against a live key. It follows the documented parameters and fields (
ai.kind,ai.junk,ai.confidence,price,title) and assumes rows come back underitems. Treat it as a starting point and try it on a search you know.
CompsAPI is not affiliated with eBay or the marketplaces named.
Try it
A free key is enough to audit a few searches: get one here. If you find a removed row that was clearly a real item, tell us in the comments.
Top comments (0)