DEV Community

Ethan Parker
Ethan Parker

Posted on

Terapeak alternative for developers: rebuild the Product Research summary in Python

If you are a developer looking for a Terapeak alternative, the problem is simple: Terapeak has no API. It lives inside eBay Seller Hub as Product Research, a dashboard you read in a browser. There is no endpoint to call, no key and no documented export. To get the same kind of eBay sold data into your own code, you need a sold listings API.

This post uses SellerComps: GET https://api.sellercomps.com/scrape returns up to 240 completed eBay sales for a keyword as JSON or CSV, in 8 eBay countries, with one bearer key. Then we rebuild the summary numbers the dashboard shows, in about 30 lines of Python.

Setup

Create a key at sellercomps.com and keep it out of your code:

export SELLERCOMPS_API_KEY="sc_..."
pip install requests
Enter fullscreen mode Exit fullscreen mode

The script

import os
import statistics
import sys

import requests

API = "https://api.sellercomps.com"
HEADERS = {"Authorization": f"Bearer {os.environ['SELLERCOMPS_API_KEY']}"}

keyword = sys.argv[1] if len(sys.argv) > 1 else "dyson v15 detect"

r = requests.get(
    f"{API}/scrape",
    params={"keyword": keyword, "itemCondition": "used", "count": 240},
    headers=HEADERS,
    timeout=90,
)
r.raise_for_status()
sales = r.json()["results"]
if not sales:
    sys.exit("no sales found")

# totalPrice = price + shipping, so free and paid shipping compare fairly
totals = [float(s["totalPrice"]) for s in sales]
auctions = [s for s in sales if s["buyingFormat"] == "auction"]
free_ship = [s for s in sales if s["shippingPrice"] == "0"]

print("sales:", len(sales))
print("median delivered price:", statistics.median(totals))
print("average delivered price:", round(statistics.mean(totals), 2))
print("range:", min(totals), "to", max(totals))
print("share sold at auction:", round(100 * len(auctions) / len(sales)), "%")
print("share with free shipping:", round(100 * len(free_ship) / len(sales)), "%")
Enter fullscreen mode Exit fullscreen mode

Run it:

python summary.py "dyson v15 detect"
Enter fullscreen mode Exit fullscreen mode

A 404 means the search found nothing; it is not counted against your plan.

What comes back

Each sale in results has soldPrice, soldCurrency, endedAt, condition, buyingFormat, bidCount, shippingPrice, totalPrice, sellerUsername, url and thumbnailUrl. A few things to remember:

  • soldPrice and totalPrice are decimal strings. Convert before you do math.
  • bidCount is set on auctions and null on Buy It Now sales.
  • count in the response is the number of sales returned, not the total on eBay.
  • Results are newest first.

Mapping the Product Research filters

Product Research Parameter
Condition itemCondition=new or used
Format buyingFormat=auction or buyItNow
Price minPrice, maxPrice
Date range soldAfter, soldBefore (YYYY-MM-DD)
Marketplace ebaySite, for example ebay.co.uk
Category categoryId
Active listings tab sold=false

The keyword works like eBay's search box, including the minus sign, so iphone 15 pro -case -box drops accessory listings before they reach your median.

Pricing a list instead of one item

The part a dashboard cannot do is volume. Send up to 100 keywords in one batch job:

curl -X POST "https://api.sellercomps.com/scrape/batch" \
  -H "Authorization: Bearer $SELLERCOMPS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"keywords": ["dyson v15 detect", "dyson v12 slim", "shark navigator lift-away"], "count": 240}'
Enter fullscreen mode Exit fullscreen mode

You get a jobId back at once. Poll GET /scrape/batch/{jobId} to read keywords as they finish, and when the status is complete, GET /scrape/batch/{jobId}/download.csv gives you every sale in one file. A keyword that fails is marked failed and is free.

Where to go next

  • Other eBay countries: set ebaySite and prices come back in that site's currency.
  • Longer history: GET /history returns up to 3 years of eBay sold history for a keyword.
  • Other marketplaces: the same key covers 16 more, including TCGplayer, StockX, PSA and Mercari.

The free plan has 100 requests a month, no card. The full comparison, with a table and FAQ, is on the Terapeak alternative page.

Also on Medium: Terapeak alternative: 6 mistakes resellers make when they outgrow Product Research (https://medium.com/@sellercomps/terapeak-alternative-6-mistakes-resellers-make-when-they-outgrow-product-research-64b419fcd233)

Top comments (0)