contactmyreps/sunlight-php

A PHP wrapper for Sunlight Foundation's API

v1.0 2016-03-03 00:14 UTC

This package is not auto-updated.

Last update: 2024-09-14 18:47:41 UTC


README

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

A limited PHP wrapper for the Sunlight Foundation APIs designed for use on contactmyreps.org

Install

Via Composer

$ composer require contactmyreps/sunlight-php

Usage

$sunlight = new Sunlight($apikey);
$openStates = $sunlight->openStates();
$congress = $sunlight->congress();

//get all Alabama's state legislators
$states->legislators(
    [
        'state' => 'AL'
    ],
);

//get all State reps serving a gps coordinate
$states->geoLookup($lat, $lng);

//get all Congressional representatives serving an area
$congress->locateByZip(11111);
$congress->locateByGeo($lat, $lng);

$request methods can be passed an optional extra array argument of display fields to return (last_name, first_name, etc.)

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

If you discover any security related issues, please email edfialk@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.