Back to all posts

How to Scrape Twitter/X Data in 2026 (Without Getting Blocked)

Jonathan Geiger
Twitter APIX APIData ScrapingSocial Media Data

Twitter/X has roughly 600 million monthly active users and is still where markets move, news breaks, and brands live or die in real time. For anyone building brand monitoring tools, lead gen pipelines, research datasets, or AI applications that consume social content, X data is irreplaceable.

The problem is that getting it programmatically is harder than it's ever been — and getting harder every year.

Why Twitter/X Scraping Is Hard in 2026

When Elon Musk acquired Twitter in late 2022, one of the earliest changes was to API access. The free v2 API tier that developers had relied on for years was gutted and eventually shut down. What replaced it:

  • Free tier: 1 app, 1 user, barely functional for real workloads
  • Basic: $100/month for 500K tweet reads — tight for production use
  • Pro: $5,000/month
  • Enterprise: Custom, starts well above that

Beyond pricing, the v2 API still requires OAuth app approval, limits which fields you can access per endpoint, and doesn't expose things like video transcripts at all. It's a restricted subset of what you can see with your own eyes on the platform.

The Three Approaches

1. Official API: You pay $100–$5,000/month, go through OAuth approval, work within rate limits, and get access to a curated subset of the data. If you're a large enterprise with a compliance requirement and $5K/month to spend, this is the safe choice. For most developers, it's not viable.

2. Headless browsers: Puppeteer, Playwright, and Selenium can automate X in a browser. The catch: Twitter/X has invested heavily in bot detection. Cloudflare challenges, rotating session tokens, fingerprint-based detection, and CAPTCHA flows make headless scraping extremely fragile. You'll spend more time maintaining the scraper than using the data, and any platform update can break everything overnight.

3. Scraping API: A third-party API that handles all the infrastructure — proxies, session management, anti-bot bypasses — and returns clean structured JSON for each request. No OAuth, no Cloudflare fights, no maintenance. You pay per call instead of per month for API access.

For most developers, option 3 is the right call. Here's how to use it.


Getting Twitter/X Data with SocialKit

SocialKit's Twitter APIs cover four endpoints: profiles, tweet feeds, individual tweets, and video transcripts. All you need is an access_key — no OAuth, no app approval, no tokens to rotate.

1. Get a Twitter/X Profile

Pull follower count, bio, tweet count, and account metadata from any public profile.

curl "https://api.socialkit.dev/twitter/profile?access_key=YOUR_KEY&url=https://x.com/OpenAI"

Example response:

{
  "id": "1318531581616402437",
  "name": "OpenAI",
  "username": "OpenAI",
  "description": "OpenAI is an AI research and deployment company. Our mission is to ensure that artificial general intelligence benefits all of humanity.",
  "followers_count": 4200000,
  "following_count": 12,
  "tweet_count": 3847,
  "verified": true,
  "profile_image_url": "https://pbs.twimg.com/profile_images/...",
  "created_at": "2020-10-20T17:00:00.000Z"
}

2. Get Tweets from an Account

Fetch recent tweets from any public account with engagement metrics included.

curl "https://api.socialkit.dev/twitter/tweets?access_key=YOUR_KEY&url=https://x.com/sama&limit=20"

Example response:

{
  "tweets": [
    {
      "id": "1892564834821029888",
      "text": "the world is going to change so much over the next few years",
      "created_at": "2026-02-20T18:00:00.000Z",
      "like_count": 45000,
      "retweet_count": 8200,
      "reply_count": 3100,
      "view_count": 12000000,
      "url": "https://x.com/sama/status/1892564834821029888"
    }
  ],
  "count": 20
}

The limit parameter accepts values up to 100. Each tweet in the response includes text, timestamps, and the four main engagement metrics.


3. Get a Single Tweet

Fetch complete data for a specific tweet by its URL — useful when you already know which tweet you want and need its full metadata.

curl "https://api.socialkit.dev/twitter/tweet?access_key=YOUR_KEY&url=https://x.com/elonmusk/status/1519480761749016577"

Example response:

{
  "id": "1519480761749016577",
  "text": "Twitter has exceptional potential. I look forward to working with the company and the community of users to unlock it.",
  "created_at": "2022-04-28T06:47:00.000Z",
  "author": {
    "name": "Elon Musk",
    "username": "elonmusk",
    "followers_count": 194000000
  },
  "like_count": 287000,
  "retweet_count": 32000,
  "reply_count": 54000,
  "view_count": 98000000
}

4. Get a Video Transcript

This is the capability the official API doesn't offer at all. You can pull full spoken-word transcripts from Twitter/X video posts — with timestamps per segment.

curl "https://api.socialkit.dev/twitter/transcript?access_key=YOUR_KEY&url=https://x.com/starter_story/status/2071077368001876345"

Example response:

{
  "transcript": "Today I want to walk you through how we went from zero to a million dollars in annual revenue without any outside funding...",
  "segments": [
    { "start": 0.0, "end": 3.8, "text": "Today I want to walk you through" },
    { "start": 3.8, "end": 9.2, "text": "how we went from zero to a million dollars in annual revenue without any outside funding" }
  ],
  "duration": 183.4,
  "language": "en"
}

Code Examples

Here's a simple Python wrapper that applies the same pattern to any of the four endpoints:

import requests

BASE_URL = "https://api.socialkit.dev"

def twitter_api(endpoint, access_key, **params):
    response = requests.get(
        f"{BASE_URL}/twitter/{endpoint}",
        params={"access_key": access_key, **params}
    )
    response.raise_for_status()
    return response.json()

# Examples
profile = twitter_api("profile", "YOUR_KEY", url="https://x.com/OpenAI")
tweets  = twitter_api("tweets", "YOUR_KEY", url="https://x.com/sama", limit=20)
tweet   = twitter_api("tweet", "YOUR_KEY", url="https://x.com/elonmusk/status/1519480761749016577")
transcript = twitter_api("transcript", "YOUR_KEY", url="https://x.com/starter_story/status/2071077368001876345")

And the same in Node.js:

const BASE = "https://api.socialkit.dev";

async function twitterApi(endpoint, accessKey, params = {}) {
  const query = new URLSearchParams({ access_key: accessKey, ...params });
  const res = await fetch(`${BASE}/twitter/${endpoint}?${query}`);
  if (!res.ok) throw new Error(`API error: ${res.status}`);
  return res.json();
}

// Examples
const profile = await twitterApi("profile", "YOUR_KEY", { url: "https://x.com/OpenAI" });
const tweets  = await twitterApi("tweets",  "YOUR_KEY", { url: "https://x.com/sama", limit: 20 });

Use Cases

Brand monitoring: Pull recent tweets from accounts that mention your brand or competitors. Track engagement trends week over week. Alert when a tweet is going viral before it's too late to respond.

Lead generation: Find accounts tweeting about a problem your product solves. Pull their profile data — follower count, bio, post frequency — to qualify leads before outreach. Combine with the tweets endpoint to understand their context.

Research pipelines: Build structured datasets from public Twitter data — tweet feeds, engagement stats, account metadata — ready for analysis or export to a spreadsheet or database.

AI and LLM applications: Feed tweet text and video transcripts into LLM pipelines for sentiment analysis, topic clustering, or competitive intelligence. The transcript endpoint is especially useful here — Twitter video is a source most other tools can't touch.

Content analysis: Monitor what your competitors are posting, which formats drive engagement, and what topics are resonating. The tweet feed endpoint makes it easy to pull a batch and run analysis across it.


Pricing

Each API call costs 1 credit. All Twitter endpoints are included on every plan:

PlanCreditsPrice
Free20$0
Basic2,000/month$13/mo
Pro10,000/month$27/mo
Ultimate50,000/month$95/mo

Start on the free tier — 20 credits is enough to test all four endpoints and validate the data before committing to a paid plan.


Ready to get started? Explore the Twitter API documentation or sign up for a free account to get your access key.