NAME

Antybrowser::SDK - Official Antybrowser SDK for Perl

VERSION

Version 1.0.2

SYNOPSIS

use Antybrowser::SDK;

my $client = Antybrowser::SDK->new(api_key => 'your_api_key');

# System status
my $status = $client->get_status();

# List profiles
my $profiles = $client->get_profiles();

# Create a profile
my $profile = $client->create_profile({ name => 'My Profile' });

# Start a profile (returns debug port)
my $result = $client->start_profile($profile->{id});
print "Debug port: $result->{data}{debugPort}\n";

# Stop and delete
$client->stop_profile($profile->{id});
$client->delete_profile($profile->{id});

DESCRIPTION

Antybrowser::SDK is the official Perl client for the Antybrowser Local API. It provides access to profiles, automations, groups, proxies, and extensions of a running Antybrowser desktop application.

INSTALLATION

From CPAN

cpan Antybrowser::SDK

From source

cd perl
perl Makefile.PL
make
make install

PREREQUISITES

  • The Antybrowser desktop app running with the Local API enabled.

  • An API key from Antybrowser Settings -> API.

  • Default port 5173 (configurable via the port option).

CONSTRUCTOR

new( %args )

Creates a new client. The api_key argument is required.

  • api_key - your Antybrowser API key (required)

  • port - Local API port (default: 5173)

  • base_url - override the full base URL (default: http://127.0.0.1:$port)

my $client = Antybrowser::SDK->new(api_key => 'key', port => 5173);

METHODS

All methods return a decoded JSON hashref. On HTTP errors the client dies with an error message (see "ERROR HANDLING").

System

  • get_status() - get system status (health check, no auth)

  • get_settings() - get all application settings

  • get_sync_status() - get sync queue status

  • refresh_sync($profile_id?) - trigger a sync refresh, optionally for a single profile

Profiles

  • get_profiles() - list all profiles

  • create_profile($data) - create a new profile from a hashref

  • update_profile($id, $data) - update an existing profile

  • delete_profile($id) - delete a profile

  • start_profile($id) - start a profile browser, returns the debug port

  • stop_profile($id) - stop a running profile

  • duplicate_profile($id, $name?) - clone a profile, optionally with a new name

Automations

  • get_automations() - list all automations

  • run_automation($id, $profile_id) - run an automation on a profile

Groups

  • get_groups() - list all groups

  • create_group($data) - create a group

  • update_group($id, $data) - update a group

  • delete_group($id) - delete a group

Proxies

  • get_proxies() - list all proxies

  • create_proxy($data) - add a proxy (validated)

  • check_proxy($data) - test a single proxy

  • delete_proxy($id) - delete a proxy

Extensions

  • get_extensions() - list all extensions

  • delete_extension($id) - delete an extension

  • get_profile_extensions($profile_id) - list extensions installed on a profile

  • set_profile_extensions($profile_id, \@extension_ids) - set the extensions of a profile

ERROR HANDLING

On any non-2xx response the client dies with a message of the form:

HTTP <code>: <response body>

Wrap calls in eval to handle errors gracefully:

my $profiles = eval { $client->get_profiles() };
if (!$profiles) {
    warn "Request failed: $@";
}

REPOSITORY

The source code is available on GitHub: https://github.com/antybrowser/SDK

WEBSITE

https://antybrowser.com

AUTHOR

Antybrowser.com <support@antybrowser.com>

LICENSE

This module is licensed under the MIT License. See the LICENSE file in the distribution for details.