NAME

WebService::OpenStates - client for the Plural Open States API

DESCRIPTION

State-level legislator information for US locations, provided via the Plural Open States API.

You must obtain an API key (free) from Open States to use this package. See https://open.pluralpolicy.com/accounts/login/?next=/accounts/profile/#apikey.

SYNOPSIS

my $client = WebService::OpenStates->new( api_key => '***' );

my $res = $client->legislators_for_location(lat => 37.302268, lon => -78.39263);

if ( $res->{status} eq 'error') {
    # handle the error returned (JSON obj, see below)
}
else {
    for my $legislator ( @{$res->{legislators} ) {
        # use the data (JSON obj, see below)
    }
}

METHODS