# Quick Start: Headless Browser

Oxylabs [Headless Browser](https://oxylabs.io/products/headless-browser) is a cloud-hosted browser infrastructure that handles anti-bot systems, CAPTCHAs, and proxy rotation automatically. It is fully compatible with Playwright, Puppeteer, and the Model Context Protocol (MCP) for AI applications.

{% stepper %}
{% step %}

### Setup & credentials

1. **Create an account:** Sign up at the [Oxylabs Dashboard](https://dashboard.oxylabs.io/).
2. **Choose a plan:** Select a plan or a free trial under Scraping Solutions → Headless Browser.
3. **Create user credentials:** Head to the Users tab in the Headless Browser product section and create a username and password (These credentials are used for WebSocket authentication).
   {% endstep %}

{% step %}

### Your first request

Oxylabs Headless Browser uses the Chrome DevTools Protocol (CDP). You can connect to it using Playwright or Puppeteer without managing local browser binaries.

**Python + Playwright example:**

1. Install Playwright: `pip install playwright`
2. Run the following script (replace `USERNAME` and `PASSWORD` with your credentials):

```python
from playwright.sync_api import sync_playwright

username = "USERNAME"
password = "PASSWORD"
endpoint = "ubc.oxylabs.io"
browser_url = f"wss://{username}:{password}@{endpoint}"

with sync_playwright() as p:
    # Connect to the remote Oxylabs browser
    browser = p.chromium.connect_over_cdp(browser_url)
    page = browser.new_page()
    
    page.goto('https://oxylabs.io/')
    print(f"Page Title: {page.title()}")
    
    browser.close()
```

{% endstep %}
{% endstepper %}

### Connection reference

Use the endpoint that matches your preferred browser and geographic proximity:

| Browser | Global endpoint        | US-based endpoint         |
| ------- | ---------------------- | ------------------------- |
| Chrome  | `wss://ubc.oxylabs.io` | `wss://ubc-us.oxylabs.io` |
| Firefox | `wss://ubs.oxylabs.io` | `wss://ubs-us.oxylabs.io` |

### Customizing the browser

You can also pass instructions directly through the connection URL using query parameters:

| Parameter  | Example            | Description                                               |
| ---------- | ------------------ | --------------------------------------------------------- |
| `p_cc`     | `?p_cc=US`         | Routes the browser's traffic through a specific country.  |
| `p_device` | `?p_device=mobile` | Emulates a specific device type (Chrome only).            |
| `o_vnc`    | `?o_vnc=true`      | Enables the Session Inspection Tool for visual debugging. |

### Next steps

* **Want to monitor your browser?** Learn about the [Session Inspection Tool](/products/headless-browser/features/session-inspection.md) to visually track your script's interactions with the browser in real-time.
* **Is your script too slow?** Try [Optimizing Traffic](/products/headless-browser/optimizing-traffic.md) to block unnecessary assets from loading. This will increase scraping speed and reduce bandwidth consumption.
* **Encountering errors or timeouts?** Visit the [Troubleshooting Guide](/products/headless-browser/troubleshooting-guide.md) to resolve common CDP connection issues, library version mismatches, and execution timeouts.
* **Hitting a "403 Forbidden" on a major site?** Check the [Restricted Targets](/products/headless-browser/restricted-targets.md) list to see which websites or services are restricted from access for the Headless Browser.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.oxylabs.io/get-started/quick-start-headless-browser.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
