x402-browser-bridge
Turn a website flow into a paid API. Declare it in YAML, Puppeteer executes it, and the extracted data, screenshots and step log come back in the response.

⚠️ Terms of service — read this first
Automating a website you do not own or have permission to automate may breach its terms of service, and in some jurisdictions may break the law. This is a tool for driving browsers. It does not know, and cannot check, whether you are allowed to drive a particular one.
Before you point a flow at a site that isn't yours:
- Read its terms of service. Most sites explicitly prohibit automated access, scraping, or account use by non-humans. A ToS prohibition is a contract term, and breaching it can be a contract breach regardless of how you technically accessed the site.
- Check
robots.txt and any published API terms. If there's an API, use the API. A bridge is for sites that don't have one — not for routing around one you'd rather not pay for.
- Never bridge an authenticated session you don't own. Automating someone else's account with their password is a different and much more serious category of problem, and computer-misuse statutes (CFAA in the US, the Computer Misuse Act in the UK, and equivalents elsewhere) can apply.
- Don't circumvent access controls. CAPTCHAs, rate limits, bot detection, and paywalls exist to say no. Defeating them is not a technical detail.
- Respect personal data. Anything you extract about identifiable people brings GDPR/CCPA obligations along with it, whoever's site it came from.
- Reselling a paid bridge makes it worse, not better. Charging $0.05 per run of someone else's site converts a ToS issue into a commercial one, and you will be the party doing the charging.
The flows bundled with this repository target pages this repository serves itself (public/demo/). No third-party site is automated by anything shipped here. That was a deliberate choice, and it's the model to copy: bridge your own systems, or systems you've been given written permission to bridge.
If you deploy this, you are the operator, and the legality of every flow it serves is yours. Flows carry an authorized: true marker for the author to assert that permission exists; it's informational, and it does not transfer responsibility to anyone else.
The problem
An enormous amount of commerce still lives behind a form. No API, no partner programme, no webhook — just a page, a submit button, and a confirmation screen. An agent that can pay for things cannot use any of it.
A bridge closes that gap: declare the click path once, expose it as an x402 endpoint, and the agent buys the outcome without ever knowing a browser was involved.
Why x402 for this
Browser automation is expensive in a way API calls aren't — a real Chromium, a real page load, seconds of wall clock. Metering it per run rather than per month is the only pricing that reflects the cost. And the caller is a program: it wants to pay for one outcome, right now, without an account, a key, or a contract.
Quickstart
git clone https://github.com/nirholas/x402-browser-bridge && cd x402-browser-bridge
npm install # downloads Chromium
cp .env.example .env
npm run dev
curl -s localhost:4034/flows | jq '.flows[] | {route, price, inputs: (.inputs|keys)}'
npm run client # pay $0.05, run the flow, get the artifact
API
| Route | Price | What you get back |
|---|
POST /run/:flow | $0.05 | { extracted, screenshots, steps } — signed, in the 200 body |
GET /flows | free | Every declared flow: inputs, extracted fields, price, host allowlist |
POST /verify | free | Signature check on a run record |
GET /health | free | Liveness, rails, flow count, browser availability |
Prices come from the flow files, so adding a YAML file adds a priced route — no code change.
A flow
name: demo-booking
description: Book a table on a site that has no API.
price: "$0.05"
allowHosts: [localhost, 127.0.0.1] # the security boundary. Required.
authorized: true
authorizationNote: The target page is served by this repository.
inputs:
name: { type: string, required: true }
email: { type: string, required: true, pattern: '[^@\s]+@[^@\s]+\.[^@\s]+' }
date: { type: string, required: true, pattern: '\d{4}-\d{2}-\d{2}' }
partySize: { type: string, default: "2", pattern: '1|2|4|6|8' }