Documentation



The API makes data available from a web service via standard Web protocols. These are SOAP, XML and HTTP. Consumers of the web service need not align platforms, object models or programming languages with the web service. Accessing the service only requires the ability to send and receive SOAP messages (with HTTP and XML). The sample code page describes interacting with the web service with PHP.

The API web service is available at: http://www.votesapi.com/services/votes.asmx. However, interacting with this service requires existing registration and approval. Once registered and approved, details and web service information is available by visiting http://www.votesapi.com/services/votes.asmx with a standard browser.

The API web service offers a set of methods listed below.

getActionByID

expects:
ActionID integer required
returns:
One Action, including all values in relation.

getActionType

expects:
nothing
returns:
All Action Types

getActions

expects:
SiteID integer required
BillID integer optional send NULL or 0 if not needed
ChamberSessionID integer optional send NULL or 0 if not needed
IsMotion string(3) optional options: "Yes/yes" - send NULL or EMPTY if not needed
IsChamberVote string(3) optional options: "Yes/yes" - send NULL or EMPTY if not needed
IsGovernorDecision string(3) optional options: "Yes/yes" - send NULL or EMPTY if not needed
IsVotedOn string(3) optional options: "Yes/yes" - send NULL or EMPTY if not needed
IsVoteTypeRollCall string(3) optional options: "Yes/yes" - send NULL or EMPTY if not needed
SetPage integer optional send NULL or 0 if not needed
SetPageSize integer optional send NULL or 0 if not needed
ColumnInOrder string(45) optional send NULL or EMPTY if not needed
SortOrder string(4) optional options: "ASC/DESC" - send NULL or EMPTY if not needed
returns:
Actions for a given State/Site.
TotalRecords integer output
TotalPages integer output
CurrentPage integer output

getActionsInVotingProgress

expects:
SiteID integer required
House string(20) optional options: "Assembly/Senate" - send NULL or EMPTY if not needed
SetPage integer optional send NULL or 0 if not needed
SetPageSize integer optional send NULL or 0 if not needed
ColumnInOrder string(45) optional send NULL or EMPTY if not needed
SortOrder string(4) optional options: "ASC/DESC" - send NULL or EMPTY if not needed
returns:
Motions In Progress for a given State/Site.
TotalRecords integer output
TotalPages integer output
CurrentPage integer output

getAllCategories

expects:
Nothing
returns:
All Categories

getBillsMostActive

expects:
SiteID integer required
returns:
Bills with most activity for a given State/Site.
NumOfResults integer output

getBillType

expects:
Nothing
returns:
All Bill Types

getBills

expects:
SiteID integer required
BillTypeID integer optional send NULL or 0 if not needed
StartDate string optional send NULL or EMPTY if not needed
EndDate string optional send NULL or EMPTY if not needed
Number integer optional send NULL or 0 if not needed
Keywords string(255) optional send NULL or EMPTY if not needed
ChamberID integer optional send NULL or 0 if not needed
ChamberSessionID integer optional send NULL or 0 if not needed
LegislatorID integer optional send NULL or 0 if not needed
CategoryID integer optional send NULL or 0 if not needed
HasAction string(3) optional options: "Yes" - send NULL, EMPTY or "No" if not needed
StatusID integer optional option: "0" to get only Bills In Progresss
option: "1" to get only Bills that have been Signed or Vetoed
option: "100" to get only Bills that have been Signed
send NULL or "-1" if not needed
SetPage integer optional send NULL or 0 if not needed
SetPageSize integer optional send NULL or 0 if not needed
ColumnInOrder string(45) optional send NULL or EMPTY if not needed
SortOrder string(4) optional options: "ASC/DESC" - send NULL or EMPTY if not needed
returns:
Bills for a given State/Site.
TotalRecords integer output
TotalPages integer output
CurrentPage integer output

getCategoriesPopularParents

expects:
SiteID integer required
returns:
Categories associated with most number of Bills.

getCategory

expects:
SiteID integer required
CategoryID integer optional send NULL or 0 if not needed
BillID integer optional send NULL or 0 if not needed
returns:
Categories for a given State/Site.

getChamberBillType

expects:
SiteID integer required
returns:
A combination of Session + Chamber + BillType values for a given State/Site.
e.g. Primary Session + Assembly + Bill
e.g. Extraordinary Session + Senate + Joint Resolution

getChamberSession

expects:
SiteID integer required
LegislatorID integer optional send NULL or 0 if not needed
returns:
A combination of Chamber + Session + SessionStartDate + SessionEndDate values for a given State/Site.
e.g. Assembly + Primary Session + 1/1/2009 + 12/31/2010

getCommittee

expects:
SiteID integer required
StartDate string optional send NULL or EMPTY if not needed
EndDate string optional send NULL or EMPTY if not needed
LegislatorID integer optional send NULL or 0 if not needed
returns:
Committees for a given State/Site.

getDistrict

expects:
SiteID integer required
returns:
Districts for a given State/Site.

getGovernor

expects:
SiteID integer required
StartDate string optional send NULL or EMPTY if not needed
EndDate string optional send NULL or EMPTY if not needed
returns:
Governor of a given State/Site.

getGovernorDecision

expects:
Nothing
returns:
Governor Decision Types (e.g. Signed/Vetoed/...)

getLegislator

expects:
LegislatorID integer required
returns:
Detailed information on a given Legislator.

getLegislatorByChamber

expects:
ChamberSessionID integer required
StartDate string optional send NULL or EMPTY if not needed
EndDate string optional send NULL or EMPTY if not needed
ShowOnlyEligibleToVote string optional options: "Yes/yes" - send NULL or EMPTY if not needed
returns:
Legislators of a given Chamber and Session.

getLegislators

expects:
SiteID integer required
ChamberSessionID integer optional send NULL or 0 if not needed
RoleID integer optional send NULL or 0 if not needed
BillID integer optional send NULL or 0 if not needed
PartyID integer optional send NULL or 0 if not needed
DistrictID integer optional send NULL or 0 if not needed
CommitteeID integer optional send NULL or 0 if not needed
SetPage integer optional send NULL or 0 if not needed
SetPageSize integer optional send NULL or 0 if not needed
ColumnInOrder string(45) optional send NULL or EMPTY if not needed
SortOrder string(4) optional options: "ASC/DESC" - send NULL or EMPTY if not needed
returns:
Legislators for a given State/Site.
TotalRecords integer output
TotalPages integer output
CurrentPage integer output

getMotionType

expects:
Nothing
returns:
Motion Types (e.g. Vote/Referred/...)

getParty

expects:
Nothing
returns:
Parties

getRole

expects:
Nothing
returns:
Roles (e.g. Representative/Senator/...)

getSite

expects:
Nothing
returns:
States/Sites.

getVote

expects:
RollCallID integer required
returns:
Voting results for a given Roll Call.

getVoteResult

expects:
Nothing
returns:
Voting Result Types (e.g. Pass/Fail/...).

getVoteType

expects:
Nothing
returns:
Voting Types (e.g. Voice Vote/Roll Call/...).

getVotes

expects:
SiteID integer required
LegislatorID integer optional send NULL or 0 if not needed
BillID integer optional send NULL or 0 if not needed
CategoryID integer optional send NULL or 0 if not needed
RollCallID integer optional send NULL or 0 if not needed
VoteBallot string optional options: "Y/N/X" - send NULL or EMPTY if not needed
StartDate string optional send NULL or EMPTY if not needed
EndDate string optional send NULL or EMPTY if not needed
SetPage integer optional send NULL or 0 if not needed
SetPageSize integer optional send NULL or 0 if not needed
ColumnInOrder string(45) optional send NULL or EMPTY if not needed
SortOrder string(4) optional options: "ASC/DESC" - send NULL or EMPTY if not needed
returns:
Votes for a given State/Site.
TotalRecords integer output
TotalPages integer output
CurrentPage integer output