Blog / API guides

eBay Scraper or API: Prices Without the Parsing

An eBay scraper fetches eBay search and item pages, then turns each result card into a title, a price, a condition and an item link. You write and maintain the fetching, the parsing, the paging and the checks that tell you a run went wrong. The alternative is three eBay endpoints that return search results as JSON at 1 credit per successful call, with prices already split into a number and a currency. This post compares the two on a recorded "coffee maker" search, works out the cost per result tracked, and gives a verdict per use case.

What does an eBay scraper have to do?

An eBay scraper has to do five jobs before you get a usable row: fetch a search page, find each result on it, clean the fields, decide which results to keep, and move to the next page. Each job is ordinary engineering, and each one breaks on its own schedule. Search results on a large marketplace are rendered for people, so the data you want sits inside markup that was never meant as an interface.

The cleaning step is where most of the code goes. On any rendered page a price is text, with a currency symbol and separators that your code has to strip, and any format you didn't plan for turns into a parse error or a wrong number. Descriptive details such as condition are text too. Paid placements need their own detection, and if you miss them, your price sample is weighted toward whoever paid for placement.

Then come the parts that don't show up in a prototype. Layout changes move or rename the elements your parser depends on, often without an error, so you need a monitor that compares row counts and empty fields between runs. Traffic at volume from one place tends to get slowed or blocked by any site this size, and working around that with proxy rotation or challenge solvers isn't something we'd recommend. Read eBay's terms before you build a collector. For a general view of when a scraper is worth writing, Google Maps Scraper or Places Data API walks through the same trade-off on another site.

What does one eBay search call return?

One call to /v1/ebay/search returns a page of results as named JSON fields, plus the result count, a has_more flag, related searches and the categories the results fall into. The eBay API has seven endpoints, all GET and all 1 credit per successful call: search, item, autocomplete, categories, product reviews, seller and seller feedback.

This is the recorded request, for the first 60 results for "coffee maker":

curl "https://api.perceptlayer.com/v1/ebay/search?q=coffee+maker&page=1&per_page=60" \
  -H "X-API-Key: $API_KEY"

And the recorded response, trimmed:

{
  "success": true,
  "data": {
    "query": "coffee maker",
    "page": 1,
    "per_page": 60,
    "has_more": true,
    "results": [
      {
        "product_id": "366702966104",
        "title": "Mr. Coffee 4-in-1 Single-Serve Latte, Iced, and Hot Coffee",
        "link": "https://www.ebay.com/itm/366702966104",
        "price": {
          "raw": "$60.00",
          "extracted": 60,
          "currency": "USD"
        },
        "sponsored": true,
        "subtitle": "Brand New",
        …
        "location": "United States"
      },
      {
        "product_id": "167322718667",
        "title": "New Keurig Green Mountain K4000 Cafe System Commercial K-Cup Coffee Maker",
        …
        "price": {
          "raw": "$428.98",
          "extracted": 428.98,
          "currency": "USD"
        },
        "sponsored": true,
        …
      }
    ],
    "total_results": 110000,
    "related_searches": [
      {
        "query": "keurig coffee maker",
        …
      },
      …
    ],
    "categories": [
      {
        "id": 11700,
        "name": "Home & Garden"
      },
      {
        "id": 20625,
        "name": "Kitchen, Dining & Bar"
      }
    ]
  },
  "meta": {
    "endpoint_family": "search",
    "duration_ms": 2866
  }
}

Which fields replace scraper code?

Four fields map straight onto the work described above. price.extracted is the number your price cleaner would produce, with price.raw kept beside it so you can check the conversion, and price.currency stops you mixing currencies. sponsored is the placement flag you'd otherwise hunt for in the markup; both results in this excerpt carry sponsored: true, which is a reason to filter on it before you average anything. subtitle read "Brand New" on both recorded results, so it looks like a condition line; check it on your own queries before you rely on it. product_id also appears at the end of each link, so it works as a stable key for deduplicating across runs.

The categories array returns integer id values, and the search endpoint's category parameter is an integer too, so the names and types match. Run a search with one of those IDs in the playground to see how it narrows your results before you build on it.

Which search parameters do the filtering for you?

The search endpoint takes the filters a scraper would otherwise apply by building URLs or by discarding rows after parsing. Only q is required. The others narrow results by price, listing format, condition, shipping and location, and set the page size and sort. The table lists each one with its type as documented; the eBay search endpoint page has the same reference with a playground.

Parameter Type Allowed values
q string, required up to 255 characters
category integer
page integer
per_page integer 60, 120 or 240
sort integer 1, 7, 10, 12, 15 or 16
buy_it_now boolean
auction boolean
condition[] list of integers
price_min, price_max number
free_shipping boolean
preferred_location integer
location_postal string up to 20 characters

Two of the other endpoints are small. /v1/ebay/item takes one item_id (a string of up to 20 characters) and returns an item. /v1/ebay/autocomplete takes q and returns suggestions, which is useful for building a keyword list before you track it. The item call isn't in our recordings, so try a product_id from your own search as the item_id in the playground and check the fields it returns before you plan around it.

How do an eBay scraper and the endpoints compare?

A scraper costs engineering time and carries blocking and terms risk; the endpoints cost credits per call and take parsing and upkeep off your list. The table compares them for a recurring job, such as checking prices for a list of product searches every day.

DIY eBay scraper eBay endpoints
Setup Fetcher, result-card parser, price cleaner, storage, monitoring API key in the X-API-Key header
Prices Text you convert yourself price.extracted as a number, price.raw and price.currency beside it
Sponsored results Yours to detect from markup sponsored on each result
Filters URL building or post-filtering price_min, price_max, condition[], buy_it_now, auction, free_shipping, category
When the page changes The parser breaks, often silently You read named JSON fields; there's no parser of yours to fix
Blocks and challenges Yours to handle at volume Not yours; a failed call returns an error code and costs 0
Paging Follow page links page, per_page (60, 120 or 240) and has_more
Speed As fast as you can fetch without being blocked 1 request a second free, at least 5 a second paid
Cost Hosting and your time 1 credit per successful call

A short script: median price of non-sponsored results

This Python script runs one search, drops sponsored results and prints the median of price.extracted. It reads only fields that appear in the recorded response and treats a missing price as unknown.

import os
import statistics

import requests

resp = requests.get(
    "https://api.perceptlayer.com/v1/ebay/search",
    params={"q": "coffee maker", "page": 1, "per_page": 240},
    headers={"X-API-Key": os.environ["API_KEY"]},
    timeout=60,
)
resp.raise_for_status()
data = resp.json()["data"]

kept = [r for r in data["results"] if not r.get("sponsored")]
prices = [
    r["price"]["extracted"]
    for r in kept
    if isinstance(r.get("price"), dict) and r["price"].get("extracted") is not None
]
currencies = {r["price"].get("currency") for r in kept if isinstance(r.get("price"), dict)}

print(f"{len(data['results'])} results, {len(kept)} not sponsored")
if prices:
    print("median price:", statistics.median(prices), currencies)
print("total results:", data.get("total_results"), "more pages:", data.get("has_more"))
print("credits used:", resp.headers.get("X-Credits-Used"))

Asking prices aren't sale prices, so treat the median as what sellers are asking today, not what items sell for.

What does tracking eBay prices cost per result?

Cost follows calls, and one search call returns a page of results, so the cost per result depends on how full your pages are. If a per_page=240 call comes back with 240 results, that's 1 ÷ 240, about 0.004 credits per result. At per_page=60 it's 1 ÷ 60, about 0.017. An empty or short page still costs 1 credit when the call succeeds, so broad queries are cheaper per result than narrow ones.

A typical watchlist is a set of searches, not a set of items. Checking the first 240 results for 30 product searches once a day is 30 calls × 1 credit = 30 credits a day, or 900 credits over a 30-day month. The 100 free credits on signup cover the first 3 days, and the Starter pack's 10,000 credits cover 11 months after that. Going two pages deep doubles it to 1,800 credits a month, so the Starter pack lasts 5 months.

Tracking specific items one call at a time costs more. Following 500 items through the item endpoint once a day is 500 calls × 1 credit = 500 credits a day, or 15,000 credits a month: more than the Starter pack's 10,000 and inside the Build pack's 50,000. Don't try to page through all 110,000 "coffee maker" results either; narrow the query with price_min, price_max, condition[] or category until has_more turns false at a depth you can afford. See pricing for what credits cost and the credits docs for how they're debited.

Which route should you choose?

Choose by how often you need the data and how much of it, because that decides whether upkeep or per-call cost dominates. The verdicts below assume a job that runs on a schedule; for a one-off look at a dozen listings, open eBay in a browser and skip both.

  • Price research for resale or sourcing: run search with your keywords and price band, drop sponsored results, and store product_id, price.extracted, price.currency and subtitle per run. At 240 a page it's about 0.004 credits per result.
  • Measuring how much of a results page is sponsored: count sponsored across results[] per query. A scraper can do this too, but only as long as its sponsored detection keeps working.
  • Building a keyword list: call autocomplete for seed terms and read related_searches from search, then track the queries that matter.
  • Following a few hundred known items: use the item endpoint, and budget 1 credit per item per check.
  • Learning how scraping works: build a scraper against a practice site rather than a live marketplace.
  • An agent answering shopping questions: give it the eBay endpoints through the MCP server, as the AI agents docs describe, so it calls search instead of reading pages.

For a recurring job, Incremental API Data Pulls covers storing only what changed between runs. Second-hand marketplaces elsewhere work the same way: see Vinted API and the marketplaces APIs. To check the fields for your own query, run search in the playground on the eBay API page, then get a free API key.

APIs in this post

Frequently asked questions

Is scraping eBay allowed?

That depends on eBay's terms, how you collect and use the data, and the law where you operate, so read the terms and get legal advice for commercial use. Don't get around blocks, challenges or other protections. Product facts such as titles, prices and condition carry less risk than personal data; leave sellers' and buyers' personal details out of what you store.

Does the search endpoint return sold prices?

The recorded search returns current results with price.raw, price.extracted and price.currency, which are asking prices. Nothing in the recorded response marks a result as sold, so don't treat these figures as transaction prices. Check the search and item endpoints in the playground for the fields your use case needs before you build on them.

How many results does one eBay search call return?

You choose the page size with per_page, which accepts 60, 120 or 240. The recorded call asked for 60, reported total_results: 110000 and has_more: true. Use page to go deeper, and stop when has_more is false or when you've reached the depth you budgeted for. Each successful page costs 1 credit.

Does a failed eBay call cost credits?

No. Only a successful response debits credits. A failed call returns an HTTP status and a JSON error with a code, a message and a request_id, plus X-Credits-Used: 0. A rate-limited call returns 429 with a Retry-After header giving the seconds to wait. The errors docs list every code.

How fast can I run a daily eBay price check?

Limits are per account, shared by all its keys, and counted per minute. A free account gets 1 request a second (60 a minute), so a 30-query check finishes in about 30 seconds. Paying accounts run at least 5 requests a second (300 a minute). The rate limits docs list the rate each pack includes.

  1. Etsy Scraper or API: What You Get

    An Etsy scraper vs one 10-credit product endpoint: a recorded listing with price, discount, quantity, variations and favorites, and the cost per item tracked.

  2. StockX API: Product and Resale Price Data as JSON

    Search StockX and read lowest_ask, highest_bid, last_sale and sales_last_90d as JSON at 1 credit a call, then track a sneaker list daily.

  3. Etsy API: Product Data as JSON

    One GET to /v1/etsy/product returns an Etsy listing's price, discount, stock, variations and images as JSON, at 10 credits per successful call.

Start with 100 free credits

No password to set. We email you a sign-in link, and your key works on every API.

No credit card. 100 free credits on signup.