# Cloud Browser

Start, stop, connect to, and manage cloud browser environments programmatically through the MoreLogin API.

## Overview

The Cloud Browser API runs a MoreLogin browser profile on a remote host. After you start an environment, you connect to it over the Chrome DevTools Protocol (CDP) and drive it with automation frameworks such as Puppeteer, Playwright, or Selenium.

**Cloud Browser supports two API access methods:**

| Method | Base URL | Use Case |
|  --- | --- | --- |
| **Open API** (Remote) | `https://api.morelogin.com` | Access from anywhere, OAuth2 authentication |
| **Local API** (Local) | `http://127.0.0.1:40000` | Access from the machine running MoreLogin client |


> Choose **Open API** if you need remote access or server-to-server integration.
Choose **Local API** if you are running automation on the same machine as the MoreLogin client.


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

## Capabilities

| Operation | Description |
|  --- | --- |
| **Start** | Start a cloud browser environment |
| **Stop** | Stop a running environment, optionally forcing release |
| **Page** | Query environments by page with filters for name, group, and keyword |
| **Connect** | Get the CDP address for a running environment to attach automation tools |


## Typical Workflow

1. **Start** the environment with `envId`. The environment enters the `STARTING` state.
2. **Poll** the paginated list until `cloudBrowserStatus` is `RUNNING`.
3. **Connect** to retrieve the `cdpUrl`, then attach Puppeteer / Playwright / Selenium over CDP.
4. **Stop** the environment when the automation finishes.


## Environment Status

| Status | Description |
|  --- | --- |
| `STARTING` | Starting up |
| `RUNNING` | Running |
| `CLOSED` | Closed |


## 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 with the access `token`. Pass it to Puppeteer, Playwright, or Selenium. |
| `accessUrl` | Browser-based remote desktop page for viewing and controlling the session. Empty if not configured. |


> The `accessUrl` token is a Base64-encoded payload carrying the desktop URL, desktop token, expiry, and team, user, member, and environment IDs. Treat both URLs as credentials and do not share them.


## API Reference

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


> **Note**: Both APIs expose the same operations. Local API paths use the `/api/cloudbrowser/...` prefix, while Open API paths use `/cloudbrowser/...`. Always refer to the specific API reference for exact paths and parameters.


## Related Guides

| Guide | Description |
|  --- | --- |
| [Authentication](/api-reference/getting-started/authentication) | OAuth2 token setup (Open API) and token auth (Local API) |
| [Quickstart](/api-reference/getting-started/quickstart) | Run your first MoreLogin API call |