Antybrowser Logo

Antybrowser SDK — Dart

Official Dart client for the Antybrowser Local API. Manage browser profiles, proxies, automations, groups, and extensions programmatically.

pub.dev GitHub Stars License: MIT


Installation

Add to your pubspec.yaml:

dependencies:
  antybrowser: ^1.0.2

Then run:

dart pub get

Quick Start

import 'package:antybrowser/antybrowser.dart';

void main() async {
  final client = AntybrowserClient(
    apiKey: 'your_key',
    port: 5173,
  );

  // List profiles
  final profiles = await client.getProfiles();
  for (final p in profiles) {
    print('${p.name} (status: ${p.status})');
  }

  // Create a profile
  final profile = await client.createProfile(CreateProfileRequest(
    name: 'My Profile',
    browserType: 'Chrome',
    osFingerprint: 'Windows',
    language: 'en-US',
    useFingerprint: true,
  ));

  // Start it
  final result = await client.startProfile(profile.id);
  print('Debug port: ${result['data']['debugPort']}');

  client.dispose();
}

Configuration

// Default (port 5173)
final client = AntybrowserClient(apiKey: 'my_key');

// Custom port
final client = AntybrowserClient(apiKey: 'my_key', port: 5174);

// Custom base URL
final client = AntybrowserClient(
  apiKey: 'my_key',
  baseUrl: 'http://10.0.0.5:5173',
);

Error Handling

try {
  await client.getProfiles();
} on AntybrowserException catch (e) {
  print('Status: ${e.statusCode}');
  print('Body: ${e.body}');
}

API Methods

Method Description
getStatus() Check API connection
getSettings() Get settings
getSyncStatus() Get sync status
refreshSync() Trigger sync
getProfiles() List profiles
createProfile(request) Create profile
updateProfile(id, fields) Update profile
deleteProfile(id) Delete profile
startProfile(id) Start profile
stopProfile(id) Stop profile
duplicateProfile(id) Duplicate profile
getAutomations() List automations
runAutomation(id, profileId) Run automation
getGroups() List groups
createGroup(request) Create group
updateGroup(id, fields) Update group
deleteGroup(id) Delete group
getProxies() List proxies
createProxy(request) Create proxy
checkProxy(data) Check proxy
deleteProxy(id) Delete proxy
getExtensions() List extensions
deleteExtension(id) Delete extension
getProfileExtensions(id) Get profile extensions
setProfileExtensions(id, ids) Set profile extensions

License

MIT

Libraries

antybrowser