Integration
X Scraper No Api
Free, self-hosted X (Twitter) scraper no API key, no credits. Uses your own browser session via Playwright. Export tweets, search results & timelines as LLM-ready JSON/CSV/Markdown. Ships an AI agent Skill for OpenClaw & Hermes.
Install
npm install github:JoinArtisanVent/x-scraper-no-api
Configuration Example
{
"id": "1846987139428634858",
"url": "https://x.com/nasa/status/1846987139428634858",
"created_at": "Wed Oct 16 12:34:56 +0000 2026",
"text": "Liftoff! โฆ",
"lang": "en",
"author": { "username": "nasa", "name": "NASA", "verified": true, "followers": 80000000 },
"metrics": { "replies": 1200, "reposts": 4800, "likes": 32000, "views": 1500000 },
"hashtags": ["EuropaClipper"],
"media": [{ "type": "photo", "url": "https://pbs.twimg.com/media/โฆ" }],
"scraped_at": "2026-09-26T10:00:00.000Z"
}
README
<div align="center">
# ๐๏ธ x-scraper-no-api
### The free, self-hosted X (Twitter) scraper. No API key. No credits. No middleman.
[](LICENSE)
[](https://nodejs.org)
[](https://playwright.dev)
[](skills/x-scraper-no-api/SKILL.md)
[](CONTRIBUTING.md)
**Your browser. Your session. Your data. Running entirely on your machine.**
[Quickstart](#-quickstart-macos) ยท [Why no-API](#-why-no-api) ยท [For AI agents](#-built-for-ai-agents) ยท [For developers](#-for-developers) ยท [FAQ](#-faq)
</div>
---
The X API costs **$100โ$5,000+/month**. Hosted scraper services bill you **per tweet** and hold your data on their servers. Meanwhile, your own browser already shows you everything you need โ for free.
**x-scraper-no-api** turns that browser into a clean data pipeline. You log in **once, manually**, in a real browser window. After that, one command exports search results, timelines, and threads as **LLM-ready JSON, CSV, or Markdown** โ straight to your disk, never through a third party.
## โจ Features
- ๐ **Zero API keys** โ no developer account, no app approval, no billing page
- ๐๏ธ **Manual login, once** โ your password and 2FA never touch this tool; the browser session persists like any normal browser
- ๐ง **LLM-ready output** โ JSON, JSONL, CSV, or token-friendly Markdown built for AI agent context windows
- ๐ค **Agent-native** โ ships a ready-to-install [Skill](skills/x-scraper-no-api/SKILL.md) for **OpenClaw**, **Hermes**, and any CLI-capable agent
- ๐ฏ **Full X search syntax** โ `from:`, `since:`, `until:`, `min_faves:`, `filter:media`, `lang:` and every advanced operator
- ๐งฑ **Resilient parsing** โ reads the structured GraphQL data X sends its own frontend instead of scraping fragile HTML class names
- ๐ข **Polite by design** โ human-like pacing, hard item caps, automatic backoff when X signals pressure
- ๐ **Private** โ everything runs locally; nothing is proxied, relayed, or uploaded anywhere
## โ๏ธ Why no-API?
| | Official X API | Hosted scraper APIs | **x-scraper-no-api** |
|---|---|---|---|
| Cost | $100โ$42,000/mo | Per-tweet credits | **$0, forever** |
| Signup friction | Developer account + approval | Account + card | **None** |
| Your query data | X's servers | Third-party servers | **Your machine only** |
| Rate limits | Plan-capped | Credit-capped | **Politeness-capped** |
| Vendor lock-in | Yes | Yes | **No โ MIT licensed** |
| AI agent skill | DIY | Sometimes | **Built in** |
## ๐ Quickstart (macOS)
Three steps. Two minutes.
**1. Install Xcode Command Line Tools** (needed for native builds):
```bash
xcode-select --install
```
**2. Install Node.js** โ grab the official installer or nvm from [nodejs.org/en/download](https://nodejs.org/en/download) (Node 18 or newer).
**3. Install the scraper:**
```bash
mkdir -p 'xscraper' && cd 'xscraper' && npm install github:JoinArtisanVent/x-scraper-no-api
```
Then finish setup and log in manually (one time):
```bash
npx playwright install chromium
npx xscraper login # a browser opens โ sign into X yourself
```
That's it. Your session lives in `~/.xscraper/` and every future run is headless.
## ๐ Usage
```bash
# Search โ full X advanced-search syntax
xscraper search "from:openai since:2026-01-01 min_faves:500" --limit 50 --format md
# The Latest tab instead of Top
xscraper search "ai agents" --latest --limit 25
# A public timeline
xscraper timeline @nasa --limit 100 --format csv -o nasa.csv
# One post + its public replies
xscraper tweet https://x.com/nasa/status/1846987139428634858 --format json
```
| Flag | What it does |
|---|---|
| `--limit <n>` | Max items (default 50, hard cap 200 โ by design) |
| `--format` | `json` ยท `jsonl` ยท `csv` ยท `md` (Markdown = best for LLMs) |
| `-o <file>` | Write to a file instead of stdout |
| `--headed` | Watch the browser work (debugging) |
<details>
<summary><b>Sample record (JSON)</b></summary>
```json
{
"id": "1846987139428634858",
"url": "https://x.com/nasa/status/1846987139428634858",
"created_at": "Wed Oct 16 12:34:56 +0000 2026",
"text": "Liftoff! โฆ",
"lang": "en",
"author": { "username": "nasa", "name": "NASA", "verified": true, "followers": 80000000 },
"metrics": { "replies": 1200, "reposts": 4800, "likes": 32000, "views": 1500000 },
"hashtags": ["EuropaClipper"],
"media": [{ "type": "photo", "url": "https://pbs.twimg.com/media/โฆ" }],
"scraped_at": "2026-09-26T10:00:00.000Z"
}
```
</details>
## ๐ค Built for AI agents
This repo ships an agent **Skill** at [`skills/x-scraper-no-api/SKILL.md`](skills/x-scraper-no-api/SKILL.md) โ a portable manifest that teaches agents how (and how *not*) to use the tool.
- **OpenClaw / Hermes**: point your agent at the `skills/` directory, or copy `SKILL.md` into your agent's skills folder.
- **Any LLM script**: shell out to the CLI and feed stdout into your prompt โ see [`examples/agent-workflow.md`](examples/agent-workflow.md).
```python
import subprocess
ctx = subprocess.run(
["xscraper", "search", "local-first software", "--limit", "50", "--format", "md"],
capture_output=True, text=True, timeout=600,
).stdout # ready for your prompt
```
The Skill enforces a safety contract: public data only, small limits, no credential handling, scraped content treated as untrusted input.
## ๐ ๏ธ For developers
Want to hack on it? Welcome โ this project lives or dies by community maintenance.
**Architecture** (deliberately small โ 5 files):
```
src/
โโโ cli.js # Commander CLI
โโโ session.js # Persistent Playwright profile + manual login
โโโ scraper.js # GraphQL response interception + normalization
โโโ ratelimit.js # Human pacing, hard caps, backoff
โโโ output.js # JSON / JSONL / CSV / Markdown writers
skills/x-scraper-no-api/SKILL.md # Agent Skill manifest
```
**How it works:** we never call X's internal endpoints directly. A real Chromium instance loads x.com exactly as it does for a human; we passively capture the GraphQL JSON X streams to its own frontend and normalize it into a stable schema. When X redesigns its markup, we don't break โ we never read the markup.
**Contributing:** see [CONTRIBUTING.md](CONTRIBUTING.md). The most valuable PRs are parser-robustness fixes, new job types (lists, trends), and fixture tests for the normalizer. PRs adding CAPTCHA bypass, proxy rotation, or credential handling will be declined โ compliance is a feature here.
**Roadmap**
- [ ] List and community job types
- [ ] Fixture-based test suite for the normalizer
- [ ] Scheduled/resumable runs with checkpoints
- [ ] MCP server wrapper
- [ ] Linux/Windows install one-liners
## ๐ก๏ธ Responsible use & legal
This tool is built to stay on the right side of the line:
- โ
**Public posts only** โ protected accounts, DMs, and restricted content are not supported and never will be
- โ
**You authenticate yourself** โ manual login in your own browser; the tool never sees credentials, cookies, or 2FA codes
- โ
**No circumvention** โ no CAPTCHA solving, no proxy rotation, no account pooling, no rate-limit evasion
- โ
**Paced like a human** โ conservative delays, small caps, automatic cooldowns
- ๐ Results may contain personal data โ have a lawful purpose, minimize storage, honor deletion requests (GDPR & friends apply)
- โ๏ธ You are responsible for complying with [X's Terms of Service](https://x.com/en/tos) and applicable law in your jurisdiction
> **Disclaimer:** This is an independent, community-maintained open-source project. It is **not affiliated with, endorsed by, or sponsored by X Corp.** "Twitter" and "X" are trademarks of X Corp. No X Corp code, assets, or proprietary material is included in this repository.
## โ FAQ
**Do I need an X account?**
Yes โ X removed anonymous browsing years ago. You log in manually once, in your own browser. Use an account you're comfortable browsing with.
**Will my account get banned?**
The tool paces itself conservatively and caps every run. No tool can guarantee zero risk โ keep limits modest and don't run it around the clock.
**Why 200 items max?**
Deliberately. This is a research and agent-context tool, not a bulk-harvesting machine. Two focused 50-item searches beat one giant trawl.
**It returned fewer results than my limit!**
The timeline was exhausted โ that's normal, not a bug.
**Windows/Linux?**
Everything except the Quickstart wording is cross-platform โ install Node 18+, then the same `npm install github:โฆ` line works everywhere.
**Why does login open a real browser?**
Because that's the point. Manual login means no credential handling, no automation-detection games, and a session X itself issued.
---
<div align="center">
**If this saved you an API bill, a โญ helps others find it.**
MIT ยฉ [JoinArtisanVent](https://github.com/JoinArtisanVent) ยท Not affiliated with X Corp.
</div>
integration
Comments
Sign in to leave a comment