OpenCongress API Documentation
Welcome. This API provides programmers with structured access to all the data on OpenCongress, everything from official bill info to news and blog coverage to user-generated votes on bills and much more. The data below is just a start -- we will continually add more unique info & useful enhancements in order to contribute public knowledge about Congress back to the data commons on the open Web. We're always interested in hearing requests or seeing use cases of how you're using this API -- see the Developer Resources at the bottom of this page.
This API defaults to returning XML. All queries can also return JSON by adding a .json file extension, or by specifying format=json as a URL parameter. JSONP is also supported, via a callback parameter. The API defaults to returning 30 results. You can pass the per_page variable to decrease this (30 is the max), and the page variable to flip through pages.
People API
The people API is used to query the system for individuals, or groups of people matching given criteria. The following describes the parameters that can be used.
- First Name (first_name)
-
Specify the first name of the person
http://api.opencongress.org/people?first_name=John - Last Name (last_name)
-
Specify the last name of the person
http://api.opencongress.org/people?last_name=Kerry - OpenCongress ID (person_id)
-
Specify the id of the person
http://api.opencongress.org/people?person_id=300056 - Gender (gender)
-
Specify the gender of the person, either 'M' or 'F'
http://api.opencongress.org/people?gender=M&last_name=Kennedy - State (state)
-
Specify the two letter state of the person
http://api.opencongress.org/people?first_name=John&state=AZ - District (district)
-
Specify the congressional district of the person
http://api.opencongress.org/people?district=1&state=FL - Party (party)
-
Specify the political party of the person, either 'Republican', 'Democrat', or 'Independent'
http://api.opencongress.org/people?party=Republican&state=FL - User Approval Range (user_approval_from, user_approval_to)
-
Specify an average OpenCongress user approval rating range (0.0 to 10.0)
http://api.opencongress.org/people?user_approval_from=5.0&user_approval_to=10.0 - Senators most in the news this week
- http://api.opencongress.org/senators_most_in_the_news_this_week
- Representatives most in the news this week
- http://api.opencongress.org/representatives_most_in_the_news_this_week
- Most blogged Senators this week
- http://api.opencongress.org/most_blogged_senators_this_week
- Most blogged Representatives this week
- http://api.opencongress.org/most_blogged_representatives_this_week
- Compare Two People
- Specify the ID's of two people to compare, and receive XML of their roll call vote comparisons.
http://api.opencongress.org/person/compare.xml?person1=300001&person2=300013 - People Approved of by Open Congress Users are Also
-
Returns bills, representatives, and senators supported and opposed by users's approving of a given person.
http://api.opencongress.org/opencongress_users_supporting_person_are_also/300060 - People Disapproved of by Open Congress Users are Also
-
Returns bills, representatives, and senators supported and opposed by users's disapproving of a given person.
http://api.opencongress.org/opencongress_users_opposing_person_are_also/300060 - Open Congress Users tracking person are also tracking
-
Returns bills, people, and issues commonly tracked by people tracking a given person.
http://api.opencongress.org/opencongress_users_tracking_person_are_also_tracking/300060
Bills API
The Bills API is used to query OpenCongress for bills matching given criteria. The following describes the functions and parameters that can be used.
- Bills by session of congress
-
Returns bills matching the given congress.
http://api.opencongress.org/bills?congress=113 - Bills by type
-
Returns bills matching the given type. Type can be: h (house),
s (senate), hj (house joint resolution), sj (senate joint resolution), hc (house concurrent resolution)
sc (senate concurrent resolution), hr (house resolution), sr (senate resolution)
http://api.opencongress.org/bills?type=h&congress=113 - Bills by number
-
Returns bills matching the given number.
http://api.opencongress.org/bills?number=5749&type=h&congress=113 - Bills by ident
-
Returns bills matching the given OpenCongress identification strings (session + chamber + bill number).
http://api.opencongress.org/bills_by_ident?ident[]=110-s1178&ident[]=110-s239 - Bills Introduced Since
-
Returns bills that were introduced since the supplied date (30 at a time).
http://api.opencongress.org/bills_introduced_since?date=Jan 30th, 2009 - Bills by Query
-
Returns bills matching a text query.
http://api.opencongress.org/bills_by_query?q=Global Poverty Act of 2007 - Hot Bills
-
Returns bills that OpenCongress editors feel are "hot".
http://api.opencongress.org/hot_bills - Stalled Bills
-
Returns bills that have passed one chamber but have not received a vote on passage in the other (or a conference vote).
http://api.opencongress.org/stalled_bills?session=113&passing_chamber=s - Most Blogged Bills this Week
-
Returns the most bills most blogged about this week.
http://api.opencongress.org/most_blogged_bills_this_week - Bills Most in the News this Week
-
Returns the most bills most reported on by news agencies this week.
http://api.opencongress.org/bills_in_the_news_this_week - Most Commented-On Bills This Week
-
Returns 20 bills with the most comments added in the last week.
http://api.opencongress.org/most_commented_this_week - Most Tracked Bills this Week
-
Returns the most bills most tracked by OpenCongress Users this week.
http://api.opencongress.org/most_tracked_bills_this_week - Most Supported Bills this Week
-
Returns the most bills most supported by OpenCongress Users this week.
http://api.opencongress.org/most_supported_bills_this_week - Most Opposed Bills this Week
-
Returns the most bills most opposed by OpenCongress Users this week.
http://api.opencongress.org/most_opposed_bills_this_week - Bills Supported by Open Congress Users are Also
-
Returns bills, representatives, and senators supported and opposed by users's supporting a given bill.
http://api.opencongress.org/opencongress_users_supporting_bill_are_also/111-s1 - Bills Opposed by Open Congress Users are Also
-
Returns bills, representatives, and senators supported and opposed by users's opposing a given bill.
http://api.opencongress.org/opencongress_users_opposing_bill_are_also/111-s1 - Open Congress Users tracking bill are also tracking
-
Returns bills, people, and issues commonly tracked by people tracking a given bill.
http://api.opencongress.org/opencongress_users_tracking_bill_are_also_tracking/111-s1
Roll Calls
- Roll Calls by Bills
-
Returns the roll calls for a given list of bills.
http://api.opencongress.org/bill_roll_calls?bill_id[]=51865&bill_id[]=51868
Issues
- Issues by Keyword
-
Specify a Keyword, and receive an array of issue areas that match the keyword.
http://api.opencongress.org/issues_by_keyword?keyword=Privacy
Groups
- All public groups
- http://api.opencongress.org/groups
- Data on a specific group and its bill positions:
- http://api.opencongress.org/group/5
Wiki APIs
- OpenCongress Semantic MediaWiki API
-
Here is the API for query strings on wiki data, as well as help with writing query language. We'll be doing more extensive documentation of how to use Semantic MediaWiki and the data available through this API soon.
http://www.opencongress.org/wiki/Special:Ask - Semantic MediaWiki Data
-
Here is the page to retrieve all the data on the OpenCongress Wiki, including a simpler query string format. Further documentation of data offerings to come.
http://www.opencongress.org/wiki/Special:GetData
OpenCongress Developer Resources
- To ask questions about the API, suggest enhancements, report bugs, or let us know how you're using data from our API, send us an email:
- To sign up for general site updates over e-mail: OpenCongress mailing list (low-volume, major announcements only).
- To subscribe to updates via RSS: Blog RSS feed.
- To sign up for detailed programming updates over e-mail: Site development list-serv.
- To join an associated Google Group: Sunlight Labs, Sunlight Wiki
- To chat with our open-source development team over IRC: #opencongress on irc.freenode.net.
- To check out our site code: GitHub page
- To file a bug report, interface improvement, data source, or feature suggestion: Trac project homepage.

OC API Documentation


Comments
http://api.opencongress.org/comments?object_type=Bill&object_id=49937 http://api.opencongress.org/comments?object_type=Person&object_id=300056