← Back to Docs

Local API • P0 Week3 - Like GoLogin/ixBrowser

Axum server on 127.0.0.1:9222 • Auth via X-API-Key: demo or VEIL- license • Tauri protected

Start API Server

// In Tauri App, tab API - Click Start API Server
await invoke('cmd_start_api_server') // Starts Axum on :9222
# Or via Rust
tokio::spawn(api_server::start_api_server)
Server listening on http://127.0.0.1:9222/api/v1/status
GET/api/v1/status- Service status
curl http://127.0.0.1:9222/api/v1/status -H "X-API-Key: demo"

{"status":"ok","service":"Veil Browser Local API"}
GET/api/v1/profiles/list- List all profiles
curl http://127.0.0.1:9222/api/v1/profiles/list -H "X-API-Key: demo"

{"success":true,"data":[...],"count":3}
POST/api/v1/profiles/start- Start profile, returns ws_endpoint
curl -X POST http://127.0.0.1:9222/api/v1/profiles/start -H "X-API-Key: demo" -d '{"profile_id":"prof_abc"}'

{"success":true,"data":{"profile_id":"prof_abc","ws_endpoint":"ws://..."}}
POST/api/v1/profiles/stop- Stop profile
curl -X POST http://127.0.0.1:9222/api/v1/profiles/stop -H "X-API-Key: demo" -d '{"profile_id":"prof_abc"}'
POST/api/v1/profiles/create- Create new profile
curl -X POST http://127.0.0.1:9222/api/v1/profiles/create -H "X-API-Key: demo" -d '{"name":"Test","proxy":"socks5://1.2.3.4:1080"}'

Puppeteer Example - Full Automation

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

async function run() {
  // 1. Start profile via local API
  const res = await fetch('http://127.0.0.1:9222/api/v1/profiles/start', {
    method: 'POST',
    headers: { 'X-API-Key': 'demo', 'Content-Type': 'application/json' },
    body: JSON.stringify({ profile_id: 'prof_abc123' })
  });
  const result = await res.json();
  console.log('WS Endpoint:', result.data.ws_endpoint);

  // 2. Connect Puppeteer
  const browser = await puppeteer.connect({ 
    browserWSEndpoint: result.data.ws_endpoint,
    defaultViewport: null
  });
  
  const page = await browser.newPage();
  await page.goto('https://pixelscan.net');
  await page.waitForTimeout(3000);
  await page.screenshot({ path: 'pixelscan-' + result.data.profile_id + '.png' });
  
  // 3. Check fingerprint
  const fp = await page.evaluate(() => {
    return {
      userAgent: navigator.userAgent,
      platform: navigator.platform,
      webdriver: navigator.webdriver
    };
  });
  console.log('Fingerprint:', fp);
  
  // 4. Stop profile
  await fetch('http://127.0.0.1:9222/api/v1/profiles/stop', {
    method: 'POST',
    headers: { 'X-API-Key': 'demo', 'Content-Type': 'application/json' },
    body: JSON.stringify({ profile_id: 'prof_abc123' })
  });
  
  await browser.disconnect();
}

run();
Tauri Rust Protected API - Like ixBrowser $3.99/mo API:
Axum server on 127.0.0.1:9222 with CORS Any, auth via X-API-Key demo or VEIL- license. Returns ws_endpoint for puppeteer-core connect. Parity with GoLogin API $24/mo, AdsPower API $9/mo, ixBrowser API $3.99/mo. Test: Start API server in Tauri App tab API, then curl http://127.0.0.1:9222/api/v1/status -H "X-API-Key: demo"