
X.com Twitter API Scraper
Pricing
$0.50 / 1,000 results

X.com Twitter API Scraper
Scrape Twitter (X) data efficiently with this powerful Apify Actor. Extract tweets, user profiles, and more using keywords, hashtags, URLs, and advanced search filters. Get historical data for analysis, research, and competitive intelligence. Fast, reliable, and cost-effective. #TwitterScraper
5.0 (1)
Pricing
$0.50 / 1,000 results
4
Monthly users
67
Runs succeeded
94%
Response time
0.39 hours
Last modified
4 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 token
4// Replace the '<YOUR_API_TOKEN>' with your token
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9// Prepare Actor input
10const 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 finish
32const 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:
Pricing
Pricing model
Pay per resultThis Actor is paid per result. You are not charged for the Apify platform usage, but only a fixed price for each dataset of 1,000 items in the Actor outputs.
Price per 1,000 items
$0.50