x-bridge
[ github ]

Capture X data through your browser.

Search X and fetch data through your logged-in Chrome tab. Localhost API, no copied cookies, no API keys.

Why this exists

In March 2026, x.com stopped shipping the ondemand.s.<hash>.js file that most Python-side X scrapers parsed to generate the client transaction id required for authenticated GraphQL calls.

The libraries aren't abandoned and the authors aren't at fault. The token-derivation pipeline they depended on no longer exists in the wire protocol. Reproducing it server-side means emulating a moving target.

x-bridge takes the other path. If the real browser already has the token, let the real browser do the request. A CDP-injected bridge script listens to the fetches x.com is making anyway, forwards their responses to a local Node service, and exits the auth-replication arms race entirely.

"The browser is the SDK."

How it works

01

You keep a bridge tab.

Use the Chrome session signed into X and keep /home?bridge=1 open there.

02

CDP injects the bridge.

The service installs fetch/XHR interceptors in the page through Chrome DevTools Protocol, then captures X GraphQL responses locally.

03

Service returns the parsed data.

When you call /search or /replies/{id}, the bridge drives the tab, waits for captured responses, and returns normalized tweet objects.

$ terminal [ copy ]
$ curl -s 'http://127.0.0.1:19816/search?q=postgres&count=2' | jq .
[
  {
    "id": "1781...",
    "text": "The planner now folds SRFs in the target list when...",
    "created_at": "Fri Apr 17 09:12:04 +0000 2026",
    "user": { "screen_name": "bug_finderrr", "name": "Sudharsan" },
    "favorite_count": 142,
    "reply_count": 8,
    "retweet_count": 31,
    "url": "<x_status_url>"
  }
]

Install

$ install [ copy ]
$ git clone https://github.com/Bug-Finderr/x-bridge
$ cd x-bridge/service
$ npm start
$ browser tab [ copy ]
# Start Chrome with remote debugging on 127.0.0.1:18800.
# Sign into X, then open:
https://x.com/home?bridge=1

Optional: set XBRIDGE_START_SCRIPT if the service should run your browser launcher before bridge checks.

API

methodpathpurpose
GET /health Basic service liveness check.
GET /search Run a Top or Latest search and return parsed tweet objects.
GET /replies/{id} Fetch the reply tree for a given tweet id.
GET /queries Internal. Bridge tab polls for pending jobs.
POST /captured Internal. Bridge script posts intercepted responses here.
POST /abort Cancel an in-flight query and release the tab.
GET /debug/recent Recent captured payloads for parser/debug inspection.
GET /debug/bridge Current bridge readiness, polling, pending jobs, and idle state.

Maintained by an agent

This repo is autopatched by an OpenClaw agent when x.com drifts. Patch versions are machine-authored parser fixes; minor and major bumps stay human.