
X.com Twitter API Scraper
Pricing
$0.40 / 1,000 tweets

X.com Twitter API Scraper
Scrape Twitter (X) data efficiently with this powerful Apify Actor. Real-time, authentic data. No pre-built databases. Extract tweets, user profiles, and more using keywords, hashtags, URLs, and advanced search filters. Fast, reliable, and cost-effective. #TwitterScraper
5.0 (1)
Pricing
$0.40 / 1,000 tweets
5
Total users
165
Monthly users
81
Runs succeeded
>99%
Issue response
5 hours
Last modified
7 days ago
You can access the X.com Twitter API Scraper programmatically from your own applications by using the Apify API. You can also choose the language preference from below. To use the Apify API, you’ll need an Apify account and your API token, found in Integrations settings in Apify Console.
1import { ApifyClient } from 'apify-client';2
3// Initialize the ApifyClient with your Apify API token4// Replace the '<YOUR_API_TOKEN>' with your token5const client = new ApifyClient({6 token: '<YOUR_API_TOKEN>',7});8
9// Prepare Actor input10const input = {11 "startUrls": [12 "https://twitter.com/apify",13 "https://twitter.com/search?q=apify%20&src=typed_query"14 ],15 "searchTerms": [16 "web scraping",17 "scraping from:apify"18 ],19 "twitterHandles": [20 "elonmusk",21 "taylorswift13"22 ],23 "maxItems": 50,24 "sort": "Latest",25 "tweetLanguage": "en",26 "start": "2021-07-01",27 "end": "2021-07-02",28 "customMapFunction": (object) => { return {...object} }29};30
31// Run the Actor and wait for it to finish32const run = await client.actor("xtdata/twitter-x-scraper").call(input);33
34// Fetch and print Actor results from the run's dataset (if any)35console.log('Results from dataset');36console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);37const { items } = await client.dataset(run.defaultDatasetId).listItems();38items.forEach((item) => {39 console.dir(item);40});41
42// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs
X.com Twitter API Scraper API in JavaScript
The Apify API client for JavaScript is the official library that allows you to use X.com Twitter API Scraper API in JavaScript or TypeScript, providing convenience functions and automatic retries on errors.
Install the apify-client
$npm install apify-client
Other API clients include: