DEV Community

Sam Smith
Sam Smith

Posted on

One request, two medians: what an AI junk filter changes on eBay, Reverb, Poshmark and Mercari

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 own measurements on 18 November 2026. A free key needs no card.

This week CompsAPI shipped two things at once: sold prices from 12 marketplaces beyond eBay on the same key, and an opt-in AI filter that labels every 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).

Here is what the two do together, with numbers, and a short script that shows the difference on any search with a single request per marketplace.

What changes in the median

We ran the same search with the filter off and on. Each figure is the median over a 30-day window on the marketplaces, measured on 18 November 2026, and approximate:

Marketplace Search Median, filter off Median, filter on Sales removed
Reverb fender stratocaster about $400 about $900 about 1,130 of about 2,830
Poshmark dyson airwrap about $220 about $280 about 110 of about 255
Mercari nintendo switch oled about $165 about $200 about 37 of about 123

On eBay, using the 240 newest sales of each search, the gaps are larger:

eBay search Median, filter off Median, filter on Sales removed
rolex submariner about $40 about $10,600 190 of 239
canon eos r5 about $65 about $1,810 167 of 239
omega seamaster about $220 about $1,900 116 of 239
dyson airwrap about $185 about $320 95 of 239

A median is robust to outliers, and that is exactly the problem. When most rows are cheap accessories, the median faithfully reports the accessories.

One request, two medians

The filter is opt-in. With ai=1, every row comes back with a label and nothing is removed. That means one request gives you everything you need to compute the median both ways yourself:

import os
import statistics
import sys
from collections import Counter

import requests

SOURCES = ["ebay", "reverb", "poshmark", "mercari"]
QUERY = " ".join(sys.argv[1:])


def labelled_rows(source):
    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.
    return [row for row in resp.json().get("items", []) if row.get("ai")]


for source in SOURCES:
    rows = labelled_rows(source)
    if not rows:
        print(f"{source:<9} no labelled sales")
        continue
    every = [row["price"] for row in rows]
    kept = [row["price"] for row in rows if not row["ai"]["junk"]]
    junk = Counter(row["ai"]["kind"] for row in rows if row["ai"]["junk"])
    off = statistics.median(every)
    on = statistics.median(kept) if kept else None
    print(f"{source:<9} sales={len(rows):<4} off=${off:>9,.2f}  "
          f"on={'n/a' if on is None else f'${on:>9,.2f}'}  "
          f"removed={len(rows) - len(kept)}  {dict(junk.most_common(3))}")
Enter fullscreen mode Exit fullscreen mode

Run it with any search:

python compare.py "fender stratocaster"
Enter fullscreen mode Exit fullscreen mode

Each line shows the marketplace, how many labelled sales came back, the median with the filter off and on, how many rows the filter would remove, and the top three kinds of junk it found. Searches that a marketplace does not carry, such as a guitar on Poshmark, will legitimately return nothing.

If you only want the server to do it, exclude=ai_junk returns the filtered results and median directly. The script above is for seeing what was taken out.

How good is the filter?

CompsAPI published the test behind it, and the numbers are worth reading, not just the headline:

  • 600 marketplace listings, none used to train the filter: it made the same call as the labels on 97.7%, with 8 real items wrongly removed and 6 junk rows wrongly kept.
  • 690 eBay listings from 20 searches it had never seen: about 92%. It wrongly removed 24 of 413 real items (5.8%) and kept 30 of 277 junk listings (10.8%).
  • By marketplace on the 600: Poshmark 98.4%, Goldin 97.5%, Reverb 95.2%, Vinted 93.9%, Mercari 93.8%. Several marketplaces had too few test listings, or too little junk in the sample, to publish a figure.
  • By kind of junk: lots 25 of 26 removed, parts 13 of 13, mystery boxes and packs 30 of 32, accessories 35 of 41.

The 600-marketplace sample was only about 8.5% junk, so a filter that did nothing would already score about 91.5% there. On eBay, where about 40% of the test listings were junk, the filter is doing much more of the work. (Those baseline figures are my arithmetic from the published counts.)

The 12 marketplaces

The same /v1/sold and /v1/comps endpoints, the same key and the same monthly quota now read Reverb, Poshmark, Mercari, Vinted, Goldin, Grailed, TCGplayer, MySlabs, GOAT and more, with a source= parameter. source=all merges them in one call, newest sale first. Histories start on different dates (Reverb goes back to 2014, Mercari and Poshmark from November 2025, Vinted from 15 November 2026), so check a marketplace's start date before asking for a long window.

Limits worth knowing

  • It does not check that what is left is the exact model you searched for, and it does not detect counterfeits. A replica is only labelled if the listing says so.
  • 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 and 5 of 68 for the PlayStation 4 Slim were single consoles. Compare filtered and unfiltered results before relying on it for consoles.
  • The test labels are CompsAPI's own, checked twice independently and reviewed, but not by an outside party.
  • I have not run the script above against a live key. It follows the documented parameters and fields (ai.kind, ai.junk, price) and assumes rows come back under items. 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 gives you 100 requests a month, enough to run the script on a few searches: get one here. If you find a sale the filter labels wrongly, tell us in the comments.

Top comments (0)