Skip to Content
GuidesSold prices in Google Sheets

eBay Sold Prices in Google Sheets

Paste one Apps Script into your spreadsheet, add your SellerComps API key from a menu, and type =SELLERCOMPS_MEDIAN("ps5 slim") in any cell: you get the median of up to 240 real eBay sales. The same formula works for TCGplayer, StockX, PSA, Mercari, Poshmark, Grailed and the auction houses. The free plan’s 100 requests a month is enough to set it up and price a small inventory.

The script and copy-paste steps are on sellercomps.com/sheets, with a download of SellerComps.gs.

Install it in four steps

  1. Create a free account and create a key under API keys.
  2. In your spreadsheet open Extensions, Apps Script, replace everything in Code.gs with SellerComps.gs and click Save.
  3. Reload the spreadsheet. A SellerComps menu appears: choose Set API key and paste your key. Google asks once to let the script connect to SellerComps.
  4. Type a formula.

The key is kept in the script’s own properties, not in a cell, so it never shows in the sheet.

The formulas

=SELLERCOMPS_MEDIAN(keyword, [source], [count], [clean]) =SELLERCOMPS_SOLD(keyword, [source], [count], [clean])
ArgumentDefaultWhat it does
keywordWhat to search for, for example "ps5 slim" or a cell such as A2.
source"ebay"ebay, tcgplayer, mercari, poshmark, grailed, stockx, psa, cardhobby, goldin, fanatics, pristine or myslabs. For eBay in another country pass the site: ebay.co.uk, ebay.de, ebay.fr, ebay.it, ebay.es, ebay.ca or ebay.com.au.
count240 (MEDIAN), 50 (SOLD)How many recent sales to use, up to 240.
cleanTRUELeaves out lots, bundles, parts or repair, empty boxes, cases and accessories, and replicas. FALSE keeps every sale.

SELLERCOMPS_MEDIAN returns one number in the marketplace’s currency. SELLERCOMPS_SOLD returns a table with a header row: sold date, title, price, currency, shipping, total, condition, seller and link.

ABC
ps5 slim=SELLERCOMPS_MEDIAN(A2)=SELLERCOMPS_SOLD(A2, "ebay", 10)
charizard base set 4/102=SELLERCOMPS_MEDIAN(A3, "tcgplayer")
jordan 1 chicago lost and found=SELLERCOMPS_MEDIAN(A4, "stockx", 50)
lego 10497 galaxy explorer=SELLERCOMPS_MEDIAN(A5, "ebay.co.uk")

The menu also has Import sold listings to a new tab (every sale for a keyword written as values) and Requests left this month.

How many requests it uses

One per keyword every 6 hours at most. Answers are kept for 6 hours, so SELLERCOMPS_MEDIAN and SELLERCOMPS_SOLD on the same keyword share one request, and reopening or recalculating the sheet costs nothing. Searches that find nothing, and failed searches, are never counted.

A CSV alternative with no code

For a one-off file, add format=csv to a request and import the download with File, Import. Each row is one sale.

FAQ

Can Google Sheets pull eBay sold prices automatically?

Yes. With the SellerComps script, =SELLERCOMPS_MEDIAN("keyword") returns the median of recent eBay sales and refreshes on its own every 6 hours.

Does IMPORTXML work for eBay sold listings?

Not reliably. eBay pages change and often block it. Calling an API from Apps Script returns clean, structured data every time.

Why is my median lower or higher than eBay’s search page?

By default the formula leaves out lots, parts, empty boxes, accessories and replicas, so the median is the price of the item itself. Pass FALSE as the fourth argument to use every sale.

Is it free?

The script is free. Each keyword uses one request from your plan, and the free plan includes 100 requests a month.