Antybrowser-SDK
view release on metacpan or search on metacpan
lib/Antybrowser/SDK.pm view on Meta::CPAN
sub get_automations { $_[0]->_request('GET', '/api/automations') }
sub run_automation { $_[0]->_request('POST', "/api/automations/$_[1]/run", {profileId => $_[2]}) }
# Groups
sub get_groups { $_[0]->_request('GET', '/api/groups') }
sub create_group { $_[0]->_request('POST', '/api/groups', $_[1]) }
sub update_group { $_[0]->_request('PUT', "/api/groups/$_[1]", $_[2]) }
sub delete_group { $_[0]->_request('DELETE', "/api/groups/$_[1]") }
# Proxies
sub get_proxies { $_[0]->_request('GET', '/api/proxies') }
sub create_proxy { $_[0]->_request('POST', '/api/proxies', $_[1]) }
sub check_proxy { $_[0]->_request('POST', '/api/proxies/check', $_[1]) }
sub delete_proxy { $_[0]->_request('DELETE', "/api/proxies/$_[1]") }
# Extensions
sub get_extensions { $_[0]->_request('GET', '/api/extensions') }
sub delete_extension { $_[0]->_request('DELETE', "/api/extensions/$_[1]") }
sub get_profile_extensions { $_[0]->_request('GET', "/api/profiles/$_[1]/extensions") }
sub set_profile_extensions { $_[0]->_request('POST', "/api/profiles/$_[1]/extensions", {extensionIds => $_[2]}) }
1;
__END__
=head1 NAME
Antybrowser::SDK - Official Antybrowser SDK for Perl
=head1 VERSION
Version 1.0.2
=head1 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});
=head1 DESCRIPTION
C<Antybrowser::SDK> is the official Perl client for the
L<Antybrowser|https://antybrowser.com> Local API. It provides access to
profiles, automations, groups, proxies, and extensions of a running
Antybrowser desktop application.
=head1 INSTALLATION
=head2 From CPAN
cpan Antybrowser::SDK
=head2 From source
cd perl
perl Makefile.PL
make
make install
=head1 PREREQUISITES
=over 4
=item *
The L<Antybrowser|https://antybrowser.com> desktop app running with the
B<Local API> enabled.
=item *
An B<API key> from Antybrowser Settings -> API.
=item *
Default port B<5173> (configurable via the C<port> option).
=back
=head1 CONSTRUCTOR
=head2 new( %args )
Creates a new client. The C<api_key> argument is required.
=over 4
=item * C<api_key> - your Antybrowser API key (required)
=item * C<port> - Local API port (default: C<5173>)
=item * C<base_url> - override the full base URL (default:
C<http://127.0.0.1:$port>)
=back
my $client = Antybrowser::SDK->new(api_key => 'key', port => 5173);
=head1 METHODS
All methods return a decoded JSON hashref. On HTTP errors the client
dies with an error message (see L</ERROR HANDLING>).
=head2 System
=over 4
=item * C<get_status()> - get system status (health check, no auth)
=item * C<get_settings()> - get all application settings
=item * C<get_sync_status()> - get sync queue status
=item * C<refresh_sync($profile_id?)> - trigger a sync refresh,
optionally for a single profile
=back
=head2 Profiles
=over 4
=item * C<get_profiles()> - list all profiles
=item * C<create_profile($data)> - create a new profile from a hashref
=item * C<update_profile($id, $data)> - update an existing profile
( run in 2.175 seconds using v1.01-cache-2.11-cpan-b16cb0d3907 )