Perl API wrapper for MailChimp

Posted by dpirotte on March 14, 2009

Mail::Chimp::API is a simple Perl wrapper around the MailChimp v1.1 API. The object exposes the MailChimp XML-RPC methods and confesses fault codes/messages when errors occur.

For example…

use strict;
use warnings;
use Mail::Chimp::API;

my $chimp = Mail::Chimp::API->new($username, $password);

my $campaigns   = $chimp->campaigns;
my $lists       = $chimp->lists;
my $subscribers = $chimp->listMembers($lists->[0]->{id});

print 'success' if $chimp->listSubscribe($lists->[0]->{id}, 'someone@somewhere.com', {}, 1);

You can download it from github or from CPAN.

Enjoy!