Nitter Scraper
A TypeScript package for scraping tweets from Nitter without authentication.
Installation
npm install nitter-scraper
npm install -g nitter-scraper
Usage
As a Library
import { fetchTweets } from "nitter-scraper";
async function main() {
const tweets = await fetchTweets("username", 3);
console.log(`Found ${tweets.length} tweets`);
}
main().catch(console.error);
As a CLI Tool
bun run cli
nitter-scraper
Features
- Fetches tweets from Nitter without authentication
- Handles pagination automatically
- Built-in rate limiting protection
- TypeScript support
API
fetchTweets(username: string, maxPages?: number): Promise<Tweet[]>
Parameters:
username
: Twitter username to scrape (without @)
maxPages
: Maximum number of pages to fetch (default: 3)
interface Tweet {
id: string;
text: string;
username: string;
created_at: string;
timestamp: number | null;
}
License
MIT