npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ebay-scraper-api

v0.0.1

Published

Node.js client for scraping eBay search results and listings using the ScrapingBee web scraping API.

Readme

ebay-scraper-api

Node.js client for scraping eBay through the ScrapingBee web scraping API. Search eBay, pull listing data, and read sold prices as parsed JSON, with rendering, residential proxies, and extraction handled server-side. If you need an ebay scraper api in a Node service without running a headless browser, this is the wrapper.

npm install ebay-scraper-api

Free tier: 1,000 credits, no card, at scrapingbee.com.

Scrape an eBay search in a few lines

The common flow: search a keyword, then read the structured products back. This ebay web scraper returns a products array with title, price, url, and shipping for each listing.

const { EbayScraper } = require('ebay-scraper-api');

const scraper = new EbayScraper({ apiKey: 'YOUR-API-KEY' });

async function run() {
    const results = await scraper.search('nintendo switch');
    for (const item of results.products) {
        console.log(item.title, item.price);
    }
}

run();

Every method returns a Promise. Rendering and a premium proxy are on by default, because eBay needs both.

Sold prices and pagination

// real sale prices from completed listings
const sold = await scraper.search('iphone 15', { sold: true });

// walk result pages
const pageTwo = await scraper.search('iphone 15', { page: 2 });

Adding sold: true turns this into an ebay data scraper for price history, using eBay's completed-listings filter.

Scrape a specific listing or store

// rendered HTML for any eBay URL
const html = await scraper.scrape('https://www.ebay.com/itm/123456789');

// or structured JSON with your own selectors
const data = await scraper.scrape('https://www.ebay.com/str/some-store', {
    extractRules: {
        titles: { selector: 'h3.s-item__title', type: 'list' },
    },
});

API reference

new EbayScraper({ apiKey, timeout })

| Option | Type | Default | Description | | --- | --- | --- | --- | | apiKey | string | required | Your ScrapingBee API key | | timeout | number | 60000 | Request timeout in milliseconds |

.search(query, options)

| Option | API parameter | Default | Description | | --- | --- | --- | --- | | query | _nkw | required | eBay search terms | | page | _pgn | none | Result page number | | sold | LH_Complete + LH_Sold | false | Filter to completed and sold listings | | renderJs | render_js | true | Execute eBay JavaScript | | premiumProxy | premium_proxy | true | Residential proxies | | countryCode | country_code | us | eBay region | | wait | wait | 5000 | Milliseconds to wait for results | | extractRules | extract_rules | listing rules | Override the default selectors | | extra | (any) | {} | Any other documented HTML API parameter |

.scrape(url, options)

Fetch any eBay URL. Returns rendered HTML, or JSON when extractRules is passed. Accepts the same options as search.

What a search returns

The default selectors, taken from ScrapingBee's eBay guide, produce:

{
  "products": [
    {
      "title": "Nintendo Switch OLED",
      "price": "$299.99",
      "url": "https://www.ebay.com/itm/...",
      "shipping": "Free shipping"
    }
  ]
}

Fields present depend on what the listing rendered, so guard with optional chaining.

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. Current pricing: scrapingbee.com/pricing.

FAQ

How do I build an ebay product scraper with this?

Call search(query) to pull the product grid, then scrape(itemUrl) for detail pages. The default rules already return title, price, url, and shipping per product.

Why does eBay block a normal request?

eBay renders listings with JavaScript and flags default HTTP clients. Rendering plus residential proxies get past that, and both are on by default here.

Can I change which fields I extract?

Yes. Pass extractRules with your own CSS or XPath selectors, or add ai_extract_rules through extra for natural-language extraction.

Is scraping eBay allowed?

Public listing data is generally collectible for research and monitoring, but eBay's terms and local rules apply. Scrape public pages only.

Links

License

MIT. See LICENSE.

Disclaimer

Unofficial Node.js wrapper around the ScrapingBee web scraping API. Not affiliated with ScrapingBee or eBay. Compliance with eBay's terms of service and applicable law is the responsibility of the operator.