How to scrape eBay
Extract eBay listing titles, prices, bids, shipping and seller data as validated JSON, without rebuilding selectors every time the layout changes.
- Site:
- ebay.com
- Difficulty:
- Medium
- Rendering:
- JavaScript-rendered
- Anti-bot:
- Rate limiting, Bot detection
What you can extract from eBay
These are the fields teams most often pull from ebay.com, and why a hand-written selector for each one tends to break over time.
| Field | Type | Why selectors break |
|---|---|---|
| title | string | Listing titles render inside different containers for auction, Buy It Now and multi-variation listings, so a single selector misses entire listing types. |
| price | string | Price markup differs between fixed-price, auction and best-offer listings, and currency is locale-dependent, so a fixed selector grabs the wrong value or none at all. |
| shipping | string | Shipping cost can be free, calculated, or location-dependent, and it loads after the main content, defeating selectors that read the DOM too early. |
| bids | number | The bid count only exists on auction listings, so a selector written against an auction page throws or returns null on every fixed-price item. |
| condition | string | Item condition is shown as free text that varies by category ("New", "Pre-owned", "Open box", "For parts"), so a selector that assumes a fixed vocabulary misclassifies a large share of listings. |
| seller | string | The seller block moves between the header and the sidebar depending on listing type, and its feedback score loads asynchronously, so a fixed selector captures the wrong node or an empty one. |
The schema-first approach
Instead of maintaining selectors, you hand Extracto a JSON schema describing the shape you want. Here is a schema that works for eBay:
{
"title": "string",
"price": "string",
"currency": "string",
"shipping": "string",
"condition": "string",
"seller": "string"
} - 1
Describe the eBay fields you want
Write a small JSON schema listing the fields to pull from ebay.com (for example title, price, shipping). No CSS selectors or XPath needed.
- 2
Send the URL and schema to Extracto
POST the eBay page URL and your schema to the Extracto API. Extracto renders the page in a real browser, handling JavaScript and dynamic content automatically.
- 3
Get schema-validated JSON back
Extracto returns JSON that matches your schema exactly, validated before it leaves the API, so your pipeline never receives broken or partial data.
Common pitfalls when scraping eBay
- eBay mixes auction, Buy It Now and multi-variation listings under similar URLs, so one selector set rarely covers all listing types and silently drops data on the ones it was not written for.
- Prices and shipping are often injected after the initial render, so fetching raw HTML without executing JavaScript returns incomplete listings.
- Scraping while signed in or at high frequency triggers bot detection quickly; public listing data should be read politely and without authentication.
Is it legal to scrape eBay?
eBay's User Agreement restricts automated access, and eBay offers official APIs (Browse, Finding) that are the sanctioned route for most listing data. Public listing fields such as title, price and shipping are facts, but seller usernames and buyer information are personal data. Keep request volume modest, respect robots.txt, avoid authenticated areas, and prefer the official API for anything at scale. Collect only the public fields you actually need.
Extracto follows robots.txt by default and rate-limits politely. You are responsible for compliance with eBay's terms and applicable law (GDPR, CCPA) in your use case.