X/Twitter research pipeline for AI agents using x-tweet-fetcher with browser fallback
From README links · today
Agent fetches tweets, timelines, lists, and articles without login or API keys.
What they did
They wanted an AI agent to read X/Twitter directly instead of asking a human to copy-paste posts. Using x-tweet-fetcher (xtf), they installed the CLI from the repo and started with single-tweet fetches via the zero-dependency FxTwitter backend, which needs no login or API key. For broader coverage they stood up a local Nitter instance and pointed XTF_NITTER at it, unlocking user timelines, search, replies, mentions, and Lists over plain HTTP. When Nitter could not serve a request — most notably X Articles, and Lists as a fallback path — the tool routed to a browser driver. They configured Camofox at localhost:9377 as the default browser backend, and kept Playwright as an alternative by installing the playwright extra and setting XTF_BROWSER=playwright. They used the auto backend so the agent tries Nitter first and falls back to the browser automatically, and enabled --ledger with a SQLite database so every fetch was deduped and archived for later search and stats. They also wired --monitor for incremental mention checks on a cron schedule, and used --text-only when a human-readable dump was more useful than JSON.
How it went
The pipeline worked end to end: single tweets resolved instantly with no configuration, timelines and search ran through the local Nitter instance, and Articles and stubborn Lists succeeded via the browser driver. The unified JSON schema made it trivial to feed results into the agent and into the SQLite ledger, and the auto fallback meant the agent rarely surfaced a hard failure. Polish level is solid for a personal research tool; the main rough edge is that timeline and search quality depends entirely on the health of the self-hosted Nitter instance.
Worth knowing
Timelines, search, replies, and Lists require a working Nitter instance — the README does not ship one, so you must self-host or find a reliable mirror. X Articles and some Lists need a browser driver, which is slower and depends on Camofox running at localhost:9377 or Playwright being installed. The package is not on PyPI, so installs come from the git URL. Rate limits and X-side changes can break Nitter or FxTwitter without warning, and the ledger only dedupes what you actually fetch.
Wiring
Install order: clone or pip install from the git URL, then confirm the stdlib-only FxTwitter path with a single --url fetch. Next, run a Nitter instance locally (default port 8788) and export XTF_NITTER=http://127.0.0.1:8788 so timeline, search, replies, mentions, and Lists route over HTTP. For browser coverage, either start Camofox on localhost:9377 (the default driver) or install the playwright extra and set XTF_BROWSER=playwright or pass --browser-driver playwright. Leave the backend on auto so Nitter is tried first and the browser is the fallback; force --backend nitter when you want HTTP only. Add --ledger <db> to every invocation to archive and dedupe results in SQLite, and schedule --monitor via cron for incremental mention checks. The agent calls the xtf CLI and parses the unified JSON schema; --text-only is used for human review.
Try it yourself
Set up x-tweet-fetcher in this repo as the agent's X/Twitter reader. Install it from git (pip install git+https://github.com/ythx-101/x-tweet-fetcher), verify a single tweet fetch with --url works with zero config, then add a local Nitter instance and export XTF_NITTER so --user, --search, and --list work. Configure the browser fallback: check whether Camofox is reachable at localhost:9377, otherwise install the playwright extra and set XTF_BROWSER=playwright. Add a small wrapper script that calls xtf with --ledger ./tweets.db for every fetch, plus a --monitor cron entry for mentions. Test one X Article via --article to confirm the browser path, and document the env vars in the README.
Tools in this stack
Run this stack
Install the stack into this project. It writes AGENTS.md and the manifest, merges the MCP servers into .mcp.json, and — with --yes — runs the tool installs.
npx runchr install runchr/stack-camofox-browser-and-playwright-and-x-tweet-fetchercurl -s https://api.runchr.com/api/recipes/runchr/stack-camofox-browser-and-playwright-and-x-tweet-fetcher/manifestThis stack has no prompt yet. You get the tools and the wiring, not the prompt.
The manifest is also at api.runchr.com/api/recipes/runchr/stack-camofox-browser-and-playwright-and-x-tweet-fetcher/manifest.