How to connect BrowserWire’s discovered APIs to AI agents and automation scripts.
Once you’ve recorded and trained a site, BrowserWire serves its views and actions as REST endpoints via bw run. You can call these from any AI agent, automation script, or HTTP client.
The manifest contains every state with its views and actions, including their input schemas. You can pass this to an LLM as context so it knows what operations are available.
Fetch the manifest: GET /api/sites/{slug}/manifest
Extract the list of states, views, and actions into a tool schema
Let the LLM decide which endpoints to call based on the user’s request
Execute the chosen endpoint and return the result
import requests# Fetch manifestmanifest = requests.get("http://127.0.0.1:8787/api/sites/example-com/manifest").json()# Build tool descriptions from statestools = []for state in manifest["states"]: for view in state.get("views", []): tools.append({ "name": f"read_{state['name']}_{view['name']}", "description": f"Read {view['name']} from {state['name']}", "endpoint": f"GET /api/sites/example-com/views/{state['name']}/{view['name']}" }) for action in state.get("actions", []): tools.append({ "name": f"do_{state['name']}_{action['name']}", "description": f"Execute {action['name']} on {state['name']}", "inputs": action.get("inputs", []), "endpoint": f"POST /api/sites/example-com/actions/{state['name']}/{action['name']}" })# Pass `tools` to your LLM as available functions