AliasMode Local API integration

Automate profiles with the AliasMode Local API.

The AliasMode Local API provides an AdsPower-compatible subset of profile, group, browser-control, cookie, cache, and CDP operations.

Local API (HTTP) — Playwright CDP — Windows — Tested 2026-08-10

Set up AdsPower-compatible clients

  1. Inventory current API calls

    Inventory endpoint and response dependencies the current AdsPower integration relies on.

  2. Map profile identifiers

    Map user_id values to AliasMode profiles found with GET /api/v1/user/list.

  3. Test status and browser lifecycle

    Point the migration adapter at http://127.0.0.1:50400 and test the status and browser start/stop routes first.

    curl http://127.0.0.1:50400/api/v1/status
  4. Confirm cookie and cache behavior

    Verify cookie retrieval and cache-clear behavior match what the current integration expects.

  5. Move profile creation and update last

    Move profile creation, update, and deletion calls only after read and lifecycle operations are verified.

Verify the connection

  • GET /api/v1/status returns a successful JSON response.
  • A test profile starts and returns a CDP URL in data.ws.puppeteer.
  • Cookie and cache routes return the expected data for that profile.
  • Profile create, update, and delete calls succeed in a non-production workspace.

Troubleshooting

SymptomFix
Local API is unavailable or connection refusedConfirm the AliasMode desktop app is running and the optional API is enabled, then request GET /status on 127.0.0.1:50400.
A route returns HTTP 200 but an error codeCheck the JSON envelope: code 0 means success. A successful HTTP response can still contain code -1 and an error message.
Browser start does not return a CDP URLConfirm the profile ID exists and the desktop app is open, then treat a missing CDP URL as a failed start.

Support level

Compatibility covers the documented AliasMode routes. Point a migration adapter at http://127.0.0.1:50400 and test each operation the existing tool uses.

  • GET /status
  • GET /api/v1/status
  • GET /api/v1/browser/start?user_id=&launch_args=
  • GET /api/v1/browser/stop?user_id=
  • GET /api/v1/browser/active?user_id=
  • POST /api/v2/browser-profile/delete-cache
  • GET /api/v1/browser/cookies?user_id=&urls=
  • GET /api/v1/group/list?page=&page_size=
  • POST /api/v1/group/create
  • GET /api/v1/user/list?page=&page_size=&group_id=&user_sort=
  • POST /api/v1/user/create
  • POST /api/v1/user/delete
  • POST /api/v1/user/update

Browser automation response

The start response includes data.ws.puppeteer and a debug port. Existing automation can use the returned CDP endpoint where it already supports a Puppeteer or Playwright connection.

import { chromium } from 'playwright';

const origin = 'http://127.0.0.1:50400';
// Find this ID with GET /api/v1/user/list.
const profileId = process.env.ALIASMODE_PROFILE_ID;
if (!profileId) throw new Error('Set ALIASMODE_PROFILE_ID');

const startUrl = new URL('/api/v1/browser/start', origin);
startUrl.searchParams.set('user_id', profileId);

let browser;
let started = false;
try {
  const startResponse = await fetch(startUrl);
  if (!startResponse.ok) {
    throw new Error(`AliasMode returned HTTP ${startResponse.status}`);
  }

  const payload = await startResponse.json();
  const cdpUrl = payload?.data?.ws?.puppeteer;
  if (payload?.code !== 0 || typeof cdpUrl !== 'string') {
    throw new Error(payload?.msg || 'AliasMode did not return a CDP URL');
  }

  started = true;
  browser = await chromium.connectOverCDP(cdpUrl);
  // Run automation with the connected browser.
} finally {
  try {
    await browser?.close();
  } finally {
    if (started) {
      const stopUrl = new URL('/api/v1/browser/stop', origin);
      stopUrl.searchParams.set('user_id', profileId);
      await fetch(stopUrl);
    }
  }
}