The official Node.js/TypeScript client library for the ScrapeBadger API — Twitter, Google, Vinted, and general web scraping.
Features
- Full TypeScript Support - Complete type definitions for all API endpoints
- Modern ESM & CommonJS - Works with both module systems
- Async Iterators - Automatic pagination with
for await...of syntax
- Resilient Retries - Exponential backoff with colored console warnings
- Typed Exceptions - Distinct error classes for every failure scenario
- Async requests and webhooks - Run any call asynchronously, wait for it or get a signed webhook; idempotent resubmits
- 37+ Twitter endpoints - Tweets, users, lists, communities, trends, geo, real-time streams
- 20 Google product APIs - Search (with optional deferred AI Overview follow-up and result link resolving), Maps, News, Hotels, Trends (incl. topic autocomplete), Jobs, Shopping (+ merchant URL enrichment, barcode offers), Patents, Scholar (search + profiles + author + author citation + cite formats), Images, Videos, Finance, AI Mode, Lens, Local Pack, Shorts, Flights, Products, Ads Transparency Center
- Vinted scraping - Search items, item details, user profiles, brands, colors, markets
- Web scraping - Anti-bot bypass, JS rendering, screenshots, and selector/AI data extraction
Installation
npm install scrapebadger
yarn add scrapebadger
pnpm add scrapebadger
Quick Start
import { ScrapeBadger } from "scrapebadger";
const client = new ScrapeBadger({ apiKey: "your-api-key" });
// Get a tweet
const tweet = await client.twitter.tweets.getById("1234567890");
console.log(`@${tweet.username}: ${tweet.text}`);
// Scrape a website
const result = await client.web.scrape("https://scrapebadger.com", { format: "markdown" });
console.log(result.content);
// Get a user profile
const user = await client.twitter.users.getByUsername("elonmusk");
console.log(`${user.name} has ${user.followers_count.toLocaleString()} followers`);
Authentication
// Pass API key directly
const client = new ScrapeBadger({ apiKey: "sb_live_xxxxxxxxxxxxx" });
// Or use environment variable SCRAPEBADGER_API_KEY
const client = new ScrapeBadger();
Dedicated ecommerce APIs
The etsy, aliexpress, target, asos, and bestbuy clients expose 44 dedicated ecommerce endpoints. These generated methods return response objects; consult the endpoint documentation for response fields, supported filters, pagination and current pricing.
const client = new ScrapeBadger({ apiKey: "your-api-key" });
const etsy = await client.etsy.searchListings({ query: "ceramic mug" });
const aliexpress = await client.aliexpress.searchProducts({ query: "wireless mouse" });
const target = await client.target.searchProducts({ query: "coffee" });
const asos = await client.asos.searchProducts({ query: "shoes", market: "uk" });
const bestbuy = await client.bestbuy.searchProducts({ query: "laptop" });
| Client |
Endpoints |
Documentation |
client.etsy |
8 — listing search/detail/reviews, shop profile/listings/reviews, categories, autocomplete |
Etsy |
client.aliexpress |
8 — product search/detail/reviews, store profile/products/categories, category navigation, autocomplete |
AliExpress |
client.target |
11 — search, category browse/navigation, autocomplete, product detail/reviews/questions/availability, nearby stores/store detail, markets |
Target |
client.asos |
7 — product search/detail, stock/prices, category navigation, search filters, autocomplete, markets |
ASOS |
client.bestbuy |
10 — search, category browse/navigation, deals, autocomplete, product detail/reviews/questions/availability, markets |
Best Buy |
Etsy and AliExpress category navigation is separate from search: their search methods do not offer a category filter. ASOS search follows its upstream semantic matching. Target and Best Buy serve the US market. The linked endpoint references describe further measured limits.
Available APIs