Skip to content
Last updated

Get up and running with the MoreLogin API in 5 minutes.


Browser Automation (Local API)

Scenario: Create a browser profile, launch it, connect via Puppeteer to run a script, and then stop it.

Prerequisites

  • MoreLogin desktop app v2.15.0+ installed and running locally.
  • Puppeteer installed (npm i puppeteer-core).

Step 1: Create a Browser 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
  }'

Save the envId from the response (e.g., 1993244721490239488).

Step 2: Start the Profile & Get Debug Port

curl -X POST "http://127.0.0.1:40000/api/env/start" \
  -H "Content-Type: application/json" \
  -d '{"envId": "1993244721490239488"}'

The response will include the debugPort (e.g., 12345).

Step 3: Connect Puppeteer (Node.js)

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

(async () => {
  const browser = await puppeteer.connect({
    browserURL: 'http://127.0.0.1:12345'
  });
  const page = await browser.newPage();
  await page.goto('https://www.morelogin.com');
  console.log(await page.title());
  await browser.disconnect();
})();

Step 4: Stop the Profile

curl -X POST "http://127.0.0.1:40000/api/env/close" \
  -H "Content-Type: application/json" \
  -d '{"envId": "1993244721490239488"}'

Cloud Phone Management (Open API)

Scenario: Quick-create a cloud phone, start it, install an application, and trigger an RPA schedule.

Prerequisites

  • API ID and API Key from the MoreLogin dashboard.

Step 1: Get Access Token

curl -X POST "https://api.morelogin.com/oauth2/token" \
  -H "Content-Type: application/json" \
  -d '{
    "client_id": "YOUR_API_ID",
    "client_secret": "YOUR_API_KEY",
    "grant_type": "client_credentials"
  }'

Save the access_token from the response.

Step 2: Quick Create & Start Cloud Phone

curl -X POST "https://api.morelogin.com/cloudphone/newMachine" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -d '{
    "androidVersion": 10,
    "duration": 30,
    "unit": 1
  }'

Save the id (Cloud Phone ID) from the response.

Step 3: Install an App

Assuming you already have an appVersionId from the app library:

curl -X POST "https://api.morelogin.com/cloudphone/app/install" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -d '{
    "id": 1673823102599682,  # Your Cloud Phone ID
    "appVersionId": "1672940217990530"
  }'

Step 4: Run an RPA Schedule

Execute a pre-configured automation script on your new cloud phone:

curl -X POST "https://api.morelogin.com/cloudphone/rpa/onceTask/save" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -d '{
    "cloudPhoneId": 1673823102599682,
    "scheduleName": "Daily Login Task",
    "templateId": 987654321
  }'

What's Next?

GoalGo to
Full Browser Profile API referenceBrowser API
Full Cloud Phone API referenceCloud Phone API
Set up Docker for headless modeDocker Deployment
Connect via ADBADB Connection Guide