Browser Endpoints
browser.run opens a public page in a real browser, runs a short list of
steps on it (type, click, scroll and so on) and returns the page where it
ended: as Markdown, HTML, a screenshot or data by a JSON schema. Use it for
pages that only show what you need after a search, a click or a scroll. For a
page you can read as it is, scrape.markdown is
faster and cheaper. It is part of All tools.
A start needs the scope and enough credits, and the tool must be available in
/v1/health. Free credits also follow the
free limits. Accepted starts return
202 Accepted; poll their status. The answer is JSON in the operation result,
and screenshots and HTML are artifacts.
This endpoint is preview. Preview means the contract may still evolve before stable release.
Shared Access
- Access: Paid plans that include this family, or free credits (guest trial or verified account) within the free limits.
- Operation family: Scrape
- Scope:
api:scrape:read, the same scope as the scrape tools - Idempotency:
Idempotency-Keyheader required
POST/v1/browser/run
Opens url, runs steps in order and captures the page at the end. A step
that fails stops the run there. The result still comes back, with a log that
says which step failed and why, and the page as it was at that moment.
Required Access
- Credits: 2 per started 30 seconds of browser time, plus the tokens of a data extraction. Most runs take less than 30 seconds. See browser pricing.
- Scope:
api:scrape:read - Free credits: yes
Request
Search python.org for "asyncio", open the first result and return it as Markdown and a screenshot:
{
"url": "https://www.python.org/",
"steps": [
{ "action": "type", "selector": "#id-search-field", "text": "asyncio", "submit": true },
{ "action": "click", "selector": ".list-recent-events li h3 a" }
],
"outputs": ["markdown", "screenshot"]
}
Curl example:
curl -X POST https://www.chab.ai/v1/browser/run \
-H "Authorization: Bearer CHAB_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: python-search-001" \
-d '{"url":"https://www.python.org/","steps":[{"action":"type","selector":"#id-search-field","text":"asyncio","submit":true},{"action":"click","selector":".list-recent-events li h3 a"}],"outputs":["markdown","screenshot"]}'
Fields:
url(required): the public page to open first. Private and local addresses are refused.steps: up to 20 steps, run in order. See Steps.outputs: what to return from the page where the run ended, any ofmarkdown(the main text, in the result),html(a file) andscreenshot(a PNG file). Default["markdown"]. Send[]when you only wantextract.extract: data from that page, likescrape.extract. Give apromptin plain words, a JSONschemaor both, and optionallymax_output_tokens(default 2,048). Chab reads the whole page and checks the answer against the schema. Extraction runs only when every step worked.full_page: the screenshot shows the whole page, not only the window. Defaultfalse.capture_each_step: also save a small JPEG screenshot after each step that worked (rolestep_screenshot). Defaultfalse.viewport: the browser window,{"width": 1280, "height": 800}by default. Width 320 to 1920, height 320 to 1600.wait_until: when the first page counts as open:load(the page and its images, the default),domcontentloaded(the HTML only) ornetworkidle(no requests for half a second).max_seconds: the time limit for the steps, 10 to 120. Default 60. No step starts after it and a step that waits stops waiting at it (its log entry saystime_limit). The page is then captured as usual. Chab charges the browser time used, at most what it holds for this limit.allow_login: allow typing into password fields. Defaultfalse. See Acceptable use.callback_url,callback_secret,callback_events, andcallback_notify_on_expiration: optional one-off operation callback fields.
Steps
Each step is an object with an action and only the fields of that action.
Every step can also set timeout_seconds (1 to 30): how long it waits for
its element or page. The default is 10 seconds, and 30 for goto and
next_page.
Steps that work on an element name it by selector (a CSS selector; the
first visible match is used) or by text (its visible text, such as the
label of a link or a button; case and spacing do not matter). A link, button
or label with exactly that text comes first, then one that contains it, then
the smallest element that shows it.
| Action | Fields | What it does |
|---|---|---|
goto |
url, optional wait_until |
Opens another page in the same tab. The address is checked like url. |
click |
selector or text |
Clicks the element. A link that would open a new tab opens in this one. |
type |
selector, text, optional submit and clear |
Types into a field, up to 1,000 characters. The field is emptied first unless clear is false. submit: true (or a line break \n in the text) presses Enter. |
select |
selector, value |
Picks the option with this value in a dropdown. A list of values picks several in a list that takes several. |
check, uncheck |
selector or text |
Ticks or unticks a checkbox, or picks a radio button. Its label works too. Nothing changes when it is in that state already. |
scroll |
one of to ("bottom" or "top"), pixels, selector or text |
to: "bottom" scrolls a screen at a time until the page stops growing, so more results can load (at most 30 screens). pixels scrolls down (negative scrolls up). A selector or text scrolls to that element. |
wait |
one of selector, text or seconds |
Waits until an element shows, until the page shows a text, or for 0.1 to 10 seconds. |
hover |
selector or text |
Moves the pointer over the element, such as a menu that opens on hover. |
next_page |
selector or text |
Clicks the element and waits until another page has loaded, such as a "Next" link. It fails when the address does not change. |
There is no key press step. Enter works through type, and a click on the
right button does the rest.
Some examples:
[
{ "action": "click", "text": "Accept all cookies" },
{ "action": "type", "selector": "input[name=q]", "text": "standing desk", "submit": true },
{ "action": "wait", "selector": ".results li" },
{ "action": "select", "selector": "#sort", "value": "price-asc" },
{ "action": "check", "text": "In stock only" },
{ "action": "scroll", "to": "bottom" },
{ "action": "next_page", "text": "Next" },
{ "action": "wait", "text": "Showing results 21 to 40" },
{ "action": "goto", "url": "https://docs.python.org/3/library/asyncio.html" },
{ "action": "hover", "selector": "nav .menu-products" },
{ "action": "wait", "seconds": 2 }
]
Run Result
The search above, run on 2026-11-16 (the Markdown is shortened here):
{
"data": {
"result": {
"url": "https://www.python.org/",
"final_url": "https://www.python.org/jobs/8213/",
"title": "Internet Measurement Researcher (Censorship & Proxies), TGScope | Python.org",
"completed": true,
"stopped_at": null,
"steps": 2,
"log": [
{
"step": 0,
"action": "type",
"selector": "#id-search-field",
"characters": 7,
"submit": true,
"status": "ok",
"error": null
},
{
"step": 1,
"action": "click",
"selector": ".list-recent-events li h3 a",
"status": "ok",
"error": null
}
],
"markdown": "## Internet Measurement Researcher (Censorship & Proxies) New TGScope Remote, Remote, North America, Europe\n\n## Job Title\n\n Internet Measurement Researcher (Censorship & Proxies) \n\n## Job Description\n\nTGScope is looking for a researcher for a project-based contract of about two months, fully remote, paid by the hour.\n\n...",
"markdown_truncated": false,
"data": null,
"data_error": null,
"screenshot": {
"width": 1280,
"height": 800,
"mime_type": "image/png",
"byte_size": 179763
},
"step_screenshots": 0,
"html_byte_size": null,
"browser_seconds": 5.31,
"usage": null
},
"artifacts": [
{
"id": "art_01M7K1BWJ6WQZ0D9T11E8D6W5C",
"type": "image",
"role": "screenshot",
"mime_type": "image/png",
"byte_size": 179763,
"checksum": "sha256:f28b37e10d80f41330e508b5925aa25c276277520a9204fc965d0e0c092c7f74",
"filename": "page.png",
"metadata_url": "/v1/operations/op_01M7K1BM9G3X3HNDBDK3Y8Z7KG/artifacts/art_01M7K1BWJ6WQZ0D9T11E8D6W5C",
"download_url": "/v1/operations/op_01M7K1BM9G3X3HNDBDK3Y8Z7KG/artifacts/art_01M7K1BWJ6WQZ0D9T11E8D6W5C/download",
"expires_at": "2026-11-19T20:39:20+00:00"
}
],
"warnings": [],
"result_expires_at": "2026-11-19T20:39:20+00:00"
},
"meta": {
"request_id": "req_123"
}
}
It took 5.3 seconds and cost 2 credits (4 were held for the default 60 second limit).
Result fields:
urlandfinal_url: the first page and the page where the run ended.final_urlisnullwhen the run ended on a page the browser could not open.completed:truewhen every step worked.stopped_atnames the step that stopped the run (its position insteps, from 0), its action and its error code.log: one entry per step withstatusok,failed,refused(a password field withoutallow_login) ornot_run, and anerrorwith acodeand a message. Text you typed is not repeated, only its length.gotoandnext_pageentries give thefinal_urlthat opened.markdown: the main text of the page, whenoutputshasmarkdown. Up to 200,000 characters; a longer page also comes as amarkdownartifact andmarkdown_truncatedistrue.data,data_errorandusage: the extracted data, why there is none (run_incomplete,extraction_failed,structured_output_invalid,provider_error) and the tokens it used.screenshot: the size of the screenshot artifact (rolescreenshot).html_byte_sizeis the size of the HTML artifact (roleraw_html), andstep_screenshotscounts the screenshots after each step.browser_seconds: the browser time the run used.
Data from a long page
Scroll to the bottom of the downloads page, wait for the text at the end of the list and get the five newest releases by a schema:
{
"url": "https://www.python.org/downloads/",
"steps": [
{ "action": "scroll", "to": "bottom" },
{ "action": "wait", "text": "Looking for a specific release?" }
],
"outputs": [],
"extract": {
"prompt": "The five newest Python releases in the release list, newest first.",
"schema": {
"type": "object",
"properties": {
"releases": {
"type": "array",
"items": {
"type": "object",
"properties": {
"version": { "type": "string" },
"release_date": { "type": "string" }
},
"required": ["version", "release_date"],
"additionalProperties": false
}
}
},
"required": ["releases"],
"additionalProperties": false
}
}
}
The result on 2026-11-16 (log shortened):
{
"completed": true,
"data": {
"releases": [
{ "version": "Python 3.15.2", "release_date": "Oct. 25, 2026" },
{ "version": "Python 3.15.1", "release_date": "Oct. 21, 2026" },
{ "version": "Python 3.15.0", "release_date": "Oct. 9, 2026" },
{ "version": "Python 3.14.10", "release_date": "Oct. 25, 2026" },
{ "version": "Python 3.14.9", "release_date": "Oct. 21, 2026" }
]
},
"data_error": null,
"browser_seconds": 4.88,
"usage": { "input_tokens": 23303, "output_tokens": 215 }
}
It cost 5 credits: 2 for the browser and 3 for the tokens. 8 were held.
A step that fails
A click on an element that is not on the page stops the run. The page where
it stopped is still captured, here with capture_each_step: true:
{
"url": "https://docs.python.org/3/",
"steps": [
{ "action": "click", "text": "Library reference" },
{ "action": "click", "selector": "#this-link-does-not-exist", "timeout_seconds": 5 },
{ "action": "click", "text": "asyncio" }
],
"outputs": ["screenshot"],
"capture_each_step": true
}
{
"final_url": "https://docs.python.org/3/library/index.html",
"completed": false,
"stopped_at": { "step": 1, "action": "click", "error": "not_found" },
"log": [
{ "step": 0, "action": "click", "text": "Library reference", "status": "ok", "error": null },
{
"step": 1,
"action": "click",
"selector": "#this-link-does-not-exist",
"status": "failed",
"error": {
"code": "not_found",
"message": "Nothing visible on the page matched the selector within 5 seconds."
}
},
{ "step": 2, "action": "click", "text": "asyncio", "status": "not_run", "error": null }
],
"step_screenshots": 1,
"browser_seconds": 9.34
}
The operation succeeds with a partial_results warning, and the browser time
is charged: 2 credits here.
Step error codes:
| Code | When |
|---|---|
not_found |
Nothing visible matched the selector or the text in time |
invalid_selector |
The selector is not valid CSS |
not_usable |
The element is there but could not be used: hidden, covered (for example by a cookie banner), disabled, or a dropdown without that value |
element_gone |
The element went away before the step could use it |
page_failed |
A page could not be opened, or the browser refused it (private and local addresses) |
no_navigation |
next_page clicked, but no other page opened in time |
password_field |
The field is a password field and allow_login is not true |
time_limit |
The run reached max_seconds |
timeout, failed |
The step took too long, or failed for another reason |
Safety and Limits
- One tab. Links that would open a new tab open in the same one, and pages that open pop-up windows are not followed.
- Cookies and storage last for this run only. Every run starts with an empty browser.
- No file uploads and no downloads.
- The browser refuses every request to a private, shared, loopback or
link-local address (such as
10.0.0.1or169.254.169.254), to internal host names (such aslocalhostor*.internal), to other ports than the standard ones, and to other schemes thanhttpandhttps(nofile://). This covers the page, its images and scripts, its own requests, redirects and links.urland everygotoaddress are also checked before the run starts. - At most 20 steps, run for up to
max_seconds(120 at most). Finishing the step in progress and capturing the page can take up to 30 seconds more.
Acceptable Use
The Acceptable Use Policy applies. In short, for this tool:
- Do not create accounts or sign up for services.
- Sign in only to accounts that are yours. Typing into a password field is
refused unless you set
allow_login: true, and that is only for your own accounts. Chab checks the selector before the run and the field itself in the browser. - Chab does not solve CAPTCHAs. A page that shows one stops where it is.
- Do not post forms in bulk, such as comments, messages or sign-ups.
Browser Errors
The operation fails only when the run could not start or the first page could not be opened:
| Code | When | Charge |
|---|---|---|
validation_failed |
A field or step is wrong, url or a goto address is not public, or a password field without allow_login |
None |
target_fetch_blocked |
The first page could not be opened, or the browser refused it | None |
capture_timeout |
The browser did not answer within the time limit | The browser time |
capture_failed |
The browser could not run these steps | None |
provider_temporarily_rate_limited, provider_unavailable |
The browser is busy or cannot be reached right now; try again later | None |