Twitter/X Scraper API: Complete Guide to Extracting X Data
Need Twitter/X data without the expensive official API? This guide shows you how to scrape profiles, tweets, and engagement metrics using SociaVault's affordable alternative.
Why Use a Twitter/X Scraper API?
X's (formerly Twitter) official API pricing increased dramatically. SociaVault provides:
- Pay-per-request pricing - buy credits, not expensive monthly tiers
- High throughput - no restrictive per-tier monthly post caps to plan around
- Public data access - profiles, tweets, search, communities, and engagement metrics
- Simple integration - REST +
x-api-key, no OAuth dance
Twitter API Endpoints
| Endpoint | Description |
|---|---|
| Profile | Get user profile data |
| User Tweets | Get tweets from a user |
| Tweet | Get single tweet details |
| Tweet Transcript | Get video transcript |
| Community | Get community info |
| Community Tweets | Get community posts |
Profile Scraper
Get Twitter/X user profile data:
const response = await fetch(
"https://api.sociavault.com/v1/scrape/twitter/profile?handle=elonmusk",
{
headers: { "x-api-key": "YOUR_API_KEY" },
},
);
const profile = await response.json();
Profile Response
{
"id": "44196397",
"username": "elonmusk",
"displayName": "Elon Musk",
"bio": "Mars & Cars, Chips & Dips",
"followers": 175000000,
"following": 450,
"tweets": 35000,
"likes": 42000,
"joined": "2009-06-02",
"location": "𝕏",
"website": "https://x.com",
"profilePicture": "https://...",
"banner": "https://...",
"verified": true,
"isBlueVerified": true
}
User Tweets Scraper
Get recent tweets from any user:
const response = await fetch(
"https://api.sociavault.com/v1/scrape/twitter/user-tweets?handle=elonmusk",
{
headers: { "x-api-key": "YOUR_API_KEY" },
},
);
const tweets = await response.json();
Tweets Response
{
"tweets": [
{
"id": "1234567890123456789",
"text": "The future is going to be amazing ⚡",
"likes": 250000,
"retweets": 45000,
"replies": 12000,
"views": 15000000,
"createdAt": "2026-01-08T14:30:00Z",
"media": [
{
"type": "image",
"url": "https://..."
}
],
"isRetweet": false,
"isReply": false,
"quotedTweet": null
}
],
"hasMore": true,
"cursor": "next_page"
}
Single Tweet Details
Get detailed info about a specific tweet:
const response = await fetch(
"https://api.sociavault.com/v1/scrape/twitter/tweet?url=https://x.com/elonmusk/status/1234567890123456789",
{
headers: { "x-api-key": "YOUR_API_KEY" },
},
);
const tweet = await response.json();
Search Tweets by Keyword
Find tweets matching a keyword or query — the basis of social listening and topic monitoring. The search endpoint takes a query, an optional type, and a cursor for paging:
const response = await fetch(
"https://api.sociavault.com/v1/scrape/twitter/search?query=" +
encodeURIComponent("your brand"),
{
headers: { "x-api-key": "YOUR_API_KEY" },
},
);
const results = await response.json();
Tweet Video Transcript
Extract speech-to-text from video tweets:
const response = await fetch(
"https://api.sociavault.com/v1/scrape/twitter/tweet/transcript?url=https://x.com/user/status/1234567890123456789",
{
headers: { "x-api-key": "YOUR_API_KEY" },
},
);
const transcript = await response.json();
X Communities
Get community information and tweets:
// Community details
const community = await fetch(
"https://api.sociavault.com/v1/scrape/twitter/community?url=https://x.com/i/communities/1234567890",
{
headers: { "x-api-key": "YOUR_API_KEY" },
},
);
// Community tweets
const communityTweets = await fetch(
"https://api.sociavault.com/v1/scrape/twitter/community/tweets?url=https://x.com/i/communities/1234567890",
{
headers: { "x-api-key": "YOUR_API_KEY" },
},
);
Use Cases
Social Listening
Monitor brand mentions and sentiment:
async function monitorBrand(handle) {
const { tweets } = await getUserTweets(handle);
// Analyze sentiment
const sentiment = tweets.map((t) => ({
text: t.text,
engagement: t.likes + t.retweets,
sentiment: analyzeSentiment(t.text),
}));
return sentiment;
}
Influencer Analysis
Evaluate Twitter influencers:
async function analyzeInfluencer(handle) {
const profile = await getProfile(handle);
const { tweets } = await getUserTweets(handle);
const avgEngagement =
tweets.reduce((s, t) => s + t.likes + t.retweets + t.replies, 0) /
tweets.length;
return {
handle: profile.username,
followers: profile.followers,
avgEngagement,
engagementRate:
((avgEngagement / profile.followers) * 100).toFixed(3) + "%",
};
}
Track Tweet Performance
Monitor how tweets perform:
async function trackTweet(tweetUrl) {
const tweet = await getTweet(tweetUrl);
await saveSnapshot({
tweetId: tweet.id,
likes: tweet.likes,
retweets: tweet.retweets,
views: tweet.views,
timestamp: new Date(),
});
}
Related Endpoints
- Instagram Profile - Instagram data
- TikTok Profile - TikTok data
- LinkedIn Profile - LinkedIn data
- Threads Scraper - Meta's Threads
Frequently Asked Questions
How does this compare to X's official API?
SociaVault provides similar data at a fraction of the cost. You pay per request instead of expensive monthly tiers.
Can I get historical tweets?
Yes, you can access a user's tweet history through pagination.
Are retweets and replies included?
Yes, user tweets include retweets and replies. You can filter by isRetweet and isReply fields.
Can I search tweets by keyword?
Yes. The search endpoint (/scrape/twitter/search) finds tweets matching a query, with pagination via a cursor — useful for brand monitoring and topic tracking. You can also retrieve tweets per user with the user-tweets endpoint when you want to follow specific accounts.
Is this legal to use?
SociaVault accesses publicly available data visible to any X user. Always use data responsibly.
Get Started
Sign up free and start extracting Twitter/X data affordably.
Documentation: API Reference - Twitter Profile
Found this helpful?
Share it with others who might benefit
Ready to Try SociaVault?
Start extracting social media data with our powerful API. No credit card required.