Turn a website task into an API you can call on rows of input A Browsa engineer demonstrated a pattern for turning a one-off AI agent website task into a reusable, callable API: the agent runs the task once with a JSON output schema and records the steps as a "recipe," which is then replayed across rows of input to produce consistent typed columns exportable as CSV or JSON. In the example, a single agent run on books.toscrape.com took 11.1 seconds and 7 credits, while replaying the recording across three URLs took 39 seconds at 8 credits per row. The engineer noted recording does not cut per-row cost or speed on simple pages, but guarantees the same output shape and repeats recorded steps instead of re-planning. Disclosure: I work on Browsa, the cloud browser used here. An AI agent is good at working out how to do something on a website. It's a waste to have it work it out again for every row of a spreadsheet. The pattern this post shows: let the agent do the task once, record what it did, then replay the recording on each input and get the same typed columns every time. The example uses books.toscrape.com https://books.toscrape.com , a sandbox site made for scraping practice. python import time from browsa import Client client = Client reads BROWSA API KEY BOOK = "https://books.toscrape.com/catalogue" job = client.run task task="Open the product page and return title, price and in stock", llm="browsa", initial url=f"{BOOK}/sharp-objects 997/index.html", output schema={ "type": "object", "properties": { "title": {"type": "string"}, "price": {"type": "string"}, "in stock": {"type": "boolean"}, }, "required": "title", "price", "in stock" , }, record recipe=True, print f"agent run: {job.outcome} in {job.duration ms / 1000:.1f} s, {job.credits charged} credits" print job.final result agent run: completed in 11.1 s, 7 credits {"price": "£47.82", "title": "Sharp Objects", "in stock": true} Two details matter here: output schema : answer column. initial url : url input of the recording. robot = client.robots.create name="Book prices", from job id=job.id, inputs= {"url": f"{BOOK}/sharp-objects 997/index.html"}, {"url": f"{BOOK}/soumission 998/index.html"}, {"url": f"{BOOK}/tipping-the-velvet 999/index.html"}, , t0 = time.time run = client.robot runs.wait client.robots.run robot.id .id print f"robot run: {run.status} in {time.time - t0:.0f} s" print client.robot runs.export run.id CSV robot run: completed in 39 s row,status,error code,credits,input.url,price,title,in stock 0,ok,,8,https://books.toscrape.com/catalogue/sharp-objects 997/index.html,£47.82,Sharp Objects,true 1,ok,,8,https://books.toscrape.com/catalogue/soumission 998/index.html,£50.10,Soumission,true 2,ok,,8,https://books.toscrape.com/catalogue/tipping-the-velvet 999/index.html,£53.74,Tipping the Velvet,true Each row replays the recording on its own URL. The columns are the ones from the schema, and the CSV or JSON is ready for a sheet or a database. A row with an input the recording doesn't take is rejected before anything runs: client.robots.run robot.id, inputs= {"link": f"{BOOK}/soumission 998/index.html"} UNKNOWN INPUT inputs 0 : "link" is not a param of this recipe, so the run would ignore it; its params are "url" Rows that fail while running are free, too. A row costs the same credits as the agent task it was recorded from: here, 8 per row. Recording doesn't make a row cheaper, and on a page this simple it isn't faster either 39 s for three rows . What it buys you is the same JSON shape on every row, a typed table you can export, and runs that repeat the recorded steps instead of planning them again.