# Browser

> Browsers: a browser an agent drives, and profiles that keep a person's logins.

```python
profile = noclick.BrowserProfile.from_name("ana-work", create_if_missing=True, user="user_42")
profile.login("https://portal.example.com", reason="to download your invoices").wait()

with noclick.Browser.create(profile=profile, timeout_s=900) as browser:
    browser.goto("https://portal.example.com/invoices")
    result = browser.act("Download every invoice from September")
    print(result.summary)
# closed on exit
```

A browser is Chromium in a sandbox, driven by a model that sees the page and
acts on it. NoClick solves the CAPTCHAs it can; when a page still needs a person
(a CAPTCHA it couldn't solve, a two-factor code), the browser parks, unbilled,
while that person finishes the step on a page NoClick sends them. A profile
keeps the sign-ins a person made once; when a site signs it out, the next
browser asks that person to sign in again the same way, and saves the new
sign-in. A profile counts as a credential, so it is never exported and only its
own user's browsers and agents use it.

## noclick.Browser

```python
class Browser
```

A running browser. `with noclick.Browser.create() as browser:` closes it on
exit; otherwise it closes at `expires_at`. Billed per minute while it runs,
plus the model tokens `act` and `extract` use; time it waits on a person
is neither billed nor counted against `timeout_s`.

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | `str` |  |
| `status` | `str | None` | `starting`, `running`, `parked` (waiting on a person, or an agent's browser waiting for its conversation's next turn), `closed` or `failed`. |
| `region` | `str | None` | Where it runs: its profile's region, else the one it was created in. |
| `place` | `str | None` | What runs it: `remote` (NoClick's remote browsers), or, for a coding agent's own browser beside it, `sandbox` (its sandbox) or `machine` (its container on a machine, `place_name`), which reaches what the agent runs on localhost; a browser started with `machine` is `machine` too, in a container of its own there. |
| `place_name` | `str | None` | The machine it runs on, for a browser whose `place` is `machine`. |
| `profile_id` | `str | None` | The profile it is signed in with (None if none). |
| `agent_id` | `str | None` | The agent driving it, for an agent's browser. |
| `conversation` | `str | None` | The conversation it works in, for a browser an agent's turn started. |
| `act_id` | `str | None` | Its newest `act`'s operation. |
| `acting` | `bool | None` | Whether an `act` is driving it now. |
| `steps` | `list[BrowserWatchedStep]` | The steps its newest `act` has taken so far. |
| `held` | `bool | None` | Whether a person has taken it over (`take_over`): its `act` waits until they hand it back. |
| `waiting_on` | `BrowserWaitingOn | None` | A step a person is asked to finish in it, while its `act` waits on them. |
| `live_url` | `str | None` | A NoClick page where you watch it live and can take over; it works while the browser runs, with no sign-in, so treat it like a password. Only a caller that may take the browser over reads it: your account's keys (one acting for a user too) and its signed-in owner. An MCP connection, an agent's turn and an app's code read None. |
| `url` | `str | None` | The page it is on. |
| `title` | `str | None` |  |
| `frame_url` | `str | None` | A picture of the page it last stopped on (its `act`'s end, or its conversation's turn's), signed for an hour from each read; None before it first stopped. |
| `timeout_s` | `int | None` | How long it may run; parked time doesn't count. |
| `solve_captchas` | `bool | None` | Whether NoClick solves CAPTCHAs before asking a person. |
| `parked_s` | `int | None` | Seconds it has waited parked: not billed, not in timeout_s. |
| `cost_usd` | `float | None` | What it has cost so far: minutes and model tokens. |
| `user_id` | `str | None` |  |
| `created_at` | `Any` |  |
| `started_at` | `Any` | When it started running (None while it starts). |
| `expires_at` | `Any` |  |
| `closed_at` | `Any` |  |
| `end_reason` | `str | None` | Why it ended, once `closed` or `failed`: `closed` (you closed it), `expired`, `idle`, `ended`, `start_failed`, and for one on a machine `image_pull_failed` or `image_timed_out` (its machine couldn't fetch its image, or not in time). |

### Browser.create

```python
noclick.Browser.create(
    *, profile=None, timeout_s=None, region=None, solve_captchas=True, human=None,
    machine=None, user=..., client=None
) -> Browser
```

Start a browser that runs at most `timeout_s` seconds (300 by
default, up to 3600; time it waits on a person doesn't count). With
`profile` (a `BrowserProfile` or id) it is signed in to the profile's
sites, acts for the profile's user, runs in the profile's region and saves
new sign-ins into it when it closes: one such browser per profile at a
time, so a second raises `noclick.Conflict` naming the first
(`browser_id`). Without one, `region` is where it runs
(`noclick.regions(kind="browser")`; the account's default when omitted).
NoClick solves the CAPTCHAs it can before asking a person;
`solve_captchas=False` turns that off for sites whose terms forbid it.
`human` is who is asked when a page needs a person (the user by default,
you for an account browser). With `machine` (a `Machine` or id: one
NoClick runs for you, or your own) it runs on that machine, in a container
of its own with no agent: it reaches sites from the machine, costs nothing
beyond the machine and keeps no profile (leave `profile` and `region`
out); its key needs the `machines` scope too, and a machine a space shares
with you takes it at `use`. While that machine fetches the browser's
image (its first, on a machine with no agents) the browser is `starting`,
and runs once the image is held, or ends `failed` saying why.

Parameters:

- `profile` (`Any`, default `None`)
- `timeout_s` (`int | None`, default `None`)
- `region` (`str | None`, default `None`)
- `solve_captchas` (`bool`, default `True`)
- `human` (`Human | None`, default `None`)
- `machine` (`Any`, default `None`)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `Browser` The browser, `running` on a blank page, with its `live_url` (on a
machine, possibly `starting` for a few minutes first).

Usage:

Use it as a context manager, so it closes when the block ends:

```python
profile = noclick.BrowserProfile.from_name("ana-work", user="user_42")
with noclick.Browser.create(profile=profile, timeout_s=900) as browser:
    browser.goto("https://portal.example.com/invoices")
    print(browser.act("Download every invoice from September").summary)
```

Without `with`, close it yourself or let it run out:

```python
browser = noclick.Browser.create(timeout_s=600)
print(browser.live_url)   # watch it, or take over
browser.close()
```

On one of your machines:

```python
box = noclick.Machine.from_name("build-box")
with noclick.Browser.create(machine=box, timeout_s=900) as browser:
    print(browser.place, browser.place_name)   # machine build-box
```

### Browser.from_id

```python
noclick.Browser.from_id(browser_id, *, client=None, user=...) -> Browser
```

A lazy reference to a browser by id, for one you started earlier.

Parameters:

- `browser_id` (`str`, required)
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Returns: `Browser` A browser that loads the first time you read a field. Nothing is sent yet.

Usage:

```python
browser = noclick.Browser.from_id("e2c9a4f7-1b3d-4e8a-9c6f-5d0b7a2e1f83")
print(browser.content(format="text"))
```

### Browser.get

```python
noclick.Browser.get(browser_id, *, user=..., client=None) -> Browser
```

Load a browser by id now; an unknown id raises `noclick.NotFound`.

Parameters:

- `browser_id` (`str`, required)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `Browser` The browser, loaded: its `status`, the page it is on and its `live_url`.

Usage:

```python
browser = noclick.Browser.get("e2c9a4f7-1b3d-4e8a-9c6f-5d0b7a2e1f83")
print(browser.status, browser.url, browser.live_url)
```

### Browser.list

```python
noclick.Browser.list(
    *, profile=None, status=None, agent=None, conversation=None, limit=None,
    user_filter=None, user=..., client=None
) -> list[Browser]
```

The current user's browsers (the account's own outside `as_user`, or those
`user_filter` covers), optionally one `profile`'s, or an `agent`'s (one `conversation`'s: an agent's
browser works in the conversation whose turn started it, one at a time); `status="live"` lists those
starting, running or parked.

Parameters:

- `profile` (`Any`, default `None`)
- `status` (`str | None`, default `None`)
- `agent` (`Any`, default `None`)
- `conversation` (`str | None`, default `None`)
- `limit` (`int | None`, default `None`): Return at most this many.
- `user_filter` (`Any`, default `None`): Which users a read covers: `noclick.ALL_USERS`, `noclick.NO_USER`, a `User`, or your id for one. It filters without acting as that user.
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `list[Browser]` Every matching browser, newest first, fetched page by page. Agents' browsers are listed too.

Usage:

```python
for browser in noclick.Browser.list(status="live", user_filter=noclick.ALL_USERS):
    print(browser.id, browser.url, browser.live_url)

profile = noclick.BrowserProfile.from_name("ana-work", user="user_42")
recent = noclick.Browser.list(profile=profile, limit=10)
```

### Browser.list_page

```python
noclick.Browser.list_page(
    *, cursor=None, limit=None, profile=None, status=None, agent=None,
    conversation=None, user_filter=None, user=..., client=None
) -> Page
```

One page of browsers; pass `next_cursor` back as `cursor`.

Parameters:

- `cursor` (`str | None`, default `None`): The `next_cursor` of the page before; omit it for the first page.
- `limit` (`int | None`, default `None`): Return at most this many.
- `profile` (`Any`, default `None`)
- `status` (`str | None`, default `None`)
- `agent` (`Any`, default `None`)
- `conversation` (`str | None`, default `None`)
- `user_filter` (`Any`, default `None`): Which users a read covers: `noclick.ALL_USERS`, `noclick.NO_USER`, a `User`, or your id for one. It filters without acting as that user.
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `Page` A page whose `data` holds the browsers and whose `next_cursor` is `None` on the last page.

Usage:

```python
page = noclick.Browser.list_page(status="closed", limit=50)
while True:
    for browser in page.data:
        print(browser.id, browser.cost_usd)
    if page.next_cursor is None:
        break
    page = noclick.Browser.list_page(status="closed", limit=50, cursor=page.next_cursor)
```

### Browser.goto

```python
browser.goto(url) -> PageState
```

Open `url` and wait for the page to load.

Parameters:

- `url` (`str`, required)

Returns: `PageState` The page it landed on: its `url` after redirects and its `title`.

Usage:

```python
with noclick.Browser.create() as browser:
    page = browser.goto("https://example.com")
    print(page.url, page.title)
```

### Browser.act

```python
browser.act(
    instruction, *, background=False, max_steps=None, files=None, sign_up=False,
    timeout=None
) -> ActResult | Operation
```

Have the model carry out `instruction` on the page: clicking, typing,
scrolling, uploading, downloading, at most `max_steps` actions (50 by
default, up to 200). `files` are https URLs (a bucket's `signed_url`
works) NoClick downloads into the browser first, for the task to put in a
form, up to 5. NoClick solves the CAPTCHAs it can, giving one half a
minute; one still there, or a two-factor prompt, parks the browser (not
billed, not counted against its timeout) and sends a person a page carrying
the live view, and the step waits until they have dealt with it. So does a sign-in page for a site
whose saved sign-in expired: it asks the person who signed in
(`SiteLogin.signed_in_by`) to sign in again, saves the new sign-in to the
profile, and carries on.

The website logins the browser may use (connections of integration
`website_login`: a site's username, password and two-factor setup key), and
each login item with a site in a connected 1Password's vaults (named
`<vault>/<item title>`, read from 1Password as they're typed), are told to
the model by name and username only: on a site's sign-in form NoClick types
them in, with the two-factor code, and the model never reads them. A code
the site emails or texts, and a verification link it emails, NoClick waits for
where the login says and types or opens it; one that never comes is asked of a
person. `sign_up=True` lets it create an account where the task needs one:
NoClick makes the password, types it, and keeps it in the account's 1Password
(the connection's vault for new logins, else the one vault it reaches) or else
as a new website login for the site, with the username the task gives, else an
email address of the login's own, where NoClick receives the site's mail
(`Connection.login_mail`). The step that signed up says where it went.
Both only in a browser no agent is beside (a remote one, or one alone on a
machine).

`timeout` is how many seconds to wait here; the step keeps going after it.
`background=True` returns at once.

Parameters:

- `instruction` (`str`, required)
- `background` (`bool`, default `False`)
- `max_steps` (`int | None`, default `None`)
- `files` (`list[str] | None`, default `None`)
- `sign_up` (`bool`, default `False`)
- `timeout` (`float | None`, default `None`)

Returns: `ActResult | Operation` How it went: whether it's `done`, a `summary`, the `steps` it took, the `url`
it ended on and any `downloads`. With `background=True`, an `Operation` at once,
whose `wait()` gives that result.

Usage:

Describe the task, not the clicks:

```python
with noclick.Browser.create(profile=noclick.BrowserProfile.from_name("ana-work", user="user_42")) as browser:
    browser.goto("https://portal.example.com/invoices")
    result = browser.act("Download every invoice from September")
    print(result.done, result.summary)
    for file in result.downloads:
        print(file["name"], file["url"])
```

Run a long task in the background and pick it up later:

```python
browser = noclick.Browser.create(timeout_s=1800)
task = browser.act("Compare the three cheapest flights from SFO to JFK on Oct 12", background=True)
print(task.id)                                   # save it; then, later, anywhere:
result = noclick.Operation.from_id(task.id).wait()
```

Hand it the files a form needs:

```python
w9 = noclick.Bucket.from_name("forms").signed_url("w9-2026.pdf")
with noclick.Browser.create(profile=noclick.BrowserProfile.from_name("ana-work", user="user_42")) as browser:
    browser.goto("https://supplier.example.com/onboarding")
    print(browser.act("Fill in the onboarding form and attach the W-9", files=[w9]).summary)
```

### Browser.sign_in

```python
browser.sign_in(connection, *, timeout=None) -> ActResult
```

Sign in on the page the browser is on (the site's sign-in page) with a
website login, a connection of integration `website_login`, by name, id or
object, or a connected 1Password's login item by its name, `"<vault>/<item title>"`. NoClick types its username and password (and its two-factor code)
into the site's own form, submits it,
and carries on through a next page asking for more, with no model: no value
reaches your code, a step or a log. It types only on the login's own sites,
over https, and only in a browser no agent is beside.

Parameters:

- `connection` (`str | _Object`, required)
- `timeout` (`float | None`, default `None`)

Returns: `ActResult` How it went: `done` once the site no longer shows its sign-in form, a `summary`,
and the `url` it ended on.

Usage:

```python
login = noclick.Connection.create("acme-billing", integration="website_login",
                                  data={"site": "billing.acme.com", "username": "ana@acme.test",
                                        "password": os.environ["ACME_PASSWORD"]})
with noclick.Browser.create() as browser:
    browser.goto("https://billing.acme.com/login")
    result = browser.sign_in(login)
    print(result.done, result.summary)
```

### Browser.extract

```python
browser.extract(query, *, schema=None) -> Any
```

Read what `query` describes off the current page, shaped by `schema`
(a JSON Schema) when you pass one.

Parameters:

- `query` (`str`, required)
- `schema` (`dict[str, Any] | None`, default `None`)

Returns: `Any` The data as JSON: an object or a list matching `schema`, or the model's own shape without one.

Usage:

```python
with noclick.Browser.create() as browser:
    browser.goto("https://portal.example.com/invoices")
    invoices = browser.extract(
        "the invoice numbers and totals",
        schema={"type": "array", "items": {"type": "object", "properties": {
            "number": {"type": "string"}, "total_usd": {"type": "number"}}}},
    )
    print(invoices[0]["number"], invoices[0]["total_usd"])
```

### Browser.screenshot

```python
browser.screenshot(*, full_page=False) -> bytes
```

A PNG of what the browser shows: the viewport, or the whole page with `full_page=True`.

Parameters:

- `full_page` (`bool`, default `False`)

Returns: `bytes` The PNG's bytes.

Usage:

```python
with noclick.Browser.create() as browser:
    browser.goto("https://example.com")
    with open("page.png", "wb") as f:
        f.write(browser.screenshot(full_page=True))
```

### Browser.content

```python
browser.content(*, format='markdown') -> str
```

The current page's content as `"markdown"`, `"text"` or `"html"`.

Parameters:

- `format` (`str`, default `'markdown'`)

Returns: `str` The page's content in that format; markdown keeps headings, links and tables.

Usage:

```python
with noclick.Browser.create() as browser:
    browser.goto("https://example.com/pricing")
    print(browser.content(format="markdown"))
```

### Browser.take_over

```python
browser.take_over() -> None
```

Take the browser over from its agent, as a person: it waits for you (unbilled), and an `act` in it
stops at its next step until you `hand_back()`. Drive it from its `live_url`. Asked to finish a step in
it (`waiting_on`), only the person asked takes it over.

Usage:

```python
browser = noclick.Browser.list(agent=agent, conversation="owner", limit=1)[0]
browser.take_over()
print(browser.live_url)   # sign in there, then:
browser.hand_back()
```

### Browser.hand_back

```python
browser.hand_back() -> None
```

Hand the browser back: a step you were asked to finish counts as finished (as Done on its page does),
and the `act` waiting on you carries on; with nothing asked, it's the agent's again.

Usage:

```python
if browser.waiting_on and browser.waiting_on.for_you:
    browser.take_over()
    # ...finish the step from browser.live_url, then:
    browser.hand_back()
```

### Browser.live_view

```python
browser.live_view(*, control=False, thumb=False) -> BrowserLiveView
```

The browser live, for a page of your own: a `BrowserLiveView` whose single-use `token` opens its
`url` once, within two minutes. Hand both to the page from your server (the TypeScript SDK's
`Browser.view` connects with them). `thumb`: smaller pictures for a tile. `control`: a view that drives
the browser, once you've taken it over (`take_over`); it ends when it's handed back. Your account's keys and
its signed-in owner get one; an MCP connection, an agent's turn and an app's code don't.

Parameters:

- `control` (`bool`, default `False`)
- `thumb` (`bool`, default `False`)

Returns: `BrowserLiveView` The view: its `url` and its `token`, good once, within two minutes.

Usage:

```python
browser.take_over()
view = browser.live_view(control=True)
send_to_page(view.url, view.token)   # within two minutes
```

### Browser.close

```python
browser.close() -> None
```

Close the browser now (billing stops with it). The profile keeps any new sign-ins.

Usage:

```python
browser = noclick.Browser.create()
try:
    print(browser.goto("https://example.com").title)
finally:
    browser.close()
```

## noclick.BrowserLiveView

```python
class BrowserLiveView
```

A browser's live view, for a page of your own (`Browser.live_view`): a single-use `token` for the
websocket at `url`, valid two minutes. The page opens `url` and sends `{"type": "auth", "token": ...}` as its
first message (never put the token in the URL). The socket sends `{"type": "viewport", "width", "height"}`,
then a JPEG of the page each time it changes; a `control` view also takes `{"type": "tap", "x", "y"}`,
`{"type": "mouse", "action": "down" | "up" | "move", "x", "y"}`, `{"type": "scroll", "x", "y", "dx", "dy"}`,
`{"type": "text", "text"}` and `{"type": "key", "key"}` in the page's CSS pixels, while a watching one is
closed by anything it's sent. Send input only once the socket has shown the page (its first JPEG), never input
from an earlier socket. It closes 4000 after 15 minutes (open a new view to go on) and 4429 when the browser or
the account already has as many views open as it may (try again later); 4401 (the token was used, lapsed or its
key ended), 4404, 4409 (a control view's take-over ended, or its step became another person's), 4410 (the browser
closed) and 1008 are final. The TypeScript SDK's `Browser.view` does all of this in a page.

| Attribute | Type | Description |
| --- | --- | --- |
| `browser_id` | `str` |  |
| `control` | `bool` | Whether it drives the browser, not only watches it. |
| `thumb` | `bool` | Smaller pictures, at most two a second, for a tile. |
| `url` | `str` | The view's websocket. |
| `token` | `str` | Opens `url` once, within two minutes: its first message's `token`. |
| `token_expires_at` | `Any` |  |

## noclick.BrowserProfile

```python
class BrowserProfile
```

Saved sign-ins for one person. `BrowserProfile.from_name("ana-work", create_if_missing=True, user="user_42")` is lazy; `profile.login(url)`
asks the person to sign in once, and browsers started with the profile are signed in.
Its `region` is where its browsers run; its sign-ins are kept in the US whatever the region.

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | `str` |  |
| `name` | `str` |  |
| `region` | `str | None` | Where its browsers run, fixed when it is created. |
| `user_id` | `str | None` |  |
| `last_used_at` | `Any` | When a browser last used it (None if never). |
| `created_at` | `Any` |  |
| `sites` | `list[SiteLogin]` | The sites it is signed in to, most recently signed in first (loads the profile if needed). |

### BrowserProfile.create

```python
noclick.BrowserProfile.create(
    name, *, region=None, allow_existing=False, user=..., client=None
) -> BrowserProfile
```

Create an empty profile called `name` (unique per user; a duplicate
raises `noclick.Conflict` with `existing_id`, or with `allow_existing=True`
returns the profile already there, signed in where it was). `region` is where its
browsers run (`noclick.regions(kind="browser")`; the account's default
region when omitted), fixed for its life; its sign-ins are kept in the US.

Parameters:

- `name` (`str`, required)
- `region` (`str | None`, default `None`)
- `allow_existing` (`bool`, default `False`)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `BrowserProfile` The new profile, signed in nowhere yet.

Usage:

```python
profile = noclick.BrowserProfile.create("ana-work", user="user_42")
login = profile.login("https://portal.example.com", reason="to download your invoices")
```

### BrowserProfile.from_name

```python
noclick.BrowserProfile.from_name(
    name, *, create_if_missing=False, region=None, user=..., client=None
) -> BrowserProfile
```

A lazy reference to the profile called `name` in the current (or given)
user; with `create_if_missing=True` it's created, empty, on first use, in
`region` when you pass one.

Parameters:

- `name` (`str`, required)
- `create_if_missing` (`bool`, default `False`)
- `region` (`str | None`, default `None`)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `BrowserProfile` A profile that loads, or is created, the first time it's used. Nothing is sent yet.

Usage:

```python
profile = noclick.BrowserProfile.from_name("ana-work", create_if_missing=True, user="user_42")
if not any(site.domain == "portal.example.com" for site in profile.sites):
    profile.login("https://portal.example.com", reason="to download your invoices").wait()
```

### BrowserProfile.from_id

```python
noclick.BrowserProfile.from_id(profile_id, *, client=None, user=...) -> BrowserProfile
```

A lazy reference to a profile by id.

Parameters:

- `profile_id` (`str`, required)
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Returns: `BrowserProfile` A profile that loads the first time you read a field. Nothing is sent yet.

Usage:

```python
profile = noclick.BrowserProfile.from_id("b7e1d3a9-4c2f-4e6b-8a5d-1f9c0e3b7a24")
print([site.domain for site in profile.sites])
```

### BrowserProfile.get

```python
noclick.BrowserProfile.get(profile_id, *, user=..., client=None) -> BrowserProfile
```

Load a profile by id now; an unknown id raises `noclick.NotFound`.

Parameters:

- `profile_id` (`str`, required)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `BrowserProfile` The profile, loaded, with the `sites` it is signed in to.

Usage:

```python
profile = noclick.BrowserProfile.get("b7e1d3a9-4c2f-4e6b-8a5d-1f9c0e3b7a24")
for site in profile.sites:
    print(site.domain, site.signed_in_at, site.last_used_at)
```

### BrowserProfile.list

```python
noclick.BrowserProfile.list(
    *, limit=None, user_filter=None, user=..., client=None
) -> list[BrowserProfile]
```

The current user's profiles (the account's own outside `as_user`, or those `user_filter` covers).

Parameters:

- `limit` (`int | None`, default `None`): Return at most this many.
- `user_filter` (`Any`, default `None`): Which users a read covers: `noclick.ALL_USERS`, `noclick.NO_USER`, a `User`, or your id for one. It filters without acting as that user.
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `list[BrowserProfile]` Every matching profile, newest first, fetched page by page, each with its `sites`.

Usage:

```python
for profile in noclick.BrowserProfile.list(user_filter=noclick.ALL_USERS):
    print(profile.user_id, profile.name, [site.domain for site in profile.sites])
```

### BrowserProfile.list_page

```python
noclick.BrowserProfile.list_page(
    *, cursor=None, limit=None, user_filter=None, user=..., client=None
) -> Page
```

One page of profiles; pass `next_cursor` back as `cursor`.

Parameters:

- `cursor` (`str | None`, default `None`): The `next_cursor` of the page before; omit it for the first page.
- `limit` (`int | None`, default `None`): Return at most this many.
- `user_filter` (`Any`, default `None`): Which users a read covers: `noclick.ALL_USERS`, `noclick.NO_USER`, a `User`, or your id for one. It filters without acting as that user.
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `Page` A page whose `data` holds the profiles and whose `next_cursor` is `None` on the last page.

Usage:

```python
page = noclick.BrowserProfile.list_page(limit=50)
while True:
    for profile in page.data:
        print(profile.name, profile.last_used_at)
    if page.next_cursor is None:
        break
    page = noclick.BrowserProfile.list_page(limit=50, cursor=page.next_cursor)
```

### BrowserProfile.login

```python
profile.login(url, *, human=None, reason=None) -> BrowserLogin
```

Ask a person to sign in to the site at `url` in a live browser; the
sign-in is saved to this profile. `human` is who is asked (a
`noclick.Human`): the profile's user when omitted. An account profile
with no `human` sends nothing, so pass the link's `url` on yourself.
You ask once: when the site signs the profile out later, the browser that
meets its sign-in page asks the same person again (`SiteLogin.signed_in_by`)
and saves the new sign-in. The link's browser starts (and is billed) only
once the person opens it, so a link nobody opens costs nothing.

Parameters:

- `url` (`str`, required)
- `human` (`Human | None`, default `None`)
- `reason` (`str | None`, default `None`)

Returns: `BrowserLogin` The sign-in link, already sent: its `url`, when it `expires_at` (in
24 hours) and where it went. `wait()` returns the `SiteLogin` once the person has signed in.

Usage:

Ask the user once, then use the sign-in whenever you need it:

```python
profile = noclick.BrowserProfile.from_name("ana-work", create_if_missing=True, user="user_42")
login = profile.login("https://portal.example.com", reason="to download your invoices")
site = login.wait()
print(site.domain, site.signed_in_at)
```

Or, for your account's own profile, ask someone by email:

```python
profile = noclick.BrowserProfile.from_name("acme-ops", create_if_missing=True)
login = profile.login("https://vendor.example.com", human=noclick.Human(email="ops@acme.test"))
print(login.delivered_via)   # ['email']
```

### BrowserProfile.forget

```python
profile.forget(domain) -> None
```

Sign the profile out of `domain` and drop what it and its subdomains
stored. A short browser (about a minute, billed like any) clears them and
saves the profile; this returns once it has. It refuses
(`noclick.Conflict` naming the browser) while another browser saves into
the profile, and a browser already using the profile keeps the old state
until it closes.

Parameters:

- `domain` (`str`, required)

Usage:

```python
profile = noclick.BrowserProfile.from_name("ana-work", user="user_42")
profile.forget("portal.example.com")
```

### BrowserProfile.delete

```python
profile.delete() -> None
```

Delete the profile and every sign-in in it.

Usage:

```python
noclick.BrowserProfile.from_name("ana-work", user="user_42").delete()
```

## noclick.BrowserLogin

```python
class BrowserLogin(Operation)
```

A live-browser link where a person signs in to a site, and the operation
that finishes once they have: `wait()` returns the `SiteLogin`.

| Attribute | Type | Description |
| --- | --- | --- |
| `url` | `str` | The page where the person signs in, in a live browser. |
| `expires_at` | `Any` |  |
| `domain` | `str | None` | The site's domain. |
| `delivered_via` | `list[str]` | Channels the link went out on (`["email"]`); empty when nobody was sent it. |
| `undelivered` | `list[dict[str, Any]]` | Channels that failed, each with a `reason`: send the link yourself. |

### BrowserLogin.list

```python
noclick.BrowserLogin.list(*, limit=None, **filters) -> list[Operation]
```

Sign-in operations (kind `browser.login`), newest first; takes
`Operation.list`'s filters except `kind`.

Parameters:

- `limit` (`int | None`, default `None`): Return at most this many.
- `filters` (`Any`)

Returns: `list[Operation]` Every matching operation (or the first `limit`); `wait()` on one returns the `SiteLogin`.

Usage:

```python
for op in noclick.BrowserLogin.list(status="awaiting_human", user_filter=noclick.ALL_USERS):
    print(op.user_id, op.summary_text, op.created_at)   # ... Sign in to portal.example.com ...
```

### BrowserLogin.list_page

```python
noclick.BrowserLogin.list_page(*, cursor=None, limit=None, **filters) -> Page
```

One page of sign-in operations; pass `next_cursor` back as `cursor`.

Parameters:

- `cursor` (`str | None`, default `None`): The `next_cursor` of the page before; omit it for the first page.
- `limit` (`int | None`, default `None`): Return at most this many.
- `filters` (`Any`)

Returns: `Page` A page whose `data` holds the operations and whose `next_cursor` is `None` on the last page.

Usage:

```python
page = noclick.BrowserLogin.list_page(status="expired", limit=50)
while True:
    for op in page.data:
        print(op.summary_text, op.updated_at)
    if page.next_cursor is None:
        break
    page = noclick.BrowserLogin.list_page(status="expired", limit=50, cursor=page.next_cursor)
```

### BrowserLogin.summary

```python
noclick.BrowserLogin.summary(**filters) -> OperationSummary
```

Count sign-in operations; takes `Operation.summary`'s filters except `kind`.

Parameters:

- `filters` (`Any`)

Returns: `OperationSummary` The `total` that match and a count for every status in `by_status`.

Usage:

```python
counts = noclick.BrowserLogin.summary(user_filter=noclick.ALL_USERS)
print(counts.by_status["awaiting_human"], counts.by_status["succeeded"])
```

## noclick.PageState

```python
class PageState
```

Where the browser is: the page's `url` (after redirects) and `title`.

| Attribute | Type | Description |
| --- | --- | --- |
| `url` | `str | None` |  |
| `title` | `str | None` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.ActResult

```python
class ActResult
```

How an `act` went: `done` says whether the task was finished (`False`:
it ran out of steps or couldn't go on, and `summary` says why). `steps` are
the actions it took (`action`, `detail`, `url`, and `target`: the element it acted on, as the page names
it); `downloads` the files it
saved (`name`, `size_bytes`, and a signed `url` valid for an hour).

| Attribute | Type | Description |
| --- | --- | --- |
| `done` | `bool` |  |
| `summary` | `str` |  |
| `steps` | `list[dict[str, Any]]` |  |
| `url` | `str | None` |  |
| `downloads` | `list[dict[str, Any]]` |  |
| `cost_usd` | `float | None` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.SiteLogin

```python
class SiteLogin
```

A site a profile is signed in to: its `domain`, when the person signed in and
who did, and when a browser last used the sign-in (None if never). When the site
signs the profile out, the next browser that meets its sign-in page asks
`signed_in_by` to sign in again in the live view, as it asks for a two-factor
code, and saves the new sign-in; `signed_in_at` then moves.

| Attribute | Type | Description |
| --- | --- | --- |
| `domain` | `str` |  |
| `signed_in_at` | `Any` |  |
| `signed_in_by` | `str | None` | The email of the person who signed in (the one `login` asked), and who is asked again when the sign-in expires; None for a sign-in made through a link you passed on yourself, and then the browser's `human` is asked. |
| `last_used_at` | `Any` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.BrowserWatchedStep

```python
class BrowserWatchedStep
```

A step of a browser's newest `act`, as a person watching it is told: what it did (`action`) and the
element it did it to (`target`: a field's label, a button's text), never what it typed.

| Attribute | Type | Description |
| --- | --- | --- |
| `action` | `str` |  |
| `target` | `str | None` |  |
| `at` | `Any` |  |

## noclick.BrowserWaitingOn

```python
class BrowserWaitingOn
```

A step a person is asked to finish in a browser, while its `act` waits on them: what they're asked to do
(`person`), and whether it's you they asked (`for_you`): only that person takes the browser over and hands
it back.

| Attribute | Type | Description |
| --- | --- | --- |
| `person` | `str` |  |
| `for_you` | `bool` |  |

## noclick.BrowserLink

```python
class BrowserLink
```

A person's page for a browser (`/live/{id}`): a browser's live view, a link to sign in to a site once, or a
step a model asked a person to finish, as the person its link reached uses it. The id is the capability: it works
until it's done, revoked (its browser closed, its work settled) or expired, and then every call raises
(`noclick.NotFound` for a link that never was, `noclick.NotAvailable` or `noclick.Expired` for one that
stopped working). The browser itself is shown in the person's own browser (`BrowserLink.view` in TypeScript).

Usage:

```python
link = noclick.BrowserLink(link_id)
if link.read().status == "open":
    link.start()
link.type(text="482913")
link.done()
```

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | `str` |  |

### noclick.BrowserLink

```python
noclick.BrowserLink(link_id, *, base_url=None, timeout=60.0, max_retries=3)
```

Parameters:

- `link_id` (`str`, required)
- `base_url` (`str | None`, default `None`)
- `timeout` (`float`, default `60.0`)
- `max_retries` (`int`, default `3`)

### BrowserLink.read

```python
browser_link.read() -> BrowserLinkPage
```

The link as its page shows it: what it's for, whether its browser works, and the account's brand.

Returns: `BrowserLinkPage` The `BrowserLinkPage`.

Usage:

```python
page = noclick.BrowserLink(link_id).read()
print(page.purpose, page.status)
```

### BrowserLink.start

```python
browser_link.start() -> BrowserLinkPage
```

Open a sign-in link: its browser starts now on the site (once; opening it again shows the same one).

Returns: `BrowserLinkPage` The `BrowserLinkPage`, `live` once its browser works.

Usage:

```python
noclick.BrowserLink(link_id).start()
```

### BrowserLink.type

```python
browser_link.type(*, text=None, key=None) -> None
```

Type `text` where the page has focus, or press `key` (`Enter`, `Backspace`, `Tab`, ...): one of
the two. A phone's way in.

Parameters:

- `text` (`str | None`, default `None`)
- `key` (`str | None`, default `None`)

Usage:

```python
link = noclick.BrowserLink(link_id)
link.type(text="482913")
link.type(key="Enter")
```

### BrowserLink.done

```python
browser_link.done() -> BrowserLinkPage
```

The person has finished: a sign-in is saved, the step a model asked for carries on. A live view has nothing
to finish (its browser closes instead).

Returns: `BrowserLinkPage` The `BrowserLinkPage`, `done`.

Usage:

```python
noclick.BrowserLink(link_id).done()
```

## noclick.BrowserLinkPage

```python
class BrowserLinkPage
```

A browser link as its page shows it (`BrowserLink.read`), never the account, its user or the browser: its
`purpose` (`live`, a browser's live view; `login`, a link to sign in to a site once; `ask`, a step a model
asked a person to finish), its `status` (`open`, a sign-in nobody started yet; `live` while its browser
works; then `done`, `expired` or `closed`), the site it's for, what it's for in the sender's words, when it
expires and the account's brand.

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | `str` |  |
| `purpose` | `str` |  |
| `status` | `str` |  |
| `domain` | `str | None` |  |
| `reason` | `str | None` |  |
| `expires_at` | `datetime | None` |  |
| `brand` | `BrowserLinkBrand` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.BrowserLinkBrand

```python
class BrowserLinkBrand
```

The account's brand, as a link's page wears it.

| Attribute | Type | Description |
| --- | --- | --- |
| `name` | `str | None` |  |
| `logo_url` | `str | None` |  |
| `color` | `str | None` |  |
| `support_url` | `str | None` |  |
