docs

Browser Agent

The paid last-resort fallback for a page that needs clicking, a date picked, or a login walked through — the real start/status/send/stop shapes and the time limits.

Reading this with an agent?

This page as plain text: /docs/browser-agent.md. A summarising fetch tool paraphrases long pages, so for code to copy exactly, fetch it raw: curl -s https://bowmark.ai/docs/browser-agent.md. The whole site as one file: https://bowmark.ai/llms-full.txt. Index of every page: https://bowmark.ai/llms.txt.

bowmark.browser_agent is Bowmark's hosted browser agent — the fallback for when a page needs a form filled, a wizard driven, or a login walked through, and read.page (a plain fetch) can't do any of that. It is metered and billed, so reach for a typed provider or read.page first; use this when the task is genuinely an interaction, not as the next thing to try after a read fails.

Runs unattended on a public page — a login or CAPTCHA needs a person

browser_agent cannot store or use credentials. There is no credential field on start(). For an unattended login, use a typed provider that supports login() — see Scripting § Storing a login for an unattended script for a worked example.

File uploads and certificate logins (like Mexico's e.firma) are not supported. start() takes no file, attachment or certificate, so a run cannot hand one to the site. A takeover at watchUrl does not change that: the live view is a browser running on Bowmark's side, shown to you in a frame, so a file picker it opens lists that machine's files, not yours. A site that signs you in with a .cer/.key pair, or needs any file uploaded, cannot be driven by browser_agent, attended or not.

When a site needs a login, CAPTCHA, or other human takeover, the agent pauses and waits for your response (needs_input). A person must sign in each time.

When a site has no login or CAPTCHA, the agent runs to completion unattended — you can start it and poll from a script, a cron job, or a scheduled action (Zapier, GitHub Actions). It works the same whether you're watching or not.

So: For a public site with no login or CAPTCHA, the agent runs fine from a schedule. For a site that needs any login (including one you control) or a CAPTCHA, every run needs a person — a person must be present at watchUrl for each run, and nothing about a login is remembered between runs.

read.page (a plain fetch) and web_form_fields (filling and submitting forms) run on a schedule with no person required. Use one of those if the site has no CAPTCHA, no login in front of the page, and you do not need to drive interactive flows — neither of them can sign in.

One list read in full is ONE goal, even across many pages. "Every order on my orders page between January and December", paged, is one task. The rule against bundling is about SEPARATE searches: several date ranges, SKUs or queries in one task, where the agent may reuse one search's results for all of them. How many pages one session gets through is not something Bowmark measures or promises; a few pages of a list is ordinary, and hundreds of rows is unconfirmed. Describe the paging you want in the task text, and test it on your own target before relying on it. A signed-in site is signed in again on every run, since no login persists between them. For exact numbers (amounts, counts), a typed provider or the site's own API is the more reliable tool.

Run-to-run consistency is NOT guaranteed

browser_agent results may differ between runs on the same page. The agent uses a large language model to interpret what it sees, and its output is not deterministic. Running the exact same task twice can return different answers — particularly on visually complex pages (calendars, grids, tables, price comparisons), and on sites that sometimes serve a degraded or bot-blocked page, which the agent may report as real data (every fare "unavailable", every room "sold out").

For use cases where consistency matters — daily change detection, price monitoring, availability diffs — treat a single run's answer as provisional. Options:

  1. Multi-run consensus — run the same task 2-3 times and use the majority answer, or re-run only when the answer changed since last time before you alert on it.
  2. Use something that is not an LLM first — read.page or a provider-specific lookup reads the same page the same way every time, when the site allows it.

There is no temperature or determinism setting: Browser Use's run API has no such field. No confidence flag is returned either — you won't be told when an answer is uncertain or likely to differ on a rerun.

The shape: start, then poll from later calls

It runs through run() only (never session()), and it is asynchronous — start it in one run(), then check on it from separate, later run() calls. A single run() is capped at 90 seconds, so starting it and immediately polling in the same call hits that ceiling before the agent has had time to work.

// run 1 — start it, and show your user the watch link
const { result: started } = await run(
  `return bowmark.browser_agent.start({ task: "..." })`,
);
const { id, watchUrl } = started;

// run 2, 3, 4 … — one round trip each, from LATER calls
const { result: status } = await run(
  `return bowmark.browser_agent.status(${JSON.stringify(id)}, { waitMs: 45000 })`,
);
if (status.status === "needs_input") {
  // ask your user, then: bowmark.browser_agent.send(id, answer)
} else if (status.status === "idle") {
  await run(`return bowmark.browser_agent.stop(${JSON.stringify(id)})`);
}
# run 1 — start it, and show your user the watch link
started = (await run('return bowmark.browser_agent.start({ task: "..." })'))["result"]
id, watch_url = started["id"], started["watchUrl"]

# run 2, 3, 4 … — one round trip each, from LATER calls
status = (await run(
    f'return bowmark.browser_agent.status({id!r}, {{ waitMs: 45000 }})'
))["result"]
if status["status"] == "needs_input":
    pass  # ask your user, then: bowmark.browser_agent.send(id, answer)
elif status["status"] == "idle":
    await run(f'return bowmark.browser_agent.stop({id!r})')
# run 1 — start it, and show your user the watch link
curl https://api.bowmark.ai/v1/run \
  -H "Authorization: Bearer $BOWMARK_API_KEY" \
  -d '{
    "script": "return bowmark.browser_agent.start({ task: \"...\" })"
  }'

# Response carries id and watchUrl in result.

# run 2, 3, 4 … — later calls, until idle
curl https://api.bowmark.ai/v1/run \
  -H "Authorization: Bearer $BOWMARK_API_KEY" \
  -d '{
    "script": "return bowmark.browser_agent.status(\"<id>\", { waitMs: 45000 })"
  }'

Note: Inside the script field, run() is not available — you are already inside the script execution context. Paste the code directly without wrapping it in run().

start() takes only task — a plain-language instruction that includes the target URL — plus optional knobs (outputSchema, backend, model, maxCostUsd, proxyCountry, timeoutMs). There is no separate url field; put the target address inside the task string itself. For example: task: "Go to https://example.com and find the price" — not { task: "…", url: "https://example.com" }.

status(id, { waitMs }) blocks up to waitMs waiting for progress. The ceiling is 45000 (45s), kept under the ~60s at which most chat clients kill a tool call; a larger value is not an error, it is lowered to 45000 and the run's notes say so (waitMs 60000 was capped at 45000). send(id, answer) answers a needs_input prompt in the same session; stop(id) closes it. list() shows every session you are holding.

start() itself never returns the answer — only id, status, watchUrl, backend, model and warnings. Even when the task finishes almost immediately, the extracted value is only ever on status(id)'s result field, read from a later call.

Which backend runs, and how to pick one. backend on start() defaults to "auto": a fast agent runs first when one is available, and Bowmark falls back to Browser Use if it does not finish — status(id)'s own backend field tells you which one actually ran. Pass backend: "jev" to force the fast agent only — it requires the site's URL or hostname to appear somewhere in your task string, and fails outright when none is available for that site. Pass backend: "browser_use" to force the general-purpose agent only, skipping the fast-agent attempt.

watchUrl is only ever on start()'s own reply — status() never repeats it. Save it the moment you get it back, especially if a takeover can happen later in the same session. If you lose it (a script that starts a session in one run and polls it in a later one, say), call bowmark.browser_agent.watchLink(id) to mint a fresh one — doing so invalidates the old link, so only the newest one you were handed will still work.

What status(id) returns, field by field

FieldTypeMeaning
idstringThe session id — same one you started with
status"running" | "needs_input" | "idle" | "failed" | "stopped" | "closed"idle = done, read result; needs_input = relay question to your user
question{ kind: "question" | "takeover", question: string } | nullSet only when status is needs_input. takeover means a person must act at watchUrl (a login, a CAPTCHA)
resultstring | nullThe agent's answer for its last finished turn. Always a plain string, whether or not you passed outputSchema — with a schema, this is a JSON-encoded string you JSON.parse yourself, never a pre-parsed object
errorstring | nullSet when status is failed. Starts blocked: for a site's own bot wall, merchant_verification_failed: for Bowmark's own merchant-identity check, or connection_failed: when Bowmark's browser never reached the site (a proxy/tunnel error — a retry may simply succeed)
steps{ at: string, kind: "thinking" | "action" | "message", text: string }[]What the agent has done since your last cursor. Pass the previous cursor to status() to get only the new ones
cursorstringPass this back into your next status() call to avoid re-reading old steps
taskstringThe task you started it with
backendstringWhich hosted agent actually ran — "jev" or "browser_use"
modelstringThe model the backend used
closedbooleanWhether the session is already closed
warningsstring[]Anything Bowmark wants you to know about this call

When a status() call throws

The session lives on Bowmark's servers, not in your process. A call that throws on your side — BowmarkError: could not reach https://api.bowmark.ai/v1/run: ECONNRESET, a timeout, a dropped connection — means that one request never completed. The agent keeps working. Nothing about the session is lost, and the id is all you need to pick it up again.

What you seeWhat it meansWhat to do
could not reach …: ECONNRESET, ENOTFOUND, socket hang up, or a client timeoutNetwork trouble between your code and the API. The error message names the specific failure. TransientWait a few seconds and call status(id) again with the same id. status() only reads, so retrying it is always safe
vendor-refused from a browser-agent callBowmark's hosted-browser provider refused the request. This is Bowmark-side network trouble, not an error in your taskRetry the same call once or twice. If it repeats, assume the outage is sustained: check the Bowmark status page, wait about 5 minutes, then try a fresh session. Contact support@bowmark.ai if it persists
status: "failed" with error starting connection_failed: Bowmark's browser never reached the siteRetrying with a fresh start() may simply succeed
status: "failed" with error starting blocked: The site's bot wall refused the browserDon't retry in a loop. See The login handoff
status: "stopped" or "closed"The session was stopped, or idled out after 20 minutesStart a new one. A closed id cannot be resumed

Do not retry start() after a network error without checking first. If the request reached Bowmark before the connection dropped, a session may already be running. Call bowmark.browser_agent.list() to see every open session before starting another one. Each one is billed and counts against your limit of 3.

The time limits

  • 90 seconds — the hard ceiling on any single run() call. This is why polling happens from separate runs, not a loop inside one.
  • A handful of poll cycles, roughly 1-3 minutes total is a normal task. The same step name repeating on back-to-back polls is not a stall — keep polling until idle or needs_input.
  • 5 minutes is the ceiling Bowmark itself enforces per turn — a turn stuck past that with no progress is cancelled automatically and reads failed. Set your own give-up deadline at 5 minutes or more; a shorter one abandons runs that were about to finish.
  • 20 idle minutes closes an open session automatically, but stop() it yourself — it costs money and counts against your concurrent-session limit until closed.

A confirmed worked example: pulling one value off a generic page

This is the full shape — start, poll, read — for the ordinary job: a site Bowmark has no provider for, where you need one structured value out of a real page. Pass outputSchema so the value comes back typed instead of as a sentence you have to parse yourself.

Tested live, 2026-10-17: this exact script against https://www.nativecos.com/products/clean-hair-trio (an ordinary Shopify product page, not one of this library's named providers) returned status: "idle" with result: "{\"price\": \"$28.00\"}" — a JSON string, matching the live product price.

// run 1 — start it
const { result: started } = await run(`
  return bowmark.browser_agent.start({
    task: "Go to https://example.com/some-page and return the value shown for X",
    outputSchema: {
      type: "object",
      properties: { value: { type: "string" } },
      required: ["value"]
    }
  });
`);
const { id } = started;

// run 2, 3 … — later calls, until idle
const { result: status } = await run(
  `return bowmark.browser_agent.status(${JSON.stringify(id)}, { waitMs: 45000 })`,
);
if (status.status === "idle") {
  const { value } = JSON.parse(status.result); // result is a STRING — parse it yourself
  console.log(value);
}
import json

# run 1 — start it
started = (await run('''return bowmark.browser_agent.start({
  task: "Go to https://example.com/some-page and return the value shown for X",
  outputSchema: {
    type: "object",
    properties: { value: { type: "string" } },
    required: ["value"]
  }
})'''))["result"]
id = started["id"]

# run 2, 3 … — later calls, until idle
status = (await run(
    f'return bowmark.browser_agent.status({id!r}, {{ waitMs: 45000 }})'
))["result"]
if status["status"] == "idle":
    value = json.loads(status["result"])["value"]  # result is a STRING — parse it yourself
    print(value)

The one thing every newcomer trips on: result is a plain string even with outputSchema set. start() returns no answer at all, and status()'s result field is typed string | null whether or not you asked for structured output — a schema changes what the string CONTAINS (valid JSON instead of prose), never its type. JSON.parse / json.loads it yourself.

The login handoff

browser_agent has no stored credential and cannot do an unattended login — there is no secret field on start(), and interpolating bowmark.secret("…") into the task string sends the agent the literal placeholder text, never the password. When a task hits a login, a CAPTCHA, or any challenge only a person can solve, it returns needs_input with kind: "takeover" and waits for a person to act at watchUrl. This holds on every run, not just the first — nothing about a login is remembered between sessions, so a script that walked someone through signing in yesterday still needs a person today.

Two-factor (a 6-digit code, an SMS or email code, an approve-on-phone prompt) works the same way: the person at watchUrl enters the code, then the agent continues. Nothing about a browser_agent sign-in runs unattended. For an unattended login with an authenticator-app code, see Scripting § Storing a login for an unattended script.

A magic-link sign-in works as a takeover too: a person opens the emailed link at watchUrl and completes it there; it never completes unattended. If nobody acts, the session remains needs_input until the 20-minute idle limit closes it, and it is billed while open, so an unattended caller should call stop().

A site that blocks the browser outright (an Akamai/Cloudflare/PerimeterX/DataDome/Imperva "access denied" page) reports failed with an error starting blocked: , quickly — never needs_input, because nobody can click past a wall that already stopped the agent. If read.page was already refused on that site too, the site is refusing every route Bowmark has: Blocked pages and read options.

A task Bowmark will not do at all (bulk personal data, finding a private person, getting into someone else's account, moving money) may be refused by the hosted model's own judgement of the task wording. There is no pre-browser guarantee for these categories; refusal depends entirely on how the task is phrased. For guaranteed task-level vetting, use the screenDemand check in get_library before writing the script.

If the site has a typed provider instead, sign in once with providers.<site>.login() (using a stored bowmark.secret()) and make repeated calls inside that same session() — that reuses one cookie jar at typed-provider rates. read.page and browser_agent share no cookie jar with each other or with a provider's session, so neither can inherit the other's login.

What it costs

No flat per-run price — it is metered on the model turns the task takes plus the browser time it holds open, itemized on your billing dashboard as browser_agent.vendor. See Pricing § Hosted browser agents for the per-minute rates and a worked cost example. Your account can hold up to 3 open sessions at once and has a monthly spend cap (defaults to $2/run, configurable to $25).

The full reference

This page covers the shapes, the full result object, and a confirmed generic extraction example above. Field-by-field write verification and the "not a general fallback for a plain read" scoping are in Quickstart § Write actions and multi-step flows with browser_agent and Scripting § When nothing else works: the browser agent.