Skip to content

bane73/openstates4j

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenStates4j

Note: THIS PROJECT IS STILL IN ALPHA.


REQUIREMENTS

	In order to use this project, you must first acquire a Sunlight Labs API Key.
	You can obtain a key by visiting http://services.sunlightlabs.com

	You should also review the Open States API documentation, as this interface
	is only meant to provide a thin wrapper around it and should (hopefully) 
	closely mirror it.
	
	All of the Objects, methods, and parameters represented by the API are 
	similarly represented by this wrapper.  Optional (and new) fields exposed 
	by the API will be found in a map (`'optionalProperties'`) on each Object.

	The API documentation can be found at http://openstates.org/api/


EXAMPLE

	OpenStates.setApiKey( {YOUR_SUNLIGHT_LABS_API_KEY} );
	
	// find all Districts for the state of California
	List<District> allCaliforniaDistricts = District.find( "ca" );
	
	// find all NY's upper-house Bills that have been updated since 01Jan2012
	Map<String, String> queryParams = new HashMap<String, String>();
	queryParams.put( "state", "ny" );
	queryParams.put( "updated_since", "2012-01-01" );
	queryParams.put( "chamber", "upper" );
	List<Bill> allRecentBillsInNyUpperHouse = Bill.find( queryParams );

	// find a specific Bill
	Bill aBill = allRecentBillsInNyUpperHouse.get(0);
	Bill targetBill = Bill.get( aBill.state, aBill.session, aBill.id );
	
	// finding Legislator's that represent a specific geo-area
	List<Legislator> geoLegislators = Legislator.find( "-78.76648", "35.81336" );
	
	// accessing a Legislator's properties
	Legislator legislator = geoLegislators.get(0);
	String id = legislator.id;
	String fullName = legislator.fullName;
	String email = legislator.email;
	boolean isActive = legislator.isActive;


HELP

	Please submit usage-questions to: 
	https://groups.google.com/forum/?fromgroups#!forum/fifty-state-project


BUGS

	Please submit all bugs to: https://github.com/bane73/openstates4j/issues

	
COPYRIGHT

	Copyright (c) 2012 by Brandon Gresham.  See LICENSE.txt for details.

About

Source for the Java interface to the Open States API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages