Skip to main content

ebay-web-scraper

Scrape eBay search results and listings into parsed JSON. A thin Python wrapper over the ScrapingBee web scraping API that renders eBay, routes through residential proxies, and extracts fields using the CSS selectors from ScrapingBee's eBay guide.

pip install ebay-web-scraper

Covers the searches people run: ebay scraper, ebay scraper api, ebay web scraper, ebay data scraper, ebay product scraper. Requires Python 3.8+ and requests.

30-second example

from ebay_web_scraper import EbayScraper

scraper = EbayScraper(api_key="YOUR_API_KEY")

results = scraper.search("nintendo switch")
for item in results["products"]:
    print(item.get("title"), item.get("price"))

Grab a key first. ScrapingBee gives 1,000 credits with no card at scrapingbee.com.

The client

EbayScraper(api_key: str, timeout: int = 60)

Every request renders JavaScript and uses a premium (residential) proxy by default, because eBay needs both. The client serializes extraction rules and builds eBay URLs for you.

Methods

search(query, page=None, sold=False, **kwargs)

Search eBay and return structured listings. Returns a dict with a products list.

Argument Purpose
query Search terms (required)
page Page number for pagination (_pgn)
sold True filters to completed and sold listings
render_js Execute eBay JavaScript (default True)
premium_proxy Residential proxies (default True)
country_code eBay region (default "us")
wait Milliseconds to wait for results (default 5000)
extract_rules Override the default listing selectors
extra Dict of any other documented HTML API parameter

Each product carries the fields defined by the default rules: title, price, url, and shipping.

scrape(url, extract_rules=None, **kwargs)

Fetch any eBay URL, such as a single product page, a store, or a category. Returns rendered HTML by default, or JSON when you pass extract_rules.

Selectors

The default extraction targets eBay search results with the selectors from ScrapingBee's guide:

{
    "products": {
        "selector": "li.s-card",
        "type": "list",
        "output": {
            "title": "div.s-card__title span.su-styled-text",
            "price": "span.s-card__price",
            "url": {"selector": "a.s-card__link:not(.image-treatment)", "output": "@href"},
            "shipping": "div.s-card__attribute-row",
        },
    }
}

When eBay changes its markup, pass your own extract_rules, or add ai_extract_rules through extra for natural-language extraction.

Sold prices and pagination

# real sale prices from completed listings
sold = scraper.search("iphone 15", sold=True)

# walk result pages
page_two = scraper.search("iphone 15", page=2)

Credits

ScrapingBee bills successful requests. An eBay search with rendering and a premium proxy costs 25 credits. CSS extraction adds nothing; ai_extract_rules adds 5. See scrapingbee.com/pricing.

Notes

  • Scrape public eBay pages only. ScrapingBee's terms prohibit scraping behind a login.
  • Selectors reflect eBay's current search markup and may need updating over time.

License

MIT

Disclaimer

Unofficial Python client built on the ScrapingBee web scraping API. Not affiliated with ScrapingBee or eBay. Comply with eBay's terms of service and applicable law.

Metadata

Release files for ebay-web-scraper 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ebay-web-scraper 0.0.1
File Size Uploaded
ebay_web_scraper-0.0.1.tar.gz 4.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ebay-web-scraper 0.0.1
File Interpreter ABI Platform
ebay_web_scraper-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 10.2 kB

Release files / ebay_web_scraper-0.0.1.tar.gz

Download URL ebay_web_scraper-0.0.1.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
62cde5d387b4f4dcd6df77d0c831486d9ada304040f954c6fbc20ab6f0ba3aac
BLAKE2b-256 checksum
How to use checksums
7d28d1c32d1f906e93ca8d7083d3e95da910607b876e86324510a9c8d4a6bb2f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / ebay_web_scraper-0.0.1-py3-none-any.whl

Download URL ebay_web_scraper-0.0.1-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
da882b66a44cc87b9bfdb7ec037a977b50ba78f67747c2d0fcb2a518cdab6598
BLAKE2b-256 checksum
How to use checksums
bc2e679634e3f0a94054ca2b7f2ba053fcfed624f3cd8213e99530dfd4b120f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page