NODE.JS SDK

Node.js SDK for This Web Scraper API

Official Node.js/TypeScript client with full type definitions, dual ESM/CJS builds, and built-in WebSocket streaming. Promise-based, tree-shakeable, works with any bundler or runtime.

TypeScriptDual ESM/CJSHandwritten typed client
npm install scrapebadger
QUICK START
import ScrapeBadger from 'scrapebadger';

const sb = new ScrapeBadger({ apiKey: 'YOUR_API_KEY' });

// Get user profile
const user = await sb.twitter.users.getByUsername('elonmusk');
console.log(`${user.data.name}: ${user.data.followers_count} followers`);

// Search tweets
const results = await sb.twitter.tweets.advancedSearch({
  query: 'web scraping API lang:en',
  queryType: 'Latest',
});

// Get followers
const followers = await sb.twitter.users.getFollowers('elonmusk');
followers.data.forEach(f => console.log(f.username, f.followers_count));

What's Included

✓

Full TypeScript

Ships with complete type definitions, autocomplete for every endpoint and response field.

⇄

Dual ESM/CJS

Works with any bundler or runtime, no configuration needed either way.

📡

StreamClient

Built-in class for connecting to real-time tweet streams via WebSocket.

◎

Every Product

Twitter, Google, Amazon, eBay, Vinted, Reddit, TikTok, YouTube, web scraping, and more.

🖥

Node.js Only

Designed for server-side use, for browser usage, call the REST API directly and never expose your key client-side.

⚡

Promise-Based

Clean async/await syntax throughout, no callback-style APIs.

Node.js SDK Questions

Is the SDK written in TypeScript?+

Yes, full TypeScript source with complete type definitions shipped, giving autocomplete for every endpoint and response field in your editor.

Can I use this in the browser?+

The SDK is designed for Node.js. For browser usage, call the REST API directly via fetch, never expose your API key in client-side code.

Does it support both import styles?+

Yes, the SDK ships dual ESM and CJS builds, so it works with any bundler or runtime without extra configuration.

How do I stream real-time data?+

The SDK includes a StreamClient class for connecting to real-time tweet streams via WebSocket, no separate library needed.

Start Building in Minutes

1,000 free credits, no credit card required. Same key works across every SDK, MCP, and the CLI.