NEW AI Studio is now available Try it now
Social

Twitter/X Scraper

Extract tweets, user profiles, engagement metrics, and trending topics from X (Twitter). Powered by spider-browser .

Get Started Documentation
x.com target
99.5% success rate
~4ms latency
Quick Start

Extract data in minutes

twitter-scraper.ts
import { SpiderBrowser } from "spider-browser";

const spider = new SpiderBrowser({
  apiKey: process.env.SPIDER_API_KEY!,
  stealth: 2,
});

await spider.connect();
const page = spider.page!;
await page.goto("https://x.com/OpenAI");
await page.content(12000);

const data = await page.evaluate(`(() => {
  const tweets = [];
  document.querySelectorAll("article[data-testid='tweet']").forEach(el => {
    const text = el.querySelector("[data-testid='tweetText']")?.textContent?.trim();
    const time = el.querySelector("time")?.getAttribute("datetime");
    const likes = el.querySelector("[data-testid='like'] span")?.textContent?.trim();
    const retweets = el.querySelector("[data-testid='retweet'] span")?.textContent?.trim();
    if (text) tweets.push({ text: text.slice(0, 280), time, likes, retweets });
  });
  return JSON.stringify({ total: tweets.length, tweets: tweets.slice(0, 10) });
})()`);

console.log(JSON.parse(data));
await spider.close();
✓ ready to run | spider-browser | TypeScript
Fetch API

Structured data endpoint

Extract structured JSON from x.com with a single POST request. AI-configured selectors, cached for fast repeat calls.

POST /fetch/x.com/
Tweet textAuthorLikesRetweetsRepliesTimestamp
curl
curl -X POST https://api.spider.cloud/fetch/x.com/ \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"return_format": "json"}'
Python
import requests

resp = requests.post(
    "https://api.spider.cloud/fetch/x.com/",
    headers={
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json",
    },
    json={"return_format": "json"},
)
print(resp.json())
Node.js
const resp = await fetch("https://api.spider.cloud/fetch/x.com/", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ return_format: "json" }),
});
const data = await resp.json();
console.log(data);
Extraction

Data you can extract

Tweet textAuthorLikesRetweetsRepliesTimestampMediaHashtags
Stealth

Platform bypass

Residential proxies and fingerprint rotation for x.com access.

Rendering

SPA rendering

Full JavaScript execution for React-based feeds and dynamic content.

Data

Profile & post data

Extract public profiles, posts, engagement metrics, and connections.

Related

More Social scrapers

Start scraping x.com

Get your API key and start extracting data in minutes.