A TypeScript package for scraping tweets from Nitter without authentication.
# Install as a library
npm install nitter-scraper
# Or install globally to use as CLI
npm install -g nitter-scraper
import { fetchTweets } from "nitter-scraper";
async function main() {
const tweets = await fetchTweets("username", 3); // username without @, max pages (optional)
console.log(`Found ${tweets.length} tweets`);
}
main().catch(console.error);
# Run the scraper using Bun
bun run cli
# Or if installed globally
nitter-scraper
- Fetches tweets from Nitter without authentication
- Handles pagination automatically
- Built-in rate limiting protection
- TypeScript support
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;
}
MIT