# Browser

Create, configure, and automate MoreLogin anti-detection browser profiles.

## Overview

A **browser profile** is a persistent anti-detection configuration: fingerprint, proxy, cookies, startup
behavior, group, and tags. You create and manage profiles once, then run them wherever you need.

A profile can run in two places:

| Runtime | Where the browser runs | Started with |
|  --- | --- | --- |
| **Local runtime** | The machine running the MoreLogin desktop client | `POST /api/env/start` |
| **Cloud runtime** | MoreLogin infrastructure | `POST /cloudbrowser/start` or `POST /api/cloudbrowser/start` |


Either way you attach Puppeteer, Playwright, or Selenium over the Chrome DevTools Protocol (CDP).

> **Local API and Open API describe where you call from, not where the browser runs.** A cloud runtime
still runs in the MoreLogin cloud even when you start it through the Local API.


## Choosing an API

|  | **Local API** | **Open API** |
|  --- | --- | --- |
| **Base URL** | `http://127.0.0.1:40000` | `https://api.morelogin.com` |
| **Called from** | The machine running the MoreLogin client | Any server |
| **Authentication** | Optional static token, configurable in the client | OAuth2 access token, always required |
| **Manage profiles, proxies, groups, tags** | Yes | Yes |
| **Start a browser on your own machine** | Yes | No |
| **Start a cloud runtime** | Yes | Yes |
| **Requires the desktop client** | Yes, v2.15.0+ | No |


The Open API has no endpoint that launches a browser on your machine, because no local client is involved.
When you need a browser from a server, start a cloud runtime instead.

For credentials, see [Authentication](/api-reference/getting-started/authentication).

## Capabilities

| Group | Description |
|  --- | --- |
| **Profiles** | Create, update, query, and delete profile configurations |
| **Runtime** | Launch and control profiles on this machine (Local API only) |
| **Cloud Runtime** | Start, stop, query, and connect to profiles running in the cloud |
| **Fingerprint & Device Config** | Kernel versions, user agents, resolutions, languages, time zones, device models |
| **Cache & Window** | Clear profile cache and arrange profile windows |


Proxies, groups, and tags are shared with other MoreLogin products and are documented under
[Shared Resources](/api-reference/shared-resources). Profiles reference them by ID.

## Quick example: local runtime

```bash
# 1. Create a profile
curl -X POST "http://127.0.0.1:40000/api/env/create/quick" \
  -H "Content-Type: application/json" \
  -d '{"browserTypeId": 1, "operatorSystemId": 1, "quantity": 1}'

# 2. Start it on this machine (use envId from step 1)
curl -X POST "http://127.0.0.1:40000/api/env/start" \
  -H "Content-Type: application/json" \
  -d '{"envId": "YOUR_ENV_ID"}'
```

The start response returns a **debug port** and a **WebDriver path**.

### Selenium

```python
from selenium import webdriver

options = webdriver.ChromeOptions()
options.debugger_address = "127.0.0.1:DEBUG_PORT"
driver = webdriver.Chrome(
    executable_path="WEBDRIVER_PATH",
    options=options
)
driver.get("https://example.com")
```

### Puppeteer

```javascript
const puppeteer = require('puppeteer-core');

const browser = await puppeteer.connect({
  browserURL: 'http://127.0.0.1:DEBUG_PORT'
});
const page = await browser.newPage();
await page.goto('https://example.com');
```

## Quick example: cloud runtime

```bash
# 1. Start the cloud runtime
curl -X POST "https://api.morelogin.com/cloudbrowser/start" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -d '{"envId": "YOUR_ENV_ID"}'

# 2. Poll until cloudBrowserStatus is RUNNING
curl -X POST "https://api.morelogin.com/cloudbrowser/page" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -d '{"pageNo": 1, "pageSize": 10, "envId": "YOUR_ENV_ID"}'

# 3. Get the CDP address
curl -X POST "https://api.morelogin.com/cloudbrowser/connect" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -d '{"envId": "YOUR_ENV_ID"}'
```

Starting is asynchronous. A successful start response only means the request was accepted.

### Cloud runtime status

| Status | Description |
|  --- | --- |
| `STARTING` | Starting up |
| `RUNNING` | Running and ready to connect |
| `CLOSED` | Not started, closed, or failed to start |


### Connection details

The connect endpoint returns two addresses:

```json
{
  "code": 0,
  "msg": null,
  "data": {
    "cdpUrl": "https://runtime1.morelogin.com:16167?token=c62fedaaac524e41a0f02fc4345d41cb",
    "accessUrl": "https://official-website.morelogin.com/browser-remote?token=eyJkZXNrdG9wVXJsIjoi...ZW52SWQiOiIyMDczMzk1NDg5NzM4OTE5OTM2In0%3D&envName=P-1267&lang=en-US"
  }
}
```

| Field | Description |
|  --- | --- |
| `cdpUrl` | CDP endpoint including the access `token`. Pass it to Puppeteer, Playwright, or Selenium. |
| `accessUrl` | Browser-based remote desktop page for viewing and controlling the session. `null` when the page wrapper is not configured. |


> Both URLs are short-lived credentials. Do not log, persist, or share them. Calling connect again issues a
new desktop token and can invalidate an earlier viewer session.


## ID encoding

MoreLogin IDs such as `envId`, `groupId`, `proxyId`, and `tagId` are 64-bit integers on the server, but they
are serialized in JSON as **decimal strings** to avoid precision loss in JavaScript. Send them as strings and
read them as strings.

## API Reference

| API | Description |
|  --- | --- |
| [Browser Local API](/api-reference/browser/local-api) | Local access via `http://127.0.0.1:40000`. Profiles, local runtime, cloud runtime. |
| [Browser Open API](/api-reference/browser/open-api) | Remote access via `https://api.morelogin.com`. Profiles and cloud runtime. |


> Local API paths use the `/api/` prefix, for example `/api/env/page`. Open API paths omit it, for example
`/env/page`.


## Requirements

|  | Local API | Open API |
|  --- | --- | --- |
| MoreLogin desktop client | Required, v2.15.0+ | Not required |
| Signed in to a MoreLogin account | Required | Required |
| Request origin | Local machine only | Any host |
| API ID and API Key | Only when local authentication is enabled | Required |


## Related guides

| Guide | Description |
|  --- | --- |
| [Authentication](/api-reference/getting-started/authentication) | Local token setup and OAuth2 token exchange |
| [Local API vs Open API](/api-reference/getting-started/local-vs-open-api) | How the two access methods differ |
| [Quickstart](/api-reference/getting-started/quickstart) | Run your first MoreLogin API call |
| [Shared Resources](/api-reference/shared-resources) | Proxies, groups, and tags used by profiles |