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
portoption).
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 settingsget_sync_status()- get sync queue statusrefresh_sync($profile_id?)- trigger a sync refresh, optionally for a single profile
Profiles
get_profiles()- list all profilescreate_profile($data)- create a new profile from a hashrefupdate_profile($id, $data)- update an existing profiledelete_profile($id)- delete a profilestart_profile($id)- start a profile browser, returns the debug portstop_profile($id)- stop a running profileduplicate_profile($id, $name?)- clone a profile, optionally with a new name
Automations
get_automations()- list all automationsrun_automation($id, $profile_id)- run an automation on a profile
Groups
get_groups()- list all groupscreate_group($data)- create a groupupdate_group($id, $data)- update a groupdelete_group($id)- delete a group
Proxies
get_proxies()- list all proxiescreate_proxy($data)- add a proxy (validated)check_proxy($data)- test a single proxydelete_proxy($id)- delete a proxy
Extensions
get_extensions()- list all extensionsdelete_extension($id)- delete an extensionget_profile_extensions($profile_id)- list extensions installed on a profileset_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
AUTHOR
Antybrowser.com <support@antybrowser.com>
LICENSE
This module is licensed under the MIT License. See the LICENSE file in the distribution for details.