Bright Data Browser API Run
Overview
Treat Browser API as a remote-browser data plane, not an unlimited browsing identity. Bind one browser zone, a public-target manifest, an interaction ceiling, and a minimal output schema before connecting.
Prerequisites
- A Browser API zone username/password stored in the runtime secret manager
- An approved public target and interaction manifest
- Playwright plus the reviewed Bright Data Python SDK or current documented client
Instructions
Step 1: Approve the task
Read the task manifest and Grep for login, account creation, purchase, message, or other prohibited interactions. Refuse any nonpublic or abusive workflow.
Step 2: Connect through the SDK
Build the connect URL with the official client and keep credentials out of logs.
from brightdata import BrightDataClient
client = BrightDataClient(
browser_username=browser_user,
browser_password=browser_password,
)
# Pass client.browser.get_connect_url() only to Playwright connect_over_cdp.
Step 3: Constrain the page
Allow only the manifest host set, cap navigation and wall time, block unnecessary assets where appropriate, and extract only named public fields. Do not add evasion behavior after a policy denial.
Step 4: Review and close
Use Bash(python:*) for fixture-backed browser tests. Persist the task ID, target class, field counts, provider errors, and policy decision; discard raw page content unless retention was explicitly approved.
Tool Discipline
Use Read and Grep to verify the manifest and existing browser adapter. Use Write and Edit for the bounded task, schema, and tests. Use Bash(python:*) for offline tests; connecting a live browser still requires the recorded authorization gates.
Output
- A bounded Browser API task manifest
- Schema-validated public fields and redacted run receipt
- Explicit close, retry, or policy-escalation result
Examples
Use Browser API for an approved public page that requires JavaScript to render a price table. Navigate only to allowlisted hosts, extract the three approved fields, close the browser in finally, and reject any redirect to authentication.
Error Handling
| Failure | Meaning | Response |
|---|---|---|
| Connection is rejected | Zone credentials, entitlement, or egress is wrong | Verify the owned zone; do not expose the connect URL |
| Page redirects to login | The task crossed into nonpublic data | Stop and mark the target out of scope |
| Policy error is returned | Product or target is not authorized | Escalate; never add bypass behavior |