From 591cfb144a635c5e61e326df02879fc99e1783d6 Mon Sep 17 00:00:00 2001 From: James Turk Date: Thu, 28 Mar 2013 01:01:13 -0400 Subject: [PATCH] new, separate, doc repository --- .gitignore | 1 + bills.html | 567 ++++++++++++++++++ committees.html | 239 ++++++++ documentup.css | 520 +++++++++++++++++ events.html | 374 ++++++++++++ index.html | 198 +++++++ legislators.html | 1261 +++++++++++++++++++++++++++++++++++++++++ metadata.html | 284 ++++++++++ source/bills.md | 463 +++++++++++++++ source/committees.md | 152 +++++ source/compile.rb | 92 +++ source/config.yml | 3 + source/events.md | 285 ++++++++++ source/index.md | 118 ++++ source/legislators.md | 1159 +++++++++++++++++++++++++++++++++++++ source/metadata.md | 184 ++++++ 16 files changed, 5900 insertions(+) create mode 100644 .gitignore create mode 100644 bills.html create mode 100644 committees.html create mode 100644 documentup.css create mode 100644 events.html create mode 100644 index.html create mode 100644 legislators.html create mode 100644 metadata.html create mode 100644 source/bills.md create mode 100644 source/committees.md create mode 100644 source/compile.rb create mode 100644 source/config.yml create mode 100644 source/events.md create mode 100644 source/index.md create mode 100644 source/legislators.md create mode 100644 source/metadata.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5890b09 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +test.py diff --git a/bills.html b/bills.html new file mode 100644 index 0000000..e508b61 --- /dev/null +++ b/bills.html @@ -0,0 +1,567 @@ + + + + + + + Open States API | Bills + + + + + + + + +
+ +
+ +

Bills

+

There are two methods available for bill data: + +

+ + + + + + + + + + + + +
Method URL pattern Description
Bill Search /bills/ Search bills by (almost) any of their attributes, or full text.
Bill Detail /bills/state/session/bill_id/ Get full detail for bill, including any actions, votes, etc.
+ +

Bill Fields

+

The following fields are available on bill objects: + +

+
    +
  • state State abbreviation.
  • +
  • session Session key (see metadata for details).
  • +
  • bill_id The official id of the bill (e.g. 'SB 27', 'A 2111')
  • +
  • title The official title of the bill.
  • +
  • alternate_titles List of alternate titles that the bill has had. (Often empty.)
  • +
  • action_dates Dictionary of notable action dates (useful for determining status). Contains the following fields:
      +
    • first First action (only null if there are no actions).
    • +
    • last Last action (only null if there are no actions).
    • +
    • passed_lower Date that the bill seems to have passed the lower chamber (might be null).
    • +
    • passed_upper Date that the bill seems to have passed the upper chamber (might be null).
    • +
    • signed Date that the bill appears to have signed into law (might be null).
    • +
    +
  • +
  • actions List of objects representing every recorded action for the bill. Action objects have the following fields:
      +
    • date Date of action.
    • +
    • action Name of action as state provides it.
    • +
    • actor The chamber, person, committee, etc. responsible for this action.
    • +
    • type Open States-provided action categories, see action categorization.
    • +
    +
  • +
  • chamber The chamber of origination ('upper' or 'lower')
  • +
  • created_at The date that this object first appeared in our system. (Note: not the date of introduction, see action_dates for that information.)
  • +
  • updated_at The date that this object was last updated in our system. (Note: not the last action date, see action_dates for that information.)
  • +
  • documents List of associated documents, see versions for field details.
  • +
  • id Open States-assigned permanent ID for this bill.
  • +
  • scraped_subjects List of subject areas that the state categorized this bill under.
  • +
  • subjects List of Open States-standardized bill subjects, see subject categorization.
  • +
  • sources List of source URLs used to compile information on this object.
  • +
  • sponsors List of bill sponsors.
      +
    • name Name of sponsor as it appears on state website.
    • +
    • leg_id Open States assigned legislator ID (will be null if no match was found).
    • +
    • type Type of sponsor ('primary' or 'cosponsor')
    • +
    +
  • +
  • type List of bill types.
  • +
  • versions Versions of the bill text. Both documents and versions have the following fields:
      +
    • url Official URL for this document.
    • +
    • name An official name for this document.
    • +
    • mimetype The mimetype for the document (e.g. 'text/html')
    • +
    • doc_id An Open States-assigned id uniquely identifying this document.
    • +
    +
  • +
  • votes List of vote objects. A vote object consists of the following keys:
      +
    • motion Name of motion being voted upon (e.g. 'Passage')
    • +
    • chamber Chamber vote took place in ('upper', 'lower', 'joint')
    • +
    • date Date of vote.
    • +
    • id Open States-assigned unique identifier for vote.
    • +
    • state State abbreviation.
    • +
    • session Session key (see metadata for details).
    • +
    • sources List of source URLs used to compile information on this object. (Can be empty if vote shares sources with bill.)
    • +
    • yes_count Total number of yes votes.
    • +
    • no_count Total number of no votes.
    • +
    • other_count Total number of 'other' votes (abstain, not present, etc.).
    • +
    • yes_votes, no_votes, other_votes List of roll calls of each type. Each is an object consisting of two keys:
        +
      • name Name of voter as it appears on state website.
      • +
      • leg_id Open States assigned legislator ID (will be null if no match was found).
      • +
      +
    • +
    +
  • +
+

Methods

+ +

This method returns just a subset (state, chamber, session, subjects, type, id, bill_id, title, created_at, updated_at) of the bill fields by default. + +

+

Filter Parameters

+

The following parameters filter the returned set of bills, at least one must be provided. + +

+
    +
  • state Only return bills from a given state (e.g. 'nc')
  • +
  • chamber Only return bills matching the provided chamber ('upper' or 'lower')
  • +
  • bill_id Only return bills with a given bill_id.
  • +
  • bill_id__in Accepts a pipe (|) delimited list of bill ids.
  • +
  • q Only return bills matching the provided full text query.
  • +
  • search_window By default all bills are searched, but if a time window is desired the following options can be passed to search_window:
      +
    • search_window=all Default, include all sessions.
    • +
    • search_window=term Only bills from sessions within the current term.
    • +
    • search_window=session Only bills from the current session.
    • +
    • search_window=session:2009 Only bills from the session named 2009.
    • +
    • search_window=term:2009-2011 Only bills from the sessions in the 2009-2011 session.
    • +
    +
  • +
  • updated_since Only bills updated since a provided date (provided in YYYY-MM-DD format)
  • +
  • sponsor_id Only bills sponsored by a given legislator id (e.g. 'ILL000555')
  • +
  • subject Only bills categorized by Open States as belonging to this subject.
  • +
  • type Only bills of a given type (e.g. 'bill', 'resolution', etc.)
  • +
+

Additional Parameters

+

sort Sort-order of results, defaults to 'last', options are: + +

+
    +
  • 'first'
  • +
  • 'last'
  • +
  • 'signed'
  • +
  • 'passed_lower'
  • +
  • 'passed_upper'
  • +
  • 'updated_at'
  • +
  • 'created_at'
  • +
+

See the above action_dates, created_at, and updated_at documentation for the meaning of these dates. + +

+

The API will not return exceedingly large responses, so it may be necessary to use page and per_page to control the number of results returned: + +

+
    +
  • page Page of results, each of size per_page (defaults to 1)
  • +
  • per_page Number of results per page, is unlimited unless page is set, in which case it defaults to 50.
  • +
+

Example: openstates.org/api/v1/bills/?state=dc&q=taxi + +

+

Bill Detail

+

This method returns the full detail object for a bill. + +

+

Example: openstates.org/api/v1/bills/ca/20092010/AB%20667/ + +

+

Note: This method has an alternate URL form: + +

+
    +
  • bills/openstates_bill_id - e.g. openstates.org/api/v1/bills/CAB00004148/ - allows lookup by bill_id
  • +
+

Examples

+ +

http://openstates.org/api/v1/bills/?state=dc&q=taxi + +

+
[
+ {
+  "title": "\"DOC INMATE PROCESSING AND RELEASE AMENDMENT ACT OF 2012\". ", 
+  "created_at": "2011-07-18 04:35:16", 
+  "updated_at": "2012-09-14 03:49:38", 
+  "chamber": "upper", 
+  "state": "dc", 
+  "session": "19", 
+  "subjects": [], 
+  "type": [ "bill" ], 
+  "id": "DCB00001021", 
+  "bill_id": "B 19-0428"
+ }, 
+ {
+  "title": "\"TAXICAB SERVICE IMPROVEMENT AMENDMENT ACT OF 2012\".\r\n\r\n ", 
+  "created_at": "2012-01-06 20:53:35", 
+  "updated_at": "2012-12-07 20:31:54", 
+  "chamber": "upper", 
+  "state": "dc", 
+  "session": "19", 
+  "subjects": [], 
+  "type": [ "bill" ], 
+  "id": "DCB00001501", 
+  "bill_id": "B 19-0630"
+ }, 
+ {
+  "title": "\"FISCAL YEAR 2013 BUDGET SUPPORT ACT OF 2012\". ", 
+  "created_at": "2012-03-27 02:19:29", 
+  "updated_at": "2012-10-18 03:33:02", 
+  "chamber": "upper", 
+  "state": "dc", 
+  "session": "19", 
+  "subjects": [], 
+  "type": [ "bill" ], 
+  "id": "DCB00001892", 
+  "bill_id": "B 19-0743"
+ }, 
+ {
+  "title": "\"FISCAL YEAR 2013 BUDGET SUPPORT EMERGENCY ACT OF 2012\". ", 
+  "created_at": "2012-06-08 02:51:47", 
+  "updated_at": "2012-09-07 03:51:01", 
+  "chamber": "upper", 
+  "state": "dc", 
+  "session": "19", 
+  "subjects": [], 
+  "type": [ "bill" ], 
+  "id": "DCB00002085", 
+  "bill_id": "B 19-0796"
+ }, 
+ {
+  "title": "\"LEON SWAIN, JR. RECOGNITION RESOLUTION OF 2012\". ", 
+  "created_at": "2012-04-27 02:36:38", 
+  "updated_at": "2012-08-22 04:20:34", 
+  "chamber": "upper", 
+  "state": "dc", 
+  "session": "19", 
+  "subjects": [], 
+  "type": [ "resolution" ], 
+  "id": "DCB00001959", 
+  "bill_id": "CER 19-0218"
+ }, 
+ {
+  "title": "\"WASHINGTON CONVENTION CENTER ADVISORY COMMITTEE RECOGNITION RESOLUTION OF 2011\".", 
+  "created_at": "2012-03-20 02:17:18", 
+  "updated_at": "2012-08-22 04:20:34", 
+  "chamber": "upper", 
+  "state": "dc", 
+  "session": "19", 
+  "subjects": [], 
+  "type": [ "resolution" ], 
+  "id": "DCB00001795", 
+  "bill_id": "CER 19-0171"
+ }, 
+ {
+  "title": "\"WHEELCHAIR ACCESSIBLE TAXICABS PARITY AMENDMENT ACT OF 2011\".", 
+  "created_at": "2012-01-06 20:53:35", 
+  "updated_at": "2012-08-22 04:20:26", 
+  "chamber": "upper", 
+  "state": "dc", 
+  "session": "19", 
+  "subjects": [], 
+  "type": [ "bill" ], 
+  "id": "DCB00001506", 
+  "bill_id": "B 19-0635"
+ }, 
+ {
+  "title": "\"FISCAL YEAR 2012 BUDGET SUPPORT ACT OF 2011\".", 
+  "created_at": "2011-04-06 01:53:14", 
+  "updated_at": "2012-10-18 03:32:58", 
+  "chamber": "upper", 
+  "state": "dc", 
+  "session": "19", 
+  "subjects": [], 
+  "type": [ "bill" ], 
+  "id": "DCB00000427", 
+  "bill_id": "B 19-0203"
+ }, 
+ {
+  "title": "\"FISCAL YEAR 2012 BUDGET SUPPORT EMERGENCY ACT OF 2011\".\r\n ", 
+  "created_at": "2011-06-16 04:18:55", 
+  "updated_at": "2012-08-22 04:20:21", 
+  "chamber": "upper", 
+  "state": "dc", 
+  "session": "19", 
+  "subjects": [], 
+  "type": [ "bill" ], 
+  "id": "DCB00000794", 
+  "bill_id": "B 19-0338"
+ }, 
+ {
+  "title": "\"PROFESSIONAL TAXICAB STANDARDS AND MEDALLION ESTABLISHMENT ACT OF 2011\".", 
+  "created_at": "2011-03-21 18:55:32", 
+  "updated_at": "2012-08-22 04:20:17", 
+  "chamber": "upper", 
+  "state": "dc", 
+  "session": "19", 
+  "subjects": [], 
+  "type": [ "bill" ], 
+  "id": "DCB00000339", 
+  "bill_id": "B 19-0172"
+ }
+]
+

Bill Detail

+

http://openstates.org/api/v1/bills/ca/20092010/AB%20667/ + +

+
{
+ "action_dates": {
+  "passed_upper": null, 
+  "passed_lower": null, 
+  "last": "2009-08-06 00:00:00", 
+  "signed": null, 
+  "first": "2009-02-25 00:00:00"
+ }, 
+ "actions": [
+  { "date": "2009-02-25 00:00:00", 
+   "action": "Read first time. To print.", 
+   "type": [ "bill:introduced", "bill:reading:1" ], 
+   "actor": "lower (Desk)" }, 
+  { "date": "2009-02-26 00:00:00", 
+   "action": "From printer. May be heard in committee March 28.", 
+   "type": [ "other" ], 
+   "actor": "lower (Desk)" }, 
+  { "date": "2009-03-23 00:00:00", 
+   "action": "Referred to Com. on HEALTH.", 
+   "type": [ "committee:referred" ], 
+   "actor": "lower (Committee CX08)" }, 
+  { "date": "2009-04-02 00:00:00", 
+   "action": "From committee chair, with author's amendments: Amend, and re-refer to Com. on HEALTH. Read second time and amended.", 
+   "type": [ "bill:reading:2" ], 
+   "actor": "lower (E&E Engrossing)" }, 
+  { "date": "2009-04-13 00:00:00", 
+   "action": "Re-referred to Com. on HEALTH.", 
+   "type": [ "committee:referred" ], 
+   "actor": "lower (Committee CX08)" }, 
+  { "date": "2009-04-15 00:00:00", 
+   "action": "From committee: Do pass, and re-refer to Com. on B. & P. with recommendation: To Consent Calendar. Re-referred. (Ayes 19. Noes 0.) (April 14).", 
+   "type": [ "other" ], 
+   "actor": "lower (Committee)" }, 
+  { "date": "2009-04-29 00:00:00", 
+   "action": "From committee: Do pass, and re-refer to Com. on APPR. with recommendation: To Consent Calendar. Re-referred. (Ayes 10. Noes 0.) (April 28).", 
+   "type": [ "other" ], 
+   "actor": "lower (Committee)" }, 
+  { "date": "2009-05-04 00:00:00", 
+   "action": "From committee chair, with author's amendments: Amend, and re-refer to Com. on APPR. Read second time and amended.", 
+   "type": [ "bill:reading:2" ], 
+   "actor": "lower (E&E Engrossing)" }, 
+  { "date": "2009-05-05 00:00:00", 
+   "action": "Re-referred to Com. on APPR.", 
+   "type": [ "committee:referred" ], 
+   "actor": "lower (Committee CX25)" }, 
+  { "date": "2009-05-14 00:00:00", 
+   "action": "From committee: Do pass. To Consent Calendar. (May 13).", 
+   "type": [ "other" ], 
+   "actor": "lower" }, 
+  { "date": "2009-05-18 00:00:00", 
+   "action": "Read second time. To Consent Calendar.", 
+   "type": [ "bill:reading:2" ], 
+   "actor": "lower" }, 
+  { "date": "2009-05-21 00:00:00", 
+   "action": "Read third time, passed, and to Senate. (Ayes 77. Noes 0. Page 1628.)", 
+   "type": [ "other" ], 
+   "actor": "lower (E&E Engrossing)" }, 
+  { "date": "2009-05-21 00:00:00", 
+   "action": "In Senate. Read first time. To Com. on RLS. for assignment.", 
+   "type": [ "bill:reading:1", "committee:referred" ], 
+   "actor": "upper (Rules)" }, 
+  { "date": "2009-06-04 00:00:00", 
+   "action": "Referred to Com. on B., P. & E.D.", 
+   "type": [ "committee:referred" ], 
+   "actor": "upper (Committee CS42)" }, 
+  { "date": "2009-06-22 00:00:00", 
+   "action": "From committee: Do pass, and re-refer to Com. on APPR. Re-referred. (Ayes 10. Noes 0.) (June 22).", 
+   "type": [ "other" ], 
+   "actor": "upper (Committee)" }, 
+  { "date": "2009-06-29 00:00:00", 
+   "action": "From committee: Be placed on second reading file pursuant to Senate Rule 28.8.", 
+   "type": [ "other" ], 
+   "actor": "upper" }, 
+  { "date": "2009-06-30 00:00:00", 
+   "action": "Read second time. To third reading.", 
+   "type": [ "bill:reading:2" ], 
+   "actor": "upper" }, 
+  { "date": "2009-07-02 00:00:00", 
+   "action": "Ordered to Special Consent Calendar.", 
+   "type": [ "other" ], 
+   "actor": "upper" }, 
+  { "date": "2009-07-09 00:00:00", 
+   "action": "Read third time, passed, and to Assembly. (Ayes 34. Noes 0. Page 1667.)", 
+   "type": [ "other" ], 
+   "actor": "upper (Desk)" }, 
+  { "date": "2009-07-09 00:00:00", 
+   "action": "In Assembly. To enrollment.", 
+   "type": [ "other" ], 
+   "actor": "lower (E&E Enrollment)" }, 
+  { "date": "2009-07-30 00:00:00", 
+   "action": "Enrolled and to the Governor at 2:30 p.m.", 
+   "type": [ "other" ], 
+   "actor": "executive" }, 
+  { "date": "2009-08-05 00:00:00", 
+   "action": "Approved by the Governor.", 
+   "type": [ "other" ], 
+   "actor": "executive" }, 
+  { "date": "2009-08-06 00:00:00", 
+   "action": "Chaptered by Secretary of State - Chapter 119, Statutes of 2009.", 
+   "type": [ "other" ], 
+   "actor": "Secretary of State" }
+ ], 
+ "alternate_titles": [
+  "An act to amend Section 104830 of, and to add Section 104762 to, the Health and Safety Code, relating to oral health."
+ ], 
+ "bill_id": "AB 667", 
+ "chamber": "lower", 
+ "created_at": "2010-07-09 17:28:10", 
+ "documents": [], 
+ "id": "CAB00004148", 
+ "level": "state", 
+ "scraped_subjects": [ "Topical fluoride application." ], 
+ "session": "20092010", 
+ "sources": [
+  { "url": "http://leginfo.legislature.ca.gov/faces/billNavClient.xhtml?bill_id=200920100AB667" }
+ ], 
+ "sponsors": [
+  { "leg_id": "CAL000044", "type": "primary", "name": "Block" }
+ ], 
+ "state": "ca", 
+ "subjects": [], 
+ "title": "An act to amend Section 1750.1 of the Business and Professions Code, and to amend Section 104830 of, and to add Section 104762 to, the Health and Safety Code, relating to oral health.", 
+ "type": [ "bill", "fiscal committee" ], 
+ "updated_at": "2012-04-06 17:17:37", 
+ "versions": [
+  {
+   "url": "http://leginfo.legislature.ca.gov/faces/billNavClient.xhtml?bill_id=200920100AB667", 
+   "mimetype": "text/html", "doc_id": "CAD00040031", "name": "AB667"
+  }
+ ], 
+ "votes": [
+  {
+   "other_count": 6, "+threshold": "1/2", 
+   "other_votes": [
+    { "leg_id": "CAL000014", "name": "Ashburn" }, 
+    { "leg_id": "CAL000036", "name": "Calderon" },
+    { "leg_id": "CAL000010", "name": "Corbett" }, 
+    { "leg_id": "CAL000026", "name": "Harman" }, 
+    { "leg_id": "CAL000021", "name": "Oropeza" }, 
+    { "leg_id": "CAL000005", "name": "Wolk" }
+   ], 
+   "yes_count": 34, 
+   "yes_votes": [
+    { "leg_id": "CAL000004", "name": "Aanestad" }, 
+    { "leg_id": "CAL000039", "name": "Alquist" }, 
+    { "leg_id": "CAL000029", "name": "Benoit" }, 
+    { "leg_id": "CAL000017", "name": "Cedillo" }, 
+    { "leg_id": "CAL000011", "name": "Cogdill" }, 
+    { "leg_id": "CAL000037", "name": "Correa" }, 
+    { "leg_id": "CAL000001", "name": "Cox" }, 
+    { "leg_id": "CAL000007", "name": "DeSaulnier" }, 
+    { "leg_id": "CAL000032", "name": "Denham" }, 
+    { "leg_id": "CAL000038", "name": "Ducheny" }, 
+    { "leg_id": "CAL000023", "name": "Dutton" }, 
+    { "leg_id": "CAL000033", "name": "Florez" }, 
+    { "leg_id": "CAL000009", "name": "Hancock" }, 
+    { "leg_id": "CAL000027", "name": "Hollingsworth" }, 
+    { "leg_id": "CAL000022", "name": "Huff" }, 
+    { "leg_id": "CAL000030", "name": "Kehoe" }, 
+    { "leg_id": "CAL000003", "name": "Leno" }, 
+    { "leg_id": "CAL000016", "name": "Liu" }, 
+    { "leg_id": "CAL000080", "name": "Lowenthal" }, 
+    { "leg_id": "CAL000012", "name": "Maldonado" }, 
+    { "leg_id": null, "name": "Negrete McLeod" }, 
+    { "leg_id": "CAL000034", "name": "Padilla" }, 
+    { "leg_id": "CAL000018", "name": "Pavley" }, 
+    { "leg_id": "CAL000040", "name": "Price" }, 
+    { "leg_id": "CAL000019", "name": "Romero" }, 
+    { "leg_id": "CAL000013", "name": "Runner" }, 
+    { "leg_id": "CAL000031", "name": "Simitian" }, 
+    { "leg_id": "CAL000006", "name": "Steinberg" }, 
+    { "leg_id": "CAL000015", "name": "Strickland" }, 
+    { "leg_id": "CAL000025", "name": "Walters" }, 
+    { "leg_id": "CAL000002", "name": "Wiggins" }, 
+    { "leg_id": "CAL000035", "name": "Wright" }, 
+    { "leg_id": "CAL000028", "name": "Wyland" }, 
+    { "leg_id": "CAL000008", "name": "Yee" }
+   ], 
+   "no_count": 0, 
+   "motion": "Special Consent #12 AB667 Block By Alquist", 
+   "chamber": "upper", 
+   "state": "ca", 
+   "session": "20092010", 
+   "sources": [], 
+   "passed": true, 
+   "date": "2009-07-09 16:50:00", 
+   "vote_id": "CAV00009230", 
+   "type": "other", 
+   "id": "CAV00009230", 
+   "bill_id": "CAB00004148", 
+   "no_votes": []
+  }
+ ]
+}
+ +
+
+ + + + \ No newline at end of file diff --git a/committees.html b/committees.html new file mode 100644 index 0000000..e1ce659 --- /dev/null +++ b/committees.html @@ -0,0 +1,239 @@ + + + + + + + Open States API | Committees + + + + + + + + +
+ +
+ +

Committees

+

There are two methods available for committee data: + +

+ + + + + + + + + + + + +
Method URL pattern Description
Committee Search /committees/ Search committees by any of their attributes.
Committee Detail /committees/committee_id/ Get full detail for committee, including all members.
+ +

Committee Fields

+

The following fields are available on committee objects: + +

+
    +
  • id Open States assigned committee ID.
  • +
  • state State abbreviation.
  • +
  • chamber Chamber committee belongs to: 'upper', 'lower', 'joint'.
  • +
  • committee Name of committee.
  • +
  • subcommittee Name of subcommittee. (if null, object describes the committee)
  • +
  • parent_id Committee id pointing to the parent committee if this is a subcommittee.
  • +
  • sources List of URLs used in gathering information for this legislator.
  • +
  • created_at The date that this object first appeared in our system.
  • +
  • updated_at The date that this object was last updated in our system.
  • +
  • members List of member objects, each has the following keys:
      +
    • name Name of legislator as provided by state source.
    • +
    • leg_id Open States-assigned legislator id. (null if no match found).
    • +
    • role Member's role on the committee (e.g. 'chair', 'vice-chair', default role is 'member')
    • +
    +
  • +
+

Methods

+ +

This method allows searching by a number of fields: + +

+
    +
  • committee
  • +
  • subcommittee
  • +
  • chamber
  • +
  • state
  • +
+

Committee objects returned by this method do not include the list of members by default. + +

+

Example: openstates.org/api/v1/committees/?state=dc + +

+

Committee Detail

+

This method returns the full committee object given a committee id. + +

+

Example: openstates.org/api/v1/committees/DCC000029/ + +

+

Examples

+ +

http://openstates.org/api/v1/committees/?state=dc + +

+
[
+ { "level": "state", 
+  "created_at": "2011-11-09 02:43:35", 
+  "updated_at": "2013-03-27 03:23:42", 
+  "parent_id": null, 
+  "state": "dc", 
+  "subcommittee": null, 
+  "committee": "Finance and Revenue", 
+  "chamber": "upper", 
+  "id": "DCC000017" }, 
+ { "level": "state", 
+  "created_at": "2011-11-09 02:43:35", 
+  "updated_at": "2013-03-06 02:18:33", 
+  "parent_id": null, 
+  "state": "dc", 
+  "subcommittee": null, 
+  "committee": "Subcommittee on Redistricting 2011", 
+  "chamber": "upper", 
+  "id": "DCC000025" }, 
+ { "chamber": "upper", 
+  "created_at": "2013-01-07 21:05:11", 
+  "updated_at": "2013-03-27 03:23:42", 
+  "parent_id": null, 
+  "state": "dc", 
+  "subcommittee": null, 
+  "committee": "Business, Consumer and Regulatory Affairs", 
+  "id": "DCC000029" }, 
+ { "level": "state", 
+  "created_at": "2011-11-09 02:43:35", 
+  "updated_at": "2013-03-27 03:23:41", 
+  "parent_id": null, 
+  "state": "dc", 
+  "subcommittee": null, 
+  "committee": "Human Services", 
+  "chamber": "upper", 
+  "id": "DCC000014" }, 
+  ...truncated...
+]
+

Committee Detail

+

http://openstates.org/api/v1/committees/DCC000029/ + +

+
{
+ "chamber": "upper", 
+ "committee": "Business, Consumer and Regulatory Affairs", 
+ "created_at": "2013-01-07 21:05:11", 
+ "id": "DCC000029", 
+ "members": [
+  {
+   "leg_id": "DCL000014", 
+   "role": "chairperson", 
+   "name": "Vincent Orange"
+  }, 
+  {
+   "leg_id": "DCL000020", 
+   "role": "member", 
+   "name": "David Grosso"
+  }, 
+  {
+   "leg_id": "DCL000007", 
+   "role": "member", 
+   "name": "Jim Graham"
+  }, 
+  {
+   "leg_id": "DCL000002", 
+   "role": "member", 
+   "name": "Mary M. Cheh"
+  }, 
+  {
+   "leg_id": "DCL000010", 
+   "role": "member", 
+   "name": "Yvette Alexander"
+  }
+ ], 
+ "parent_id": null, 
+ "sources": [ { "url": "http://dccouncil.us/committees/committee-on-business-consumer-and-regulatory-affairs" } ], 
+ "state": "dc", 
+ "subcommittee": null, 
+ "updated_at": "2013-03-27 03:23:42"
+}
+ +
+
+ + + + \ No newline at end of file diff --git a/documentup.css b/documentup.css new file mode 100644 index 0000000..51da67f --- /dev/null +++ b/documentup.css @@ -0,0 +1,520 @@ +.tomorrow-comment, +pre .comment, +pre .title { + color: #8e908c; +} +.tomorrow-red, +pre .variable, +pre .attribute, +pre .tag, +pre .regexp, +pre .ruby .constant, +pre .xml .tag .title, +pre .xml .pi, +pre .xml .doctype, +pre .html .doctype, +pre .css .id, +pre .css .class, +pre .css .pseudo { + color: #c82829; +} +.tomorrow-orange, +pre .number, +pre .preprocessor, +pre .built_in, +pre .literal, +pre .params, +pre .constant { + color: #f5871f; +} +.tomorrow-yellow, +pre .class, +pre .ruby .class .title, +pre .css .rules .attribute { + color: #eab700; +} +.tomorrow-green, +pre .string, +pre .value, +pre .inheritance, +pre .header, +pre .ruby .symbol, +pre .xml .cdata { + color: #718c00; +} +.tomorrow-aqua, +pre .css .hexcolor { + color: #3e999f; +} +.tomorrow-blue, +pre .function, +pre .python .decorator, +pre .python .title, +pre .ruby .function .title, +pre .ruby .title .keyword, +pre .perl .sub, +pre .javascript .title, +pre .coffeescript .title { + color: #4271ae; +} +.tomorrow-purple, +pre .keyword, +pre .javascript .function { + color: #8959a8; +} +pre code { + display: block; + background: #fff; + color: #4d4d4c; + font-family: Menlo, Monaco, Consolas, monospace; + font-size: 12px; + line-height: 1.5; + border: 1px solid #ccc; + padding: 10px; +} +html, +body, +div, +span, +object, +iframe, +h1, +h2, +h3, +h4, +h5, +h6, +p, +blockquote, +pre, +a, +abbr, +acronym, +address, +code, +del, +dfn, +em, +img, +q, +dl, +dt, +dd, +ol, +ul, +li, +fieldset, +form, +label, +legend, +table, +caption, +tbody, +tfoot, +thead, +tr, +th, +td { + margin: 0; + padding: 0; + border: 0; + font-weight: inherit; + font-style: inherit; + font-size: 100%; + font-family: inherit; + vertical-align: baseline; +} +table { + border-collapse: separate; + border-spacing: 0; +} +caption, +th, +td { + text-align: left; + font-weight: normal; +} +table, +td, +th { + vertical-align: middle; +} +blockquote:before, +blockquote:after, +q:before, +q:after { + content: ""; +} +blockquote, +q { + quotes: "" ""; +} +a img { + border: none; +} +body { + margin: 10px; +} +html { + height: 100%; +} +body { + padding: 0; + margin: 0; + font: 14px/22px "adelle", Georgia, sans-serif; + font-size-adjust: none; + font-style: normal; + font-variant: normal; + font-weight: normal; + background: #f4f6ec; +} +a { + color: #369; +} +#container { + width: 922px; + margin: 0 auto; +} +#header { + border-bottom: 3px solid rgba(0,0,0,0.10); + padding-bottom: 10px; + margin-bottom: 10px; +} +#header #logo { + color: #111; + font-size: 25px; + font-weight: bold; + padding: 10px 0; + text-decoration: none; +} +#nav { + float: left; + width: 230px; + margin-right: 30px; + margin-top: 40px; +} +#nav a { + display: block; + font-weight: bold; + text-decoration: none; +} +#nav #sections { + list-style-type: none; + border-bottom: 3px solid rgba(0,0,0,0.10); + padding-bottom: 10px; + margin-bottom: 10px; +} +#nav #sections > li > a { + padding: 5px 0; + color: #444; + font-size: 16px; +} +#nav #sections ul { + margin-bottom: 15px; +} +#nav #sections ul li { + list-style-type: none; +} +#nav #sections ul li a { + padding: 1px 15px; + font-size: 13px; + font-weight: normal; +} +#nav .extra { + padding: 5px 0; + min-height: 1.4em; +} +#nav .extra a { + color: #555; + font-size: 14px; +} +#nav #travis img { + margin-top: 10px; + display: block; +} +#nav > *:last-child { + margin-bottom: 20px; +} +#github-ribbon { + position: absolute; + top: 0; + right: 0; +} +#github-ribbon img { + border: 0; +} +#content { + padding: 30px 30px 20px 30px; + min-height: 100px; + width: 600px; + background: #fff; + float: left; + border: 1px solid rgba(0,0,0,0.20); + -webkit-border-radius: 3px 3px 0 0; + -moz-border-radius: 3px 3px 0 0; + border-radius: 3px 3px 0 0; + margin-top: 15px; +/* From Tripoli */ +} +#content #loader { + color: #888; + width: 300px; + height: 24px; + line-height: 24px; + position: absolute; + top: 30px; + left: 30px; + background: url("data:image/gif;base64,R0lGODlhGAAYAPYAAP///5mZmfn5+dvb27i4uKmpqaCgoNra2v39/c/Pz6CgoJmZmfT09K+vr66urvb29qWlpaSkpPPz8/v7+87Ozvj4+NXV1dTU1Li4uKysrJubm52dnaqqqu7u7uPj46Ojo8LCwvb29ra2tqenp7q6utzc3JycnNfX1/Ly8uzs7J6ensbGxs3NzeDg4MvLy9LS0r+/v/r6+qysrOrq6t7e3tnZ2cTExLS0tLOzs6ioqLGxsefn57W1tcvLy7y8vMHBwd7e3qKiovHx8cfHx+Hh4QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH+GkNyZWF0ZWQgd2l0aCBhamF4bG9hZC5pbmZvACH5BAAFAAAAIf8LTkVUU0NBUEUyLjADAQAAACwAAAAAGAAYAAAHmoAAgoOEhYaHgxUWBA4aCxwkJwKIhBMJBguZmpkqLBOUDw2bo5kKEogMEKSkLYgIoqubK5QJsZsNCIgCCraZBiiUA72ZJZQABMMgxgAFvRyfxpixGx3LANKxHtbNth8hy8i9IssHwwsXxgLYsSYpxrXDz5QIDubKlAwR5q2UErC2poxNoLBukwoX0IxVuIAhQ6YRBC5MskaxUCAAIfkEAAUAAQAsAAAAABgAGAAAB6GAAIKDhIWGh4MVFgQOGhsOGAcxiIQTCQYLmZqZGwkIlA8Nm6OaMgyHDBCkqwsjEoUIoqykNxWFCbOkNoYCCrmaJjWHA7+ZHzOIBMUND5QFvzATlACYsy/TgtWsIpPTz7kyr5TKv8eUB8ULGzSIAtq/CYi46Qswn7AO9As4toUMEfRcHZIgC9wpRBMovNvU6d60ChcwZFigwYGIAwKwaUQUCAAh+QQABQACACwAAAAAGAAYAAAHooAAgoOEhYaHgxUWBA4aCzkkJwKIhBMJBguZmpkqLAiUDw2bo5oyEocMEKSrCxCnhAiirKs3hQmzsy+DAgq4pBogKIMDvpvAwoQExQvHhwW+zYiYrNGU06wNHpSCz746O5TKyzwzhwfLmgQphQLX6D4dhLfomgmwDvQLOoYMEegRyApJkIWLQ0BDEyi426Six4RtgipcwJAhUwQCFypA3IgoEAAh+QQABQADACwAAAAAGAAYAAAHrYAAgoOEhYaHgxUWBA4aCxwkJzGIhBMJBguZmpkGLAiUDw2bo5oZEocMEKSrCxCnhAiirKsZn4MJs7MJgwIKuawqFYIDv7MnggTFozlDLZMABcpBPjUMhpisJiIJKZQA2KwfP0DPh9HFGjwJQobJypoQK0S2B++kF4IC4PbBt/aaPWA5+CdjQiEGEd5FQHFIgqxcHF4dmkBh3yYVLmx5q3ABQ4ZMBUhYEOCtpLdAACH5BAAFAAQALAAAAAAYABgAAAeegACCg4SFhoeDFRYEDhoaDgQWFYiEEwkGC5mamQYJE5QPDZujmg0PhwwQpKsLEAyFCKKsqw0IhAmzswmDAgq5rAoCggO/sxaCBMWsBIIFyqsRgpjPoybS1KMqzdibBcjcmswAB+CZxwAC09gGwoK43LuDCA7YDp+EDBHPEa+GErK5GkigNIGCulEGKNyjBKDCBQwZMmXAcGESw4uUAgEAIfkEAAUABQAsAAAAABgAGAAAB62AAIKDhIWGh4MVFgQOGgscJCcxiIQTCQYLmZqZBiwIlA8Nm6OaGRKHDBCkqwsQp4QIoqyrGZ+DCbOzCYMCCrmsKhWCA7+zJ4IExaM5Qy2TAAXKQT41DIaYrCYiCSmUANisHz9Az4fRxRo8CUKGycqaECtEtgfvpBeCAuD2wbf2mj1gOfgnY0IhBhHeRUBxSIKsXBxeHZpAYd8mFS5seatwAUOGTAVIWBDgraS3QAAh+QQABQAGACwAAAAAGAAYAAAHooAAgoOEhYaHgxUWBA4aCzkkJwKIhBMJBguZmpkqLAiUDw2bo5oyEocMEKSrCxCnhAiirKs3hQmzsy+DAgq4pBogKIMDvpvAwoQExQvHhwW+zYiYrNGU06wNHpSCz746O5TKyzwzhwfLmgQphQLX6D4dhLfomgmwDvQLOoYMEegRyApJkIWLQ0BDEyi426Six4RtgipcwJAhUwQCFypA3IgoEAAh+QQABQAHACwAAAAAGAAYAAAHoYAAgoOEhYaHgxUWBA4aGw4YBzGIhBMJBguZmpkbCQiUDw2bo5oyDIcMEKSrCyMShQiirKQ3FYUJs6Q2hgIKuZomNYcDv5kfM4gExQ0PlAW/MBOUAJizL9OC1awik9PPuTKvlMq/x5QHxQsbNIgC2r8JiLjpCzCfsA70Czi2hQwR9FwdkiAL3ClEEyi829Tp3rQKFzBkWKDBgYgDArBpRBQIADsAAAAAAAAAAAA=") no-repeat center left; + padding-left: 32px; + font-size: 18px; +} +#content > p { + zoom: 1; +} +#content > p:before, +#content > p:after { + content: ""; + display: table; +} +#content > p:after { + clear: both; +} +#content p { + padding: 0 0 0.8125em 0; + color: #444; +} +#content p img { + float: left; + margin: 0.5em 0.8125em 0.8125em 0; + padding: 0; +} +#content img { + max-width: 100%; +} +#content h1, +#content h2, +#content h3, +#content h4, +#content h5, +#content h6 { + font-weight: bold; + line-height: 1.2em; +} +#content h1 { + font-size: 2.125em; + margin-bottom: 0.4em; +} +#content h2 { + font-size: 1.7em; + margin: 0.855em 0 0.4em; + color: #cc333f; +} +#content h3 { + font-size: 1.3em; + margin: 0.956em 0 0.4em; +} +#content h4 { + font-size: 1.1em; + margin: 1.161em 0 0.4em; +} +#content h5, +#content h6 { + font-size: 1em; + font-weight: bold; + margin: 1.238em 0 0.4em; +} +#content > h1, +#content > h2 { + margin-top: 0; +} +#content ul { + list-style-position: outside; +} +#content li ul, +#content li ol { + margin: 0 1.625em 1em; +} +#content ul, +#content ol { + margin: 0 0 1.625em 1.25em; +} +#content dl { + margin: 0 0 1.625em 0; + width: 100%; + overflow:hidden; +} +#content dl dt { + font-weight: bold; + margin-bottom: 0.25em; + float: left; + clear: left; +} +#content dl dd { + margin-left: 1.625em; + float: left; +} +#content a { + text-decoration: underline; +} +#content a:hover { + text-decoration: underline; +} +#content table { + margin-bottom: 1.625em; + border-collapse: collapse; +} +#content th { + font-weight: bold; +} +#content tr, +#content th, +#content td { + margin: 0; + padding: 0 1.625em 0 1em; + height: 26px; + vertical-align: top; +} +#content tfoot { + font-style: italic; +} +#content caption { + text-align: center; + font-family: Georgia, serif; +} +#content abbr, +#content acronym { + border-bottom: 1px dotted #000; +} +#content address { + margin-top: 1.625em; + font-style: italic; +} +#content del { + color: #000; +} +#content blockquote { + padding: 1em 1em 1.625em 1em; + font-family: georgia, serif; + font-style: italic; +} +#content blockquote:before { + content: "\201C"; + font-size: 3em; + margin-left: -0.625em; + font-family: georgia, serif; + color: #aaa; + line-height: 0; +} +#content blockquote > p { + padding: 0; + margin: 0; +} +#content strong { + font-weight: bold; +} +#content em, +#content dfn { + font-style: italic; +} +#content dfn { + font-weight: bold; +} +#content pre, +#content code { + margin: 0 0 1.625em; + white-space: pre; +} +#content pre, +#content code, +#content tt { + font-size: 1em; + font-family: Consolas, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace; + line-height: 1.5; +} +#content code { + background: #f7f8f1; + padding: 1px 2px; + border: 1px solid #ccc; +} +#content pre code { + padding: 10px 12px; + word-wrap: normal; + overflow-y: auto; +} +#content tt { + display: block; + margin: 1.625em 0; +} +#content hr { + border:3px solid #dbddd4; + border-bottom: none; + border-left: none; + border-right: none; + height: 0; + margin: 2.5em 0 2em; +} +#content table { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + width: 100%; +} +#content th, +#content td { + padding: 5px 10px; + border: 1px solid #ccc; +} +#content th { + background: #eee; + padding: 7px 10px; +} +#content td { + font-size: 0.9em; + border-color: #ddd; +} +#content tbody tr:nth-child(2n) { + background: #f5f5f5; +} +@media only screen and (min-device-pixel-ratio: 1.5) and (max-width : 480px), only screen and (max-width : 480px) { + #container { + width: 100%; + } + #nav { + width: 100%; + margin-top: 10px; + float: none; + } + #nav #sections, + #nav #header, + #nav .extra { + padding-left: 30px; + padding-right: 30px; + } + #content { + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; + border-width: 1px; + float: none; + margin: 0; + width: 100%; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + } + #github-ribbon img { + width: 100px; + } +} + + + +/* user-added stuff */ + +#content ul, ol {color: #444;} +#header #logo { + font-size: 20px; line-height: 36px; + padding-bottom: 0; +} +#nav .thanks {color: #8e908c; font-size: 80%;} +#nav .thanks a {display: inline; font-weight: normal; font-size: 100%;} \ No newline at end of file diff --git a/events.html b/events.html new file mode 100644 index 0000000..669589e --- /dev/null +++ b/events.html @@ -0,0 +1,374 @@ + + + + + + + Open States API | Events + + + + + + + + +
+ +
+ +

Events

+

Events are not available in all states, to ensure that events are available check the feature_flags list in a states' metadata. + +

+

There are two methods available for event data: + +

+ + + + + + + + + + + + +
Method URL pattern Description
Event Search /events/ Search events by state and type.
Event Detail /event/event_id/ Get full detail for event.
+ +

Event Fields

+

The following fields are available on event objects: + +

+
    +
  • id Open States assigned event ID.
  • +
  • state State abbreviation.
  • +
  • type [Categorized event type.](TODO- categorization link here)
  • +
  • description Description of event from state source.
  • +
  • documents List of related documents.
  • +
  • location Location if known, as given by state (is often just a room number).
  • +
  • when Time event begins.
  • +
  • end End time (null if unknown).
  • +
  • timezone Timezone event occurs in (e.g. 'America/Chicago').
  • +
  • participants List of participant objects, consisting of the following fields:
      +
    • chamber Chamber of participant.
    • +
    • type Type of participants ('legislator', 'committee')
    • +
    • participant String representation of participant (e.g. 'Housing Committee', 'Jill Smith')
    • +
    • id Open States id for participant if a match was found (e.g. 'TXC000150', 'MDL000101')
    • +
    • type What role this participant played (e.g. 'host', 'speaker', etc.).
    • +
    +
  • +
  • related_bills List of related bills for this event. Comprised of the following fields:
      +
    • type Type of relationship (e.g. 'consideration')
    • +
    • description Description of how the bill is related given by the state.
    • +
    • bill_id State's bill id (e.g. 'HB 273')
    • +
    • id Open States assigned bill id (e.g. 'TXB00001234')
    • +
    +
  • +
  • sources List of URLs used in gathering information for this legislator.
  • +
  • created_at The date that this object first appeared in our system.
  • +
  • updated_at The date that this object was last updated in our system.
  • +
+

Methods

+ +

This method allows searching by a number of fields: + +

+
    +
  • state
  • +
  • type
  • +
+

This method also allows specifying an alternate output format, by specifying format=rss or format=ics. + +

+

Example: openstates.org/api/v1/events/?state=ca + +

+

Event Detail

+

This method returns an event object given an event id. + +

+

Example: openstates.org/api/v1/events/TXE00026474/ + +

+

Examples

+ +

http://openstates.org/api/v1/events/?state=tx + +

+
[
+ {
+  "documents": [], 
+  "end": null, 
+  "description": "Special Purpose Districts", 
+  "state": "tx", 
+  "+agenda": "HOUSE OF REPRESENTATIVES NOTICE OF FORMAL MEETING \u00a0 COMMITTEE:\u00a0\u00a0 Special Purpose Districts\u00a0 TIME & DATE: During reading and referral of bills Thursday, March 21, 2013\u00a0 PLACE:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 3W.9\u00a0 CHAIR:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Rep. Dennis Bonnen\u00a0 \u00a0 \u00a0 Notice of this meeting was announced from the house floor.", 
+  "created_at": "2013-03-24 08:38:18", 
+  "when": "2013-03-21 05:00:00", 
+  "updated_at": "2013-03-24 08:38:18", 
+  "sources": [
+   {
+    "url": "http://www.capitol.state.tx.us/tlodocs/83R/schedules/html/C4482013032100001.HTM"
+   }
+  ], 
+  "participants": [
+   {
+    "chamber": "lower", 
+    "participant_type": "committee", 
+    "participant": "Special Purpose Districts", 
+    "id": "TXC000150", 
+    "type": "host"
+   }, 
+   {
+    "chamber": "lower", 
+    "participant_type": "legislator", 
+    "participant": "Rep. Dennis Bonnen", 
+    "id": "TXL000223", 
+    "type": "chair"
+   }
+  ], 
+  "session": "83", 
+  "location": "3W.9\u00a0 ", 
+  "related_bills": [], 
+  "timezone": "America/Chicago", 
+  "type": "committee:meeting", 
+  "id": "TXE00026474", 
+  "+chamber": "lower"
+ }, 
+ {
+  "documents": [], 
+  "end": null, 
+  "description": "State Affairs", 
+  "state": "tx", 
+  "+agenda": "HOUSE OF REPRESENTATIVES NOTICE OF FORMAL MEETING \u00a0 COMMITTEE:\u00a0\u00a0 State Affairs\u00a0 TIME & DATE: During reading and referral of bills Thursday, March 21, 2013\u00a0 PLACE:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Agricultural Museum, 1W.14\u00a0 CHAIR:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Rep. Byron Cook\u00a0 \u00a0 Notice of this meeting was announced from the House floor.", 
+  "created_at": "2013-03-24 08:38:18", 
+  "when": "2013-03-21 05:00:00", 
+  "updated_at": "2013-03-24 08:38:18", 
+  "sources": [
+   {
+    "url": "http://www.capitol.state.tx.us/tlodocs/83R/schedules/html/C4502013032100001.HTM"
+   }
+  ], 
+  "participants": [
+   {
+    "chamber": "lower", 
+    "participant_type": "committee", 
+    "participant": "State Affairs", 
+    "id": "TXC000022", 
+    "type": "host"
+   }, 
+   {
+    "chamber": "lower", 
+    "participant_type": "legislator", 
+    "participant": "Rep. Byron Cook", 
+    "id": "TXL000236", 
+    "type": "chair"
+   }
+  ], 
+  "session": "83", 
+  "location": "Agricultural Museum, 1W.14\u00a0 ", 
+  "related_bills": [], 
+  "timezone": "America/Chicago", 
+  "type": "committee:meeting", 
+  "id": "TXE00026476", 
+  "+chamber": "lower"
+ }, 
+ {
+  "documents": [], 
+  "end": null, 
+  "description": "Defense & Veterans' Affairs", 
+  "type": "committee:meeting", 
+  "created_at": "2013-03-15 07:37:08", 
+  "related_bills": [
+   {
+    "type": "consideration", 
+    "description": "Bill up for discussion", 
+    "bill_id": "HB 846", 
+    "id": "TXB00024869"
+   }, 
+   {
+    "type": "consideration", 
+    "description": "Bill up for discussion", 
+    "bill_id": "HB 1348", 
+    "id": "TXB00025984"
+   }, 
+   {
+    "type": "consideration", 
+    "description": "Bill up for discussion", 
+    "bill_id": "HB 1832", 
+    "id": "TXB00026956"
+   }, 
+   {
+    "type": "consideration", 
+    "description": "Bill up for discussion", 
+    "bill_id": "HB 1939", 
+    "id": "TXB00027260"
+   }, 
+   {
+    "type": "consideration", 
+    "description": "Bill up for discussion", 
+    "bill_id": "HB 2387", 
+    "id": "TXB00028147"
+   }, 
+   {
+    "type": "consideration", 
+    "description": "Bill up for discussion", 
+    "bill_id": "HB 2392", 
+    "id": "TXB00028152"
+   }, 
+   {
+    "type": "consideration", 
+    "description": "Bill up for discussion", 
+    "bill_id": "HB 2071", 
+    "id": "TXB00027470"
+   }
+  ], 
+  "when": "2013-03-21 13:00:00", 
+  "updated_at": "2013-03-21 08:03:49", 
+  "sources": [
+   {
+    "url": "http://www.capitol.state.tx.us/tlodocs/83R/schedules/html/C3052013032108001.HTM"
+   }
+  ], 
+  "state": "tx", 
+  "session": "83", 
+  "location": "E2.012\u00a0 ", 
+  "participants": [
+   {
+    "chamber": "lower", 
+    "participant_type": "committee", 
+    "participant": "Defense & Veterans' Affairs", 
+    "id": "TXC000058", 
+    "type": "host"
+   }, 
+   {
+    "chamber": "lower", 
+    "participant_type": "legislator", 
+    "participant": "Rep. Jos\u00e9 Men\u00e9ndez", 
+    "id": "TXL000312", 
+    "type": "chair"
+   }
+  ], 
+  "timezone": "America/Chicago", 
+  "+agenda": "** REVISION **HOUSE OF REPRESENTATIVES NOTICE OF PUBLIC HEARING \u00a0 COMMITTEE:\u00a0\u00a0 Defense & Veterans' Affairs\u00a0 TIME & DATE: 8:00 AM, Thursday, March 21, 2013\u00a0 PLACE:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 E2.012\u00a0 CHAIR:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Rep. Jos\u00e9 Men\u00e9ndez\u00a0 \u00a0 HB 846\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Lucio III Relating to additional periods of possession of or access to a child after conclusion of a parent's military deployment. HB 1348\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Men\u00e9ndez\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Relating to the taxation of certain tangible personal property located inside a defense base development authority. HB 1832\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Miller, Rick\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Relating to granting certain local governments general zoning authority around certain military facilities; providing a penalty. HB 1939\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Orr\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Relating to a veteran's employment preference for employment with a public entity or public work of this state. HB 2387\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Men\u00e9ndez\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Relating to the taxation of certain tangible personal property located inside a defense base development authority. HB 2392\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Men\u00e9ndez\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Relating to the mental health program for veterans. \u00a0 \u00a0 Bills deleted after last posting: HB 2071 HCR 69 \u00a0 **\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 See Committee Coordinator for previous versions\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ** of the schedule, if applicable. NOTICE OF ASSISTANCE AT PUBLIC MEETINGS Persons with disabilities who plan to attend this meeting and who may need assistance, such as a sign language interpreter, are requested to contact Stacey Nicchio at (512) 463-0850, 72 hours prior to the meeting so that appropriate arrangements can be made. \u00a0 To find information about electronic witness registration for a public hearing and to create a profile to be used when registering as a witness, please visit www.house.state.tx.us/resources/. Registration must be performed the day of the meeting and within the Capitol Complex.", 
+  "id": "TXE00026387", 
+  "+chamber": "lower"
+ }, 
+ ...truncated...
+]
+

Event Detail

+

http://openstates.org/api/v1/event/TXE00026474/ + +

+
{
+ "+agenda": "HOUSE OF REPRESENTATIVES NOTICE OF FORMAL MEETING \u00a0 COMMITTEE:\u00a0\u00a0 Special Purpose Districts\u00a0 TIME & DATE: During reading and referral of bills Thursday, March 21, 2013\u00a0 PLACE:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 3W.9\u00a0 CHAIR:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Rep. Dennis Bonnen\u00a0 \u00a0 \u00a0 Notice of this meeting was announced from the house floor.", 
+ "+chamber": "lower", 
+ "created_at": "2013-03-24 08:38:18", 
+ "description": "Special Purpose Districts", 
+ "documents": [], 
+ "end": null, 
+ "id": "TXE00026474", 
+ "location": "3W.9\u00a0 ", 
+ "participants": [
+  {
+   "chamber": "lower", 
+   "participant_type": "committee", 
+   "participant": "Special Purpose Districts", 
+   "id": "TXC000150", 
+   "type": "host"
+  }, 
+  {
+   "chamber": "lower", 
+   "participant_type": "legislator", 
+   "participant": "Rep. Dennis Bonnen", 
+   "id": "TXL000223", 
+   "type": "chair"
+  }
+ ], 
+ "related_bills": [], 
+ "session": "83", 
+ "sources": [
+  {
+   "url": "http://www.capitol.state.tx.us/tlodocs/83R/schedules/html/C4482013032100001.HTM"
+  }
+ ], 
+ "state": "tx", 
+ "timezone": "America/Chicago", 
+ "type": "committee:meeting", 
+ "updated_at": "2013-03-24 08:38:18", 
+ "when": "2013-03-21 05:00:00"
+}
+ +
+
+ + + + \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..7d60e6d --- /dev/null +++ b/index.html @@ -0,0 +1,198 @@ + + + + + + + Open States API + + + + + + + + +
+ +
+ +

Open States API

+

Open States provides a JSON API for accessing state legislative information. + +

+

Basics

+
    +
  • All API calls are URLs in the form http://openstates.org/api/v1/METHOD/
  • +
  • Responses are JSON unless otherwise specified.
  • +
  • If an error occurs the response will be a plain text error message with an appropriate HTTP error code (404 if object is not found, 401 if authentication fails, etc.).
  • +
  • An API key is required to be passed as request parameter apikey. A key can be obtained via http://services.sunlightlabs.com/
  • +
  • All changes to the API will be announced on the Open States Google Group. It is recommended you subscribe if you're using the API.
  • +
  • For Python users, there's an official python-sunlight package available with full support.
  • +
+

Data Types

+

Open States provides data about six core data types. + +

+
    +
  • State Metadata - Details on what data is available, including terms, sessions, and state-specific names for things.
  • +
  • Bills - Details on bills & resolutions, including actions & votes.
  • +
  • Legislators - Details on legislators, including contact details.
  • +
  • Committees - Details on committees as they currently stand.
  • +
  • Events - Details on upcoming events such as committee meetings and hearings.
  • +
  • Districts - Details on districts and their boundaries.
  • +
+

Methods

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Method URL pattern Description
Metadata Overview /metadata/ Get list of all states with data available and basic metadata about their status.
State Metadata /metadata/state/ Get detailed metadata for a particular state.
Bill Search /bills/ Search bills by (almost) any of their attributes, or full text.
Bill Detail /bills/state/session/bill_id/ Get full detail for bill, including any actions, votes, etc.
Legislator Search /legislators/ Search legislators by their attributes.
Legislator Detail /legislators/leg_id/ Get full detail for a legislator, including all roles.
Geo Lookup /legislators/geo/?lat=latitude&long=longitude Lookup all legislators that serve districts containing a given point.
Committee Search /committees/ Search committees by any of their attributes.
Committee Detail /committees/committee_id/ Get full detail for committee, including all members.
Event Search /events/ Search events by state and type.
Event Detail /event/event_id/ Get full detail for event.
+ +

Requesting A Custom Fieldset

+

On essentially every method in the API it is possible to specify a custom subset of fields on an object by specifying a fields parameter. + +

+

There are two use cases that this functionality aims to serve: + +

+

First, if you are writing an application that loads a lot of data but only uses some of it, specifying a limited subset of fields can reduce response time and bandwidth. We've seen this approach be particuarly useful for mobile applications where bandwidth is at a premium. + +

+

An example would be a legislator search with fields=first_name,last_name,leg_id specified. All legislator objects returned will only have the three fields that you requested. + +

+

Second, you can actually specify a set of fields that includes fields excluded in the default response. + +

+

For instance, if you are conducting a bill search, it typically does not include sponsors, though many sites may wish to use sponsor information without making a request for the full bill (which is typically much larger as it includes versions, votes, actions, etc.). + +

+

A bill search that specifies fields=bill_id,sponsors,title,chamber will include the full sponsor listing in addition to the standard bill_id, title and chamber fields. + + +

+

Extra Fields

+

You may notice that the fields documented are sometimes a subset of the fields actually included in a response. + +

+

Many times as part of our scraping process we take in data that is available for a given state and is either not available or does not have an analog in other states. Instead of artificially limiting the data we provide to the smallest common subset we make this extra data available. + +

+

To make it clear which fields can be relied upon and which are perhaps specific to a state or subset of states we prefix non-standard fields with a +. + +

+

If you are using the API to get data for multiple states, it is best to restrict your usage to the fields documented here. If you are only interested in data for a small subset of our available states it might make sense to take a more in depth look at the API responses for the state in question to see what extra data we are able to provide. + +

+ +
+
+ + + + \ No newline at end of file diff --git a/legislators.html b/legislators.html new file mode 100644 index 0000000..c6819ae --- /dev/null +++ b/legislators.html @@ -0,0 +1,1261 @@ + + + + + + + Open States API | Legislators + + + + + + + + +
+ +
+ +

Legislators

+

There are three methods available for access to legislator information: + +

+ + + + + + + + + + + + + + + + + + + + + +
Method URL pattern Description
Legislator Search /legislators/ Search legislators by their attributes.
Legislator Detail /legislators/leg_id/ Get full detail for a legislator, including all roles.
Geo Lookup /legislators/geo/?lat=latitude&long=longitude Lookup all legislators that serve districts containing a given point.
+ + +

Legislator Fields

+

The following fields are available on legislator objects: + +

+
    +
  • leg_id Legislator's permanent Open States ID. (e.g. 'ILL000555', 'NCL000123')
  • +
  • state Legislator's state.
  • +
  • active Boolean value indicating whether or not the legislator is currently in office.
  • +
  • chamber Chamber the legislator is currently serving in if active ('upper' or 'lower')
  • +
  • district District the legislator is currently serving in if active (e.g. '7', '6A')
  • +
  • party Party the legislator is currently representing if active.
  • +
  • email Legislator's primary email address.
  • +
  • full_name Full display name for legislator.
  • +
  • first_name First name of legislator.
  • +
  • middle_name Middle name of legislator.
  • +
  • last_name Last name of legislator.
  • +
  • suffixes Name suffixes (e.g. 'Jr.', 'III') of legislator.
  • +
  • photo_url URL of an official photo of this legislator.
  • +
  • url URL of an official webpage for this legislator.
  • +
  • created_at The date that this object first appeared in our system.
  • +
  • updated_at The date that this object was last updated in our system.
  • +
  • transparencydata_id Legislator's ID on Influence Explorer if a match has been found.
  • +
  • created_at Date at which this legislator was added to our system.
  • +
  • updated_at Date at which this legislator was last updated.
  • +
  • offices List of office objects representing contact details for the legislator. Comprised of the following fields:
      +
    • type 'capitol' or 'district'
    • +
    • name Name of the address (e.g. 'Council Office', 'District Office')
    • +
    • address Street address.
    • +
    • phone Phone number.
    • +
    • fax Fax number.
    • +
    • email Email address. +Any of these fields may be null if not found.
    • +
    +
  • +
  • roles List of currently active role objects if legislator is in office.
  • +
  • old_roles Dictionary mapping term keys to lists of roles that were valid for that term.
  • +
+

Roles

+

roles and old_roles are comprised of role objects. + +

+

Role objects can have the following fields: + +

+
    +
  • term Term key for this role. (See metadata notes on terms and sessions for details.)
  • +
  • chamber
  • +
  • state
  • +
  • start_date (optional)
  • +
  • end_date (optional)
  • +
  • type 'member' or 'committee member'
  • +
+

If the role type is 'member': + +

+
    +
  • party
  • +
  • district
  • +
+

And if the type is 'committee member': + +

+
    +
  • committee name of parent committee
  • +
  • subcommittee name of subcommittee (if null, membership is just for a committee)
  • +
  • committee_id Open States id for committee that legislator is a member of
  • +
  • position position on committee
  • +
  • old_roles
  • +
  • sources List of URLs used in gathering information for this legislator.
  • +
+

Methods

+ +

This method allows looking up a legislator by a number of parameters, the results do not include the roles or old_roles items by default. + +

+

Parameters

+
    +
  • state Filter by state.
  • +
  • first_name Filter by first name.
  • +
  • last_name Filter by last name.
  • +
  • chamber Only legislators with a role in the specified chamber.
  • +
  • active 'true' (default) to only include current legislators, 'false' will include all legislators
  • +
  • term Only legislators that have a role in a certain term.
  • +
  • district Only legislators that have represented the specified district.
  • +
  • party Only legislators that have been associated with a specified party.
  • +
+

Example: openstates.org/api/v1/legislators/?state=dc&chamber=upper + + +

+

Legislator Detail

+

This method returns the full detail for a legislator. + +

+

Example: openstates.org/api/v1/legislators/DCL000012/ + + +

+

Geo Lookup

+

Lookup all legislators serving districts containing a given location. + +

+

Example: openstates.org/api/v1/legislators/geo/?lat=35.79&long=-78.78 + + +

+

Examples

+ +

http://openstates.org/api/v1/legislators/?state=dc&chamber=upper + +

+
[
+ {
+  "first_name": "Anita", 
+  "last_name": "Bonds", 
+  "middle_name": "", 
+  "district": "At-Large", 
+  "chamber": "upper", 
+  "url": "http://dccouncil.us/council/anita-bonds", 
+  "created_at": "2013-01-07 21:05:06", 
+  "updated_at": "2013-03-26 03:22:24", 
+  "email": "abonds@dccouncil.us", 
+  "active": true, 
+  "state": "dc", 
+  "offices": [
+   {
+    "fax": "(202) 724-8099", 
+    "name": "Council Office", 
+    "phone": "(202) 724-8064", 
+    "address": "1350 Pennsylvania Avenue NW, Suite 408, Washington, DC 20004", 
+    "type": "capitol", 
+    "email": null
+   }
+  ], 
+  "full_name": "Anita Bonds", 
+  "leg_id": "DCL000021", 
+  "party": "Democratic", 
+  "suffixes": "", 
+  "id": "DCL000021", 
+  "photo_url": "http://dccouncil.us/files/user_uploads/member_photos/AAA_small.jpg"
+ }, 
+ {
+  "+fax": "(202) 724-8099", 
+  "last_name": "Mendelson", 
+  "updated_at": "2013-03-26 03:20:14", 
+  "full_name": "Phil Mendelson", 
+  "id": "DCL000005", 
+  "first_name": "Phil", 
+  "middle_name": "", 
+  "district": "Chairman", 
+  "office_address": "1350 Pennsylvania Avenue NW, Suite 402, Washington, DC 20004", 
+  "state": "dc", 
+  "votesmart_id": "72089", 
+  "party": "Democratic", 
+  "email": "pmendelson@dccouncil.us", 
+  "leg_id": "DCL000005", 
+  "active": true, 
+  "photo_url": "http://dccouncil.us/files/user_uploads/member_photos/mendelson.jpg", 
+  "level": "state", 
+  "url": "http://dccouncil.us/council/phil-mendelson", 
+  "created_at": "2011-02-17 22:43:55", 
+  "chamber": "upper", 
+  "offices": [
+   {
+    "fax": "(202) 724-8099", 
+    "name": "Council Office", 
+    "phone": "(202) 724-8032     ", 
+    "address": "1350 Pennsylvania Avenue NW, Suite 504, Washington, DC 20004", 
+    "type": "capitol", 
+    "email": null
+   }
+  ], 
+  "suffixes": "", 
+  "+phone": "(202) 724-8064      "
+ }, 
+ {
+  "first_name": "David", 
+  "last_name": "Grosso", 
+  "middle_name": "", 
+  "district": "At-Large", 
+  "chamber": "upper", 
+  "url": "http://dccouncil.us/council/david-grosso", 
+  "created_at": "2013-01-07 21:05:06", 
+  "updated_at": "2013-03-26 03:22:24", 
+  "email": "dgrosso@dccouncil.us", 
+  "active": true, 
+  "state": "dc", 
+  "offices": [
+   {
+    "fax": "(202) 724-8071", 
+    "name": "Council Office", 
+    "phone": "(202) 724-8105", 
+    "address": "1350 Pennsylvania Avenue NW, Suite 406, Washington, DC 20004", 
+    "type": "capitol", 
+    "email": null
+   }
+  ], 
+  "full_name": "David Grosso", 
+  "leg_id": "DCL000020", 
+  "party": "Independent", 
+  "suffixes": "", 
+  "id": "DCL000020", 
+  "photo_url": "http://dccouncil.us/files/user_uploads/member_photos/david_grosso_color__small.jpg"
+ }, 
+ {
+  "+fax": "(202) 741-0911", 
+  "last_name": "Alexander", 
+  "updated_at": "2013-03-26 03:22:24", 
+  "full_name": "Yvette Alexander", 
+  "id": "DCL000010", 
+  "first_name": "Yvette", 
+  "middle_name": "", 
+  "district": "Ward 7", 
+  "office_address": "1350 Pennsylvania Avenue, Suite 400, NW Washington, DC 20004", 
+  "state": "dc", 
+  "votesmart_id": "72072", 
+  "party": "Democratic", 
+  "email": "yalexander@dccouncil.us", 
+  "leg_id": "DCL000010", 
+  "active": true, 
+  "photo_url": "http://dccouncil.us/files/user_uploads/member_photos/alexander_dec2011.jpg", 
+  "level": "state", 
+  "url": "http://dccouncil.us/council/yvette-alexander", 
+  "created_at": "2011-02-17 22:43:55", 
+  "chamber": "upper", 
+  "offices": [
+   {
+    "fax": "(202) 741-0911", 
+    "name": "Council Office", 
+    "phone": "(202) 724-8068", 
+    "address": "1350 Pennsylvania Avenue, Suite 400, NW Washington, DC 20004", 
+    "type": "capitol", 
+    "email": null
+   }
+  ], 
+  "+phone": "(202) 724-8068", 
+  "suffixes": ""
+ }, 
+ {
+  "+fax": "(202) 724-8054", 
+  "last_name": "Wells", 
+  "updated_at": "2013-03-26 03:22:24", 
+  "full_name": "Tommy Wells", 
+  "id": "DCL000008", 
+  "first_name": "Tommy", 
+  "middle_name": "", 
+  "district": "Ward 6", 
+  "office_address": "1350 Pennsylvania Avenue, Suite 408, NW Washington, DC 20004", 
+  "state": "dc", 
+  "votesmart_id": "72071", 
+  "party": "Democratic", 
+  "email": "twells@dccouncil.us", 
+  "leg_id": "DCL000008", 
+  "active": true, 
+  "photo_url": "http://dccouncil.us/files/user_uploads/member_photos/wells2.jpg", 
+  "level": "state", 
+  "url": "http://dccouncil.us/council/tommy-wells", 
+  "created_at": "2011-02-17 22:43:55", 
+  "chamber": "upper", 
+  "offices": [
+   {
+    "fax": "(202) 724-8054", 
+    "name": "Council Office", 
+    "phone": "(202) 724-8072", 
+    "address": "1350 Pennsylvania Avenue, Suite 402, NW Washington, DC 20004", 
+    "type": "capitol", 
+    "email": null
+   }
+  ], 
+  "+phone": "(202) 724-8072", 
+  "suffixes": ""
+ }, 
+ {
+  "+fax": "(202) 727-8210", 
+  "last_name": "Orange", 
+  "updated_at": "2013-03-26 03:22:24", 
+  "full_name": "Vincent Orange", 
+  "id": "DCL000014", 
+  "first_name": "Vincent", 
+  "middle_name": "", 
+  "district": "At-Large", 
+  "office_address": "1350 Pennsylvania Avenue NW, Suite 107, Washington, DC 20004", 
+  "state": "dc", 
+  "party": "Democratic", 
+  "email": "vorange@dccouncil.us", 
+  "leg_id": "DCL000014", 
+  "active": true, 
+  "photo_url": "http://dccouncil.us/files/user_uploads/member_photos/orange.jpg", 
+  "level": "state", 
+  "url": "http://dccouncil.us/council/vincent-orange", 
+  "created_at": "2011-05-12 02:08:19", 
+  "chamber": "upper", 
+  "offices": [
+   {
+    "fax": "(202) 727-8210", 
+    "name": "Council Office", 
+    "phone": "(202) 724-8174      ", 
+    "address": "1350 Pennsylvania Avenue NW, Suite 107, Washington, DC 20004", 
+    "type": "capitol", 
+    "email": null
+   }
+  ], 
+  "+phone": "(202) 724-8174      ", 
+  "suffixes": ""
+ }, 
+ {
+  "+fax": "(202) 741-0908", 
+  "last_name": "Bowser", 
+  "updated_at": "2013-03-26 03:22:24", 
+  "full_name": "Muriel Bowser", 
+  "id": "DCL000011", 
+  "first_name": "Muriel", 
+  "middle_name": "", 
+  "district": "Ward 4", 
+  "office_address": "1350 Pennsylvania Avenue, Suite 110, NW Washington, DC 20004", 
+  "state": "dc", 
+  "votesmart_id": "72064", 
+  "party": "Democratic", 
+  "email": "mbowser@dccouncil.us", 
+  "leg_id": "DCL000011", 
+  "active": true, 
+  "photo_url": "http://dccouncil.us/files/user_uploads/member_photos/Bowser_Official_Photo_2012_small.jpg", 
+  "level": "state", 
+  "url": "http://dccouncil.us/council/muriel-bowser", 
+  "created_at": "2011-02-17 22:43:55", 
+  "chamber": "upper", 
+  "offices": [
+   {
+    "fax": "(202) 741-0908", 
+    "name": "Council Office", 
+    "phone": "(202) 724-8052", 
+    "address": "1350 Pennsylvania Avenue, Suite 110, NW Washington, DC 20004", 
+    "type": "capitol", 
+    "email": null
+   }
+  ], 
+  "suffixes": "", 
+  "+phone": "(202) 724-8052"
+ }, 
+ {
+  "+fax": "(202) 724-8087", 
+  "last_name": "Catania", 
+  "updated_at": "2013-03-26 03:22:24", 
+  "full_name": "David Catania", 
+  "id": "DCL000003", 
+  "first_name": "David", 
+  "middle_name": "", 
+  "district": "At-Large", 
+  "office_address": "1350 Pennsylvania Avenue NW, Suite 404, Washington, DC 20004", 
+  "state": "dc", 
+  "votesmart_id": "72081", 
+  "party": "Independent", 
+  "email": "dcatania@dccouncil.us", 
+  "leg_id": "DCL000003", 
+  "active": true, 
+  "photo_url": "http://dccouncil.us/files/user_uploads/member_photos/catania.jpg", 
+  "level": "state", 
+  "url": "http://dccouncil.us/council/david-catania", 
+  "created_at": "2011-02-17 22:43:55", 
+  "chamber": "upper", 
+  "offices": [
+   {
+    "fax": "(202) 724-8087", 
+    "name": "Council Office", 
+    "phone": "(202) 724-7772      ", 
+    "address": "1350 Pennsylvania Avenue NW, Suite 404, Washington, DC 20004", 
+    "type": "capitol", 
+    "email": null
+   }
+  ], 
+  "+phone": "(202) 724-7772      ", 
+  "suffixes": ""
+ }, 
+ {
+  "+fax": "(202) 724-8076", 
+  "last_name": "McDuffie", 
+  "updated_at": "2013-03-26 03:22:24", 
+  "full_name": "Kenyan McDuffie", 
+  "id": "DCL000017", 
+  "first_name": "Kenyan", 
+  "middle_name": "", 
+  "district": "Ward 5", 
+  "office_address": "1350 Pennsylvania Avenue NW, Suite 410, Washington, DC 20004", 
+  "state": "dc", 
+  "party": "Democratic", 
+  "email": "kmcduffie@dccouncil.us", 
+  "leg_id": "DCL000017", 
+  "active": true, 
+  "photo_url": "http://dccouncil.us/files/user_uploads/member_photos/Councilmember_Kenyan_R._McDuffie_Official_Photograph_small.jpg", 
+  "level": "state", 
+  "url": "http://dccouncil.us/council/kenyan-mcduffie", 
+  "created_at": "2012-05-31 02:28:23", 
+  "chamber": "upper", 
+  "offices": [
+   {
+    "fax": "(202) 724-8076", 
+    "name": "Council Office", 
+    "phone": "(202) 724-8028 ", 
+    "address": "1350 Pennsylvania Avenue NW, Suite 506, Washington, DC 20004", 
+    "type": "capitol", 
+    "email": null
+   }
+  ], 
+  "suffixes": "", 
+  "+phone": "(202) 724-8028 "
+ }, 
+ {
+  "+fax": "(202) 724-8023", 
+  "last_name": "Evans", 
+  "updated_at": "2013-03-26 03:22:24", 
+  "full_name": "Jack Evans", 
+  "id": "DCL000009", 
+  "first_name": "Jack", 
+  "middle_name": "", 
+  "district": "Ward 2", 
+  "office_address": "1350 Pennsylvania Avenue, Suite 106, NW Washington, DC 20004", 
+  "state": "dc", 
+  "votesmart_id": "72044", 
+  "party": "Democratic", 
+  "email": "jevans@dccouncil.us", 
+  "leg_id": "DCL000009", 
+  "active": true, 
+  "photo_url": "http://dccouncil.us/files/user_uploads/member_photos/evans.jpg", 
+  "level": "state", 
+  "url": "http://dccouncil.us/council/jack-evans", 
+  "created_at": "2011-02-17 22:43:55", 
+  "chamber": "upper", 
+  "offices": [
+   {
+    "fax": "(202) 724-8023", 
+    "name": "Council Office", 
+    "phone": "(202) 724-8058", 
+    "address": "1350 Pennsylvania Avenue, Suite 106, NW Washington, DC 20004", 
+    "type": "capitol", 
+    "email": null
+   }
+  ], 
+  "+phone": "(202) 724-8058", 
+  "suffixes": ""
+ }, 
+ {
+  "+fax": "(202) 724-8109", 
+  "last_name": "Graham", 
+  "updated_at": "2013-03-26 03:22:24", 
+  "full_name": "Jim Graham", 
+  "id": "DCL000007", 
+  "first_name": "Jim", 
+  "middle_name": "", 
+  "district": "Ward 1", 
+  "office_address": "1350 Pennsylvania Avenue, Suite 105, NW Washington, DC 20004", 
+  "state": "dc", 
+  "votesmart_id": "72038", 
+  "party": "Democratic", 
+  "email": "jgraham@dccouncil.us", 
+  "leg_id": "DCL000007", 
+  "active": true, 
+  "photo_url": "http://dccouncil.us/files/user_uploads/member_photos/graham.jpg", 
+  "level": "state", 
+  "url": "http://dccouncil.us/council/jim-graham", 
+  "created_at": "2011-02-17 22:43:55", 
+  "chamber": "upper", 
+  "offices": [
+   {
+    "fax": "(202) 724-8109", 
+    "name": "Council Office", 
+    "phone": "(202) 724-8181", 
+    "address": "1350 Pennsylvania Avenue, Suite 105, NW Washington, DC 20004", 
+    "type": "capitol", 
+    "email": null
+   }
+  ], 
+  "+phone": "(202) 724-8181", 
+  "suffixes": ""
+ }, 
+ {
+  "+fax": "(202) 724-8118", 
+  "last_name": "Cheh", 
+  "updated_at": "2013-03-26 03:22:24", 
+  "full_name": "Mary M Cheh", 
+  "id": "DCL000002", 
+  "first_name": "Mary", 
+  "middle_name": "M", 
+  "district": "Ward 3", 
+  "office_address": "1350 Pennsylvania Avenue, Suite 108, NW  Washington, DC 20004", 
+  "state": "dc", 
+  "votesmart_id": "72047", 
+  "party": "Democratic", 
+  "email": "mcheh@dccouncil.us", 
+  "leg_id": "DCL000002", 
+  "active": true, 
+  "photo_url": "http://dccouncil.us/files/user_uploads/member_photos/cheh.jpg", 
+  "level": "state", 
+  "url": "http://dccouncil.us/council/mary-m.-cheh", 
+  "created_at": "2011-02-17 22:43:55", 
+  "chamber": "upper", 
+  "offices": [
+   {
+    "fax": "(202) 724-8118", 
+    "name": "Council Office", 
+    "phone": "(202) 724-8062", 
+    "address": "1350 Pennsylvania Avenue, Suite 108, NW  Washington, DC 20004", 
+    "type": "capitol", 
+    "email": null
+   }
+  ], 
+  "+phone": "(202) 724-8062", 
+  "suffixes": ""
+ }, 
+ {
+  "+fax": "(202) 724-8055", 
+  "last_name": "Barry", 
+  "updated_at": "2013-03-26 03:22:24", 
+  "full_name": "Marion Barry", 
+  "id": "DCL000012", 
+  "first_name": "Marion", 
+  "middle_name": "", 
+  "district": "Ward 8", 
+  "office_address": "1350 Pennsylvania Avenue NW, Suite 102, Washington, DC 20004", 
+  "state": "dc", 
+  "votesmart_id": "72074", 
+  "party": "Democratic", 
+  "email": "mbarry@dccouncil.us", 
+  "leg_id": "DCL000012", 
+  "active": true, 
+  "photo_url": "http://dccouncil.us/files/user_uploads/member_photos/barry.jpg", 
+  "level": "state", 
+  "url": "http://dccouncil.us/council/marion-barry", 
+  "created_at": "2011-02-17 22:43:55", 
+  "chamber": "upper", 
+  "offices": [
+   {
+    "fax": "(202) 724-8055", 
+    "name": "Council Office", 
+    "phone": "(202) 724-8045", 
+    "address": "1350 Pennsylvania Avenue NW, Suite 102, Washington, DC 20004", 
+    "type": "capitol", 
+    "email": null
+   }
+  ], 
+  "+phone": "(202) 724-8045", 
+  "suffixes": ""
+ }
+]
+

Legislator Detail

+

http://openstates.org/api/v1/legislators/DCL000012/ + +

+
{
+ "active": true, 
+ "chamber": "upper", 
+ "created_at": "2011-02-17 22:43:55", 
+ "district": "Ward 8", 
+ "email": "mbarry@dccouncil.us", 
+ "first_name": "Marion", 
+ "full_name": "Marion Barry", 
+ "id": "DCL000012", 
+ "last_name": "Barry", 
+ "leg_id": "DCL000012", 
+ "level": "state", 
+ "middle_name": "", 
+ "office_address": "1350 Pennsylvania Avenue NW, Suite 102, Washington, DC 20004", 
+ "offices": [
+  {
+   "fax": "(202) 724-8055", 
+   "name": "Council Office", 
+   "phone": "(202) 724-8045", 
+   "address": "1350 Pennsylvania Avenue NW, Suite 102, Washington, DC 20004", 
+   "type": "capitol", 
+   "email": null
+  }
+ ], 
+ "old_roles": {
+  "2011-2012": [
+   {
+    "term": "2011-2012", 
+    "end_date": null, 
+    "district": "Ward 8", 
+    "chamber": "upper", 
+    "state": "dc", 
+    "party": "Democratic", 
+    "type": "member", 
+    "start_date": null
+   }, 
+   {
+    "term": "2011-2012", 
+    "committee_id": "DCC000017", 
+    "chamber": "upper", 
+    "state": "dc", 
+    "subcommittee": null, 
+    "committee": "Finance and Revenue", 
+    "position": "member", 
+    "type": "committee member"
+   }, 
+   {
+    "term": "2011-2012", 
+    "committee_id": "DCC000027", 
+    "chamber": "upper", 
+    "state": "dc", 
+    "subcommittee": null, 
+    "committee": "Jobs and Workforce Development", 
+    "position": "member", 
+    "type": "committee member"
+   }, 
+   {
+    "term": "2011-2012", 
+    "committee_id": "DCC000021", 
+    "chamber": "upper", 
+    "state": "dc", 
+    "subcommittee": null, 
+    "committee": "the Judiciary", 
+    "position": "member", 
+    "type": "committee member"
+   }, 
+   {
+    "term": "2011-2012", 
+    "committee_id": "DCC000019", 
+    "chamber": "upper", 
+    "state": "dc", 
+    "subcommittee": null, 
+    "committee": "Aging and Community Affairs", 
+    "position": "member", 
+    "type": "committee member"
+   }, 
+   {
+    "term": "2011-2012", 
+    "committee_id": "DCC000026", 
+    "chamber": "upper", 
+    "state": "dc", 
+    "subcommittee": null, 
+    "committee": "Economic Development and Housing", 
+    "position": "member", 
+    "type": "committee member"
+   }, 
+   {
+    "term": "2011-2012", 
+    "committee_id": "DCC000014", 
+    "chamber": "upper", 
+    "state": "dc", 
+    "subcommittee": null, 
+    "committee": "Human Services", 
+    "position": "member", 
+    "type": "committee member"
+   }, 
+   {
+    "term": "2011-2012", 
+    "committee_id": "DCC000023", 
+    "chamber": "upper", 
+    "state": "dc", 
+    "subcommittee": null, 
+    "committee": "Health", 
+    "position": "member", 
+    "type": "committee member"
+   }
+  ]
+ }, 
+ "party": "Democratic", 
+ "photo_url": "http://dccouncil.us/files/user_uploads/member_photos/barry.jpg", 
+ "roles": [
+  {
+   "term": "2013-2014", 
+   "end_date": null, 
+   "district": "Ward 8", 
+   "chamber": "upper", 
+   "state": "dc", 
+   "party": "Democratic", 
+   "type": "member", 
+   "start_date": null
+  }, 
+  {
+   "term": "2013-2014", 
+   "committee_id": "DCC000014", 
+   "chamber": "upper", 
+   "state": "dc", 
+   "subcommittee": null, 
+   "committee": "Human Services", 
+   "position": "member", 
+   "type": "committee member"
+  }, 
+  {
+   "term": "2013-2014", 
+   "committee_id": "DCC000017", 
+   "chamber": "upper", 
+   "state": "dc", 
+   "subcommittee": null, 
+   "committee": "Finance and Revenue", 
+   "position": "member", 
+   "type": "committee member"
+  }, 
+  {
+   "term": "2013-2014", 
+   "committee_id": "DCC000032", 
+   "chamber": "upper", 
+   "state": "dc", 
+   "subcommittee": null, 
+   "committee": "Education", 
+   "position": "member", 
+   "type": "committee member"
+  }, 
+  {
+   "term": "2013-2014", 
+   "committee_id": "DCC000031", 
+   "chamber": "upper", 
+   "state": "dc", 
+   "subcommittee": null, 
+   "committee": "Workforce and Community Affairs", 
+   "position": "member", 
+   "type": "committee member"
+  }
+ ], 
+ "sources": [ { "url": "http://dccouncil.us/council/marion-barry" } ], 
+ "state": "dc", 
+ "suffixes": "", 
+ "updated_at": "2013-03-26 03:22:24", 
+ "url": "http://dccouncil.us/council/marion-barry", 
+ "votesmart_id": "72074"
+}
+

Geo Lookup

+

http://openstates.org/api/v1/legislators/geo/?lat=35.79&long=-78.78 + +

+
[
+ {
+  "last_name": "Stein", 
+  "suffix": "", 
+  "updated_at": "2013-03-27 02:35:39", 
+  "sources": [ { "url": "http://www.ncga.state.nc.us/gascripts/members/viewMember.pl?sChamber=Senate&nUserID=267" } ], 
+  "full_name": "Josh Stein", 
+  "old_roles": {
+   "2009-2010": [
+    {
+     "term": "2009-2010", 
+     "end_date": null, 
+     "district": "16", 
+     "level": "state", 
+     "chamber": "upper", 
+     "state": "nc", 
+     "party": "Democratic", 
+     "type": "member", 
+     "start_date": null
+    }, 
+    {
+     "term": "2009-2010", 
+     "committee_id": "NCC000002", 
+     "level": "state", 
+     "chamber": "upper", 
+     "state": "nc", 
+     "subcommittee": null, 
+     "committee": "Appropriations on Department of Transportation", 
+     "type": "committee member"
+    }, 
+    {
+     "term": "2009-2010", 
+     "committee_id": "NCC000008", 
+     "level": "state", 
+     "chamber": "upper", 
+     "state": "nc", 
+     "subcommittee": null, 
+     "committee": "Appropriations/Base Budget", 
+     "type": "committee member"
+    }, 
+    {
+     "term": "2009-2010", 
+     "committee_id": "NCC000009", 
+     "level": "state", 
+     "chamber": "upper", 
+     "state": "nc", 
+     "subcommittee": null, 
+     "committee": "Commerce", 
+     "type": "committee member"
+    }, 
+    {
+     "term": "2009-2010", 
+     "committee_id": "NCC000010", 
+     "level": "state", 
+     "chamber": "upper", 
+     "state": "nc", 
+     "subcommittee": null, 
+     "committee": "Education/Higher Education", 
+     "type": "committee member"
+    }, 
+    {
+     "term": "2009-2010", 
+     "committee_id": "NCC000073", 
+     "level": "state", 
+     "chamber": "upper", 
+     "state": "nc", 
+     "subcommittee": null, 
+     "committee": "Finance", 
+     "type": "committee member"
+    }, 
+    {
+     "term": "2009-2010", 
+     "committee_id": "NCC000012", 
+     "level": "state", 
+     "chamber": "upper", 
+     "state": "nc", 
+     "subcommittee": null, 
+     "committee": "Health Care", 
+     "type": "committee member"
+    }, 
+    {
+     "term": "2009-2010", 
+     "committee_id": "NCC000074", 
+     "level": "state", 
+     "chamber": "upper", 
+     "state": "nc", 
+     "subcommittee": null, 
+     "committee": "Judiciary I", 
+     "type": "committee member"
+    }, 
+    {
+     "term": "2009-2010", 
+     "committee_id": "NCC000022", 
+     "level": "state", 
+     "chamber": "upper", 
+     "state": "nc", 
+     "subcommittee": null, 
+     "committee": "Select Committee on Economic Recovery", 
+     "type": "committee member"
+    }, 
+    {
+     "term": "2009-2010", 
+     "committee_id": "NCC000024", 
+     "level": "state", 
+     "chamber": "upper", 
+     "state": "nc", 
+     "subcommittee": null, 
+     "committee": "Select Committee on Energy, Science and Technology", 
+     "type": "committee member"
+    }
+   ], 
+   "2011-2012": [
+    {
+     "term": "2011-2012", 
+     "end_date": null, 
+     "district": "16", 
+     "chamber": "upper", 
+     "state": "nc", 
+     "party": "Democratic", 
+     "type": "member", 
+     "start_date": null
+    }, 
+    {
+     "term": "2011-2012", 
+     "committee_id": "NCC000009", 
+     "chamber": "upper", 
+     "state": "nc", 
+     "subcommittee": null, 
+     "committee": "Commerce", 
+     "position": "member", 
+     "type": "committee member"
+    }, 
+    {
+     "term": "2011-2012", 
+     "committee_id": "NCC000100", 
+     "chamber": "upper", 
+     "state": "nc", 
+     "subcommittee": null, 
+     "committee": "Education / Higher Education", 
+     "position": "member", 
+     "type": "committee member"
+    }, 
+    {
+     "term": "2011-2012", 
+     "committee_id": "NCC000073", 
+     "chamber": "upper", 
+     "state": "nc", 
+     "subcommittee": null, 
+     "committee": "Finance", 
+     "position": "member", 
+     "type": "committee member"
+    }, 
+    {
+     "term": "2011-2012", 
+     "committee_id": "NCC000074", 
+     "chamber": "upper", 
+     "state": "nc", 
+     "subcommittee": null, 
+     "committee": "Judiciary I", 
+     "position": "member", 
+     "type": "committee member"
+    }, 
+    {
+     "term": "2011-2012", 
+     "committee_id": "NCC000018", 
+     "chamber": "upper", 
+     "state": "nc", 
+     "subcommittee": null, 
+     "committee": "Rules and Operations of the Senate", 
+     "position": "member", 
+     "type": "committee member"
+    }
+   ]
+  }, 
+  "id": "NCL000047", 
+  "first_name": "Josh", 
+  "middle_name": "", 
+  "district": "16", 
+  "state": "nc", 
+  "votesmart_id": "102971", 
+  "party": "Democratic", 
+  "email": "Josh.Stein@ncleg.net", 
+  "leg_id": "NCL000047", 
+  "boundary_id": "sldu/nc-16", 
+  "active": true, 
+  "transparencydata_id": "d3917a35b626477a9a7afaf7dbf206be", 
+  "photo_url": "http://www.ncga.state.nc.us/Senate/pictures/hiRes/267.jpg", 
+  "roles": [
+   {
+    "term": "2013-2014", 
+    "end_date": null, 
+    "district": "16", 
+    "chamber": "upper", 
+    "state": "nc", 
+    "party": "Democratic", 
+    "type": "member", 
+    "start_date": null
+   }, 
+   {
+    "term": "2013-2014", 
+    "committee_id": "NCC000009", 
+    "chamber": "upper", 
+    "state": "nc", 
+    "subcommittee": null, 
+    "committee": "Commerce", 
+    "position": "member", 
+    "type": "committee member"
+   }, 
+   {
+    "term": "2013-2014", 
+    "committee_id": "NCC000100", 
+    "chamber": "upper", 
+    "state": "nc", 
+    "subcommittee": null, 
+    "committee": "Education / Higher Education", 
+    "position": "member", 
+    "type": "committee member"
+   }, 
+   {
+    "term": "2013-2014", 
+    "committee_id": "NCC000073", 
+    "chamber": "upper", 
+    "state": "nc", 
+    "subcommittee": null, 
+    "committee": "Finance", 
+    "position": "member", 
+    "type": "committee member"
+   }, 
+   {
+    "term": "2013-2014", 
+    "committee_id": "NCC000012", 
+    "chamber": "upper", 
+    "state": "nc", 
+    "subcommittee": null, 
+    "committee": "Health Care", 
+    "position": "member", 
+    "type": "committee member"
+   }, 
+   {
+    "term": "2013-2014", 
+    "committee_id": "NCC000074", 
+    "chamber": "upper", 
+    "state": "nc", 
+    "subcommittee": null, 
+    "committee": "Judiciary I", 
+    "position": "member", 
+    "type": "committee member"
+   }, 
+   {
+    "term": "2013-2014", 
+    "committee_id": "NCC000018", 
+    "chamber": "upper", 
+    "state": "nc", 
+    "subcommittee": null, 
+    "committee": "Rules and Operations of the Senate", 
+    "position": "member", 
+    "type": "committee member"
+   }
+  ], 
+  "level": "state", 
+  "url": "http://www.ncga.state.nc.us/gascripts/members/viewMember.pl?sChamber=Senate&nUserID=267", 
+  "created_at": "2010-08-03 17:14:46", 
+  "nimsp_id": "9383", 
+  "chamber": "upper", 
+  "offices": [
+   {
+    "fax": null, 
+    "name": "Capitol Office", 
+    "phone": "(919) 715-6400", 
+    "address": "NC Senate\n16 W. Jones Street, Room 1113\n\nRaleigh, NC 27601-2808", 
+    "type": "capitol", 
+    "email": null
+   }
+  ], 
+  "suffixes": ""
+ }, 
+ {
+  "last_name": "Hall", 
+  "updated_at": "2013-03-27 02:35:42", 
+  "sources": [
+   {
+    "url": "http://www.ncga.state.nc.us/gascripts/members/viewMember.pl?sChamber=House&nUserID=679"
+   }
+  ], 
+  "full_name": "Duane Hall", 
+  "id": "NCL000282", 
+  "first_name": "Duane", 
+  "middle_name": "", 
+  "district": "11", 
+  "state": "nc", 
+  "party": "Democratic", 
+  "email": "Duane.Hall@ncleg.net", 
+  "leg_id": "NCL000282", 
+  "boundary_id": "sldl/nc-11", 
+  "+notice": null, 
+  "transparencydata_id": "07eff70ee51441d093b33667a2a6f877", 
+  "active": true, 
+  "photo_url": "http://www.ncga.state.nc.us/House/pictures/hiRes/679.jpg", 
+  "roles": [
+   {
+    "term": "2013-2014", 
+    "end_date": null, 
+    "district": "11", 
+    "chamber": "lower", 
+    "state": "nc", 
+    "party": "Democratic", 
+    "type": "member", 
+    "start_date": null
+   }, 
+   {
+    "term": "2013-2014", 
+    "committee_id": "NCC000028", 
+    "chamber": "lower", 
+    "state": "nc", 
+    "subcommittee": null, 
+    "committee": "Appropriations", 
+    "position": "member", 
+    "type": "committee member"
+   }, 
+   {
+    "term": "2013-2014", 
+    "committee_id": "NCC000035", 
+    "chamber": "lower", 
+    "state": "nc", 
+    "subcommittee": null, 
+    "committee": "Appropriations Subcommittee on Transportation", 
+    "position": "member", 
+    "type": "committee member"
+   }, 
+   {
+    "term": "2013-2014", 
+    "committee_id": "NCC000082", 
+    "chamber": "lower", 
+    "state": "nc", 
+    "subcommittee": null, 
+    "committee": "Commerce and Job Development", 
+    "position": "member", 
+    "type": "committee member"
+   }, 
+   {
+    "term": "2013-2014", 
+    "committee_id": "NCC000178", 
+    "chamber": "lower", 
+    "state": "nc", 
+    "subcommittee": null, 
+    "committee": "Commerce and Job Development Subcommittee on Alcoholic Beverage Control", 
+    "position": "member", 
+    "type": "committee member"
+   }, 
+   {
+    "term": "2013-2014", 
+    "committee_id": "NCC000168", 
+    "chamber": "lower", 
+    "state": "nc", 
+    "subcommittee": null, 
+    "committee": "Elections", 
+    "position": "member", 
+    "type": "committee member"
+   }, 
+   {
+    "term": "2013-2014", 
+    "committee_id": "NCC000088", 
+    "chamber": "lower", 
+    "state": "nc", 
+    "subcommittee": null, 
+    "committee": "Government", 
+    "position": "member", 
+    "type": "committee member"
+   }, 
+   {
+    "term": "2013-2014", 
+    "committee_id": "NCC000107", 
+    "chamber": "lower", 
+    "state": "nc", 
+    "subcommittee": null, 
+    "committee": "Homeland Security, Military, and Veterans Affairs", 
+    "position": "member", 
+    "type": "committee member"
+   }, 
+   {
+    "term": "2013-2014", 
+    "committee_id": "NCC000172", 
+    "chamber": "lower", 
+    "state": "nc", 
+    "subcommittee": null, 
+    "committee": "Public Utilities and Energy", 
+    "position": "member", 
+    "type": "committee member"
+   }
+  ], 
+  "url": "http://www.ncga.state.nc.us/gascripts/members/viewMember.pl?sChamber=House&nUserID=679", 
+  "created_at": "2013-01-03 19:15:14", 
+  "chamber": "lower", 
+  "offices": [
+   {
+    "fax": null, 
+    "name": "Capitol Office", 
+    "phone": "919-733-5755", 
+    "address": "NC House of Representatives\n16 W. Jones Street, Room 1019\n\nRaleigh, NC 27601-1096", 
+    "type": "capitol", 
+    "email": null
+   }
+  ], 
+  "suffixes": ""
+ }
+]
+ +
+
+ + + + \ No newline at end of file diff --git a/metadata.html b/metadata.html new file mode 100644 index 0000000..d1e86d6 --- /dev/null +++ b/metadata.html @@ -0,0 +1,284 @@ + + + + + + + Open States API | Metadata + + + + + + + + +
+ +
+ +

State Metadata

+

There are two methods available for access to general metadata: + +

+ + + + + + + + + + + + +
Method URL pattern Description
Metadata Overview /metadata/ Get list of all states with data available and basic metadata about their status.
State Metadata /metadata/state/ Get detailed metadata for a particular state.
+ +

Metadata Fields

+

The following fields are available on metadata objects: + +

+
    +
  • abbreviation The two-letter abbreviation of the state.
  • +
  • capitol_timezone Timezone of state capitol (e.g. 'America/New_York')
  • +
  • chambers Dictionary mapping chamber type (upper/lower) to an object with the following fields:
      +
    • name Short name of the chamber (e.g. 'House', 'Senate')
    • +
    • title Title of legislators in this chamber (e.g. 'Senator')
    • +
    +
  • +
  • feature_flags A list of which optional features are available, options include:
      +
    • 'subjects' - bills have categorized subjects
    • +
    • 'influenceexplorer' - legislators have influence explorer ids
    • +
    • 'events' - event data is present
    • +
    +
  • +
  • latest_csv_date Date that the CSV file at latest_csv_url was generated.
  • +
  • latest_csv_url URL from which a CSV dump of all data for this state can be obtained.
  • +
  • latest_json_date Date that the JSON file at latest_json_url was generated.
  • +
  • latest_json_url URL from which a JSON dump of all data for this state can be obtained.
  • +
  • latest_update Last time a successful scrape was run.
  • +
  • legislature_name Full name of legislature (e.g. 'North Carolina General Assembly')
  • +
  • legislature_url URL to legislature's official website.
  • +
  • name Name of state.
  • +
  • session_details Dictionary of session names to detail dictionaries with the following keys:
      +
    • type 'primary' or 'special'
    • +
    • display_name e.g. '2009-2010 Session'
    • +
    • start_date date session began
    • +
    • end_date date session began
    • +
    +
  • +
  • terms List of terms in order that they occurred. Each item in the list is comprised of the following keys:
      +
    • start_year Year session started.
    • +
    • end_year Year session ended.
    • +
    • name Display name for term (e.g. '2009-2011').
    • +
    • sessions List of sessions (e.g. '2009'). Each session will be present in session_details.
    • +
    +
  • +
+

Terms & Sessions

+

A common area for confusion, terms describe a period of time between legislative elections, for example '2009-2010'. A term can be comprised of one or more sessions:depending on how often the legislature met/adjourned within the term. + +

+

Terms are associated with legislators, while sessions are associated with bills. + +

+

Methods

+

Metadata Overview

+

This method returns just a subset (abbreviation, state, chambers, feature_flags) of metadata across all available entities. + +

+

Example: openstates.org/api/v1/metadata/ + + +

+

State Metadata

+

This method returns the full metadata for a state. + +

+

Example: openstates.org/api/v1/metadata/nc/ + + +

+

Examples

+

Metadata Overview

+

http://openstates.org/api/v1/metadata/ + +

+
[
+ { "name": "Alabama",
+  "abbreviation": "al",
+  "feature_flags": [ "subjects", "influenceexplorer" ],
+  "chambers": {
+   "upper": { "name": "Senate", "title": "Senator" },
+   "lower": { "name": "House", "title": "Representative" }
+  } },
+ { "name": "Alaska",
+  "abbreviation": "ak",
+  "feature_flags": [ "subjects", "influenceexplorer" ],
+  "chambers": {
+   "upper": { "name": "Senate", "title": "Senator" },
+   "lower": { "name": "House", "title": "Representative" }
+  } },
+ { "name": "Arizona",
+  "abbreviation": "az",
+  "feature_flags": [ "events", "influenceexplorer" ],
+  "chambers": {
+   "upper": { "name": "Senate", "title": "Senator" },
+   "lower": { "name": "House", "title": "Representative" }
+  } },
+ { "name": "Arkansas",
+  "abbreviation": "ar",
+  "feature_flags": [ "influenceexplorer" ],
+  "chambers": {
+   "upper": { "name": "Senate", "title": "Senator" },
+   "lower": { "name": "House", "title": "Representative" }
+  } },
+ { "name": "California",
+  "abbreviation": "ca",
+  "feature_flags": [ "subjects", "influenceexplorer" ],
+  "chambers": {
+   "upper": { "name": "Senate", "title": "Senator" },
+   "lower": { "name": "Assembly", "title": "Assemblymember" }
+  } },
+ { "name": "Colorado",
+  "abbreviation": "co",
+  "feature_flags": [ "influenceexplorer" ],
+  "chambers": {
+   "upper": { "name": "Senate", "title": "Senator" },
+   "lower": { "name": "House", "title": "Representative" }
+  } },
+ { "name": "Connecticut",
+  "abbreviation": "ct",
+  "feature_flags": [ "subjects", "events", "influenceexplorer" ],
+  "chambers": {
+   "upper": { "name": "Senate", "title": "Senator" },
+   "lower": { "name": "House", "title": "Representative" }
+  } },
+ { "name": "Delaware",
+  "abbreviation": "de",
+  "feature_flags": [ "events", "influenceexplorer" ],
+  "chambers": {
+   "upper": { "name": "Senate", "title": "Senator" },
+   "lower": { "name": "House", "title": "Representative" }
+  } },
+ { "name": "District of Columbia",
+  "abbreviation": "dc",
+  "feature_flags": [],
+  "chambers": {
+   "upper": { "name": "Council", "title": "Councilmember" }
+  } },
+  ...truncated...
+]
+

State Metadata

+

http://openstates.org/api/v1/metadata/nc/ + +

+
{
+ "abbreviation": "nc",
+ "capitol_timezone": "America/New_York",
+ "chambers": {
+  "upper": { "name": "Senate", "title": "Senator" },
+  "lower": { "name": "House", "title": "Representative" }
+ },
+ "feature_flags": [ "subjects", "influenceexplorer" ],
+ "id": "nc",
+ "latest_csv_date": "2013-03-01 09:04:45",
+ "latest_csv_url": "http://static.openstates.org/downloads/2013-03-01-nc-csv.zip",
+ "latest_json_date": "2013-03-05 23:46:34",
+ "latest_json_url": "http://static.openstates.org/downloads/2013-03-05-nc-json.zip",
+ "latest_update": "2013-03-24 01:38:51",
+ "legislature_name": "North Carolina General Assembly",
+ "legislature_url": "http://www.ncleg.net/",
+ "name": "North Carolina",
+ "session_details": {
+  "2009": { "type": "primary", "display_name": "2009-2010 Session", "start_date": "2009-01-28 00:00:00" },
+  "2011": { "type": "primary", "display_name": "2011-2012 Session", "start_date": "2011-01-26 00:00:00" },
+  "2013": { "type": "primary", "display_name": "2013-2014 Session", "start_date": "2013-01-30 00:00:00" }
+ },
+ "terms": [
+  { "end_year": 2010, "start_year": 2009, "name": "2009-2010", "sessions": [ "2009" ] },
+  { "end_year": 2012, "start_year": 2011, "name": "2011-2012", "sessions": [ "2011" ] },
+  { "end_year": 2014, "start_year": 2013, "name": "2013-2014", "sessions": [ "2013" ] }
+ ]
+}
+ +
+
+ + + + \ No newline at end of file diff --git a/source/bills.md b/source/bills.md new file mode 100644 index 0000000..62a3ff0 --- /dev/null +++ b/source/bills.md @@ -0,0 +1,463 @@ +Bills +===== + +There are two methods available for bill data: + + + + + + + + + + + + + +
Method URL pattern Description
[Bill Search](#methods/bill-search) /bills/ Search bills by (almost) any of their attributes, or full text.
[Bill Detail](#methods/bill-detail) /bills/`state`/`session`/`bill_id`/ Get full detail for bill, including any actions, votes, etc.
+ +Bill Fields +----------- + +The following fields are available on bill objects: + +* ``state`` State abbreviation. +* ``session`` Session key (see [metadata](metadata.html#metadata-fields/terms-sessions) for details). +* ``bill_id`` The official id of the bill (e.g. 'SB 27', 'A 2111') +* ``title`` The official title of the bill. +* ``alternate_titles`` List of alternate titles that the bill has had. (Often empty.) +* ``action_dates`` Dictionary of notable action dates (useful for determining status). Contains the following fields: + * ``first`` First action (only null if there are no actions). + * ``last`` Last action (only null if there are no actions). + * ``passed_lower`` Date that the bill seems to have passed the lower chamber (might be null). + * ``passed_upper`` Date that the bill seems to have passed the upper chamber (might be null). + * ``signed`` Date that the bill appears to have signed into law (might be null). +* ``actions`` List of objects representing every recorded action for the bill. Action objects have the following fields: + * ``date`` Date of action. + * ``action`` Name of action as state provides it. + * ``actor`` The chamber, person, committee, etc. responsible for this action. + * ``type`` Open States-provided action categories, see [action categorization](#TODO-add-link). +* ``chamber`` The chamber of origination ('upper' or 'lower') +* ``created_at`` The date that this object first appeared in our system. (Note: not the date of introduction, see ``action_dates`` for that information.) +* ``updated_at`` The date that this object was last updated in our system. (Note: not the last action date, see ``action_dates`` for that information.) +* ``documents`` List of associated documents, see ``versions`` for field details. +* ``id`` Open States-assigned permanent ID for this bill. +* ``scraped_subjects`` List of subject areas that the state categorized this bill under. +* ``subjects`` List of Open States-standardized bill subjects, see [subject categorization](#TODO-fix-link). +* ``sources`` List of source URLs used to compile information on this object. +* ``sponsors`` List of bill sponsors. + * ``name`` Name of sponsor as it appears on state website. + * ``leg_id`` Open States assigned legislator ID (will be null if no match was found). + * ``type`` Type of sponsor ('primary' or 'cosponsor') +* ``type`` List of [bill types](#TODO-billcategorization). +* ``versions`` Versions of the bill text. Both documents and `versions` have the following fields: + * ``url`` Official URL for this document. + * ``name`` An official name for this document. + * ``mimetype`` The mimetype for the document (e.g. 'text/html') + * ``doc_id`` An Open States-assigned id uniquely identifying this document. +* ``votes`` List of vote objects. A vote object consists of the following keys: + * ``motion`` Name of motion being voted upon (e.g. 'Passage') + * ``chamber`` Chamber vote took place in ('upper', 'lower', 'joint') + * ``date`` Date of vote. + * ``id`` Open States-assigned unique identifier for vote. + * ``state`` State abbreviation. + * ``session`` Session key (see [metadata](metadata.html#metadata-fields/terms-sessions) for details). + * ``sources`` List of source URLs used to compile information on this object. (Can be empty if vote shares sources with bill.) + * ``yes_count`` Total number of yes votes. + * ``no_count`` Total number of no votes. + * ``other_count`` Total number of 'other' votes (abstain, not present, etc.). + * ``yes_votes``, ``no_votes``, ``other_votes`` List of roll calls of each type. Each is an object consisting of two keys: + * ``name`` Name of voter as it appears on state website. + * ``leg_id`` Open States assigned legislator ID (will be null if no match was found). + +Methods +------- + +### Bill Search + +This method returns just a subset (``state``, ``chamber``, ``session``, ``subjects``, ``type``, ``id``, ``bill_id``, ``title``, ``created_at``, ``updated_at``) of the bill fields by default. + +#### Filter Parameters + +The following parameters filter the returned set of bills, at least one must be provided. + +* ``state`` Only return bills from a given state (e.g. 'nc') +* ``chamber`` Only return bills matching the provided chamber ('upper' or 'lower') +* ``bill_id`` Only return bills with a given bill_id. +* ``bill_id__in`` Accepts a pipe (|) delimited list of bill ids. +* ``q`` Only return bills matching the provided full text query. +* ``search_window`` By default all bills are searched, but if a time window is desired the following options can be passed to search_window: + * ``search_window=all`` Default, include all sessions. + * ``search_window=term`` Only bills from sessions within the current term. + * ``search_window=session`` Only bills from the current session. + * ``search_window=session:2009`` Only bills from the session named 2009. + * ``search_window=term:2009-2011`` Only bills from the sessions in the 2009-2011 session. +* ``updated_since`` Only bills updated since a provided date (provided in YYYY-MM-DD format) +* ``sponsor_id`` Only bills sponsored by a given legislator id (e.g. 'ILL000555') +* ``subject`` Only bills categorized by Open States as belonging to this subject. +* ``type`` Only bills of a given type (e.g. 'bill', 'resolution', etc.) + +#### Additional Parameters + +``sort`` Sort-order of results, defaults to 'last', options are: + +* 'first' +* 'last' +* 'signed' +* 'passed_lower' +* 'passed_upper' +* 'updated_at' +* 'created_at' + +See the above ``action_dates``, ``created_at``, and ``updated_at`` documentation for the meaning of these dates. + +The API will not return exceedingly large responses, so it may be necessary to use ``page`` and ``per_page`` to control the number of results returned: + +* ``page`` Page of results, each of size ``per_page`` (defaults to 1) +* ``per_page`` Number of results per page, is unlimited unless page is set, in which case it defaults to 50. + +**Example:** [openstates.org/api/v1/bills/?state=dc&q=taxi](#examples/bill-search) + +### Bill Detail + +This method returns the full detail object for a bill. + +**Example:** [openstates.org/api/v1/bills/ca/20092010/AB%20667/](#examples/bill-detail) + +**Note:** This method has an alternate URL form: + +* ``bills/openstates_bill_id`` - e.g. ``openstates.org/api/v1/bills/CAB00004148/`` - allows lookup by bill_id + +Examples +-------- + +### Bill Search + +``http://openstates.org/api/v1/bills/?state=dc&q=taxi`` + +```json +[ + { + "title": "\"DOC INMATE PROCESSING AND RELEASE AMENDMENT ACT OF 2012\". ", + "created_at": "2011-07-18 04:35:16", + "updated_at": "2012-09-14 03:49:38", + "chamber": "upper", + "state": "dc", + "session": "19", + "subjects": [], + "type": [ "bill" ], + "id": "DCB00001021", + "bill_id": "B 19-0428" + }, + { + "title": "\"TAXICAB SERVICE IMPROVEMENT AMENDMENT ACT OF 2012\".\r\n\r\n ", + "created_at": "2012-01-06 20:53:35", + "updated_at": "2012-12-07 20:31:54", + "chamber": "upper", + "state": "dc", + "session": "19", + "subjects": [], + "type": [ "bill" ], + "id": "DCB00001501", + "bill_id": "B 19-0630" + }, + { + "title": "\"FISCAL YEAR 2013 BUDGET SUPPORT ACT OF 2012\". ", + "created_at": "2012-03-27 02:19:29", + "updated_at": "2012-10-18 03:33:02", + "chamber": "upper", + "state": "dc", + "session": "19", + "subjects": [], + "type": [ "bill" ], + "id": "DCB00001892", + "bill_id": "B 19-0743" + }, + { + "title": "\"FISCAL YEAR 2013 BUDGET SUPPORT EMERGENCY ACT OF 2012\". ", + "created_at": "2012-06-08 02:51:47", + "updated_at": "2012-09-07 03:51:01", + "chamber": "upper", + "state": "dc", + "session": "19", + "subjects": [], + "type": [ "bill" ], + "id": "DCB00002085", + "bill_id": "B 19-0796" + }, + { + "title": "\"LEON SWAIN, JR. RECOGNITION RESOLUTION OF 2012\". ", + "created_at": "2012-04-27 02:36:38", + "updated_at": "2012-08-22 04:20:34", + "chamber": "upper", + "state": "dc", + "session": "19", + "subjects": [], + "type": [ "resolution" ], + "id": "DCB00001959", + "bill_id": "CER 19-0218" + }, + { + "title": "\"WASHINGTON CONVENTION CENTER ADVISORY COMMITTEE RECOGNITION RESOLUTION OF 2011\".", + "created_at": "2012-03-20 02:17:18", + "updated_at": "2012-08-22 04:20:34", + "chamber": "upper", + "state": "dc", + "session": "19", + "subjects": [], + "type": [ "resolution" ], + "id": "DCB00001795", + "bill_id": "CER 19-0171" + }, + { + "title": "\"WHEELCHAIR ACCESSIBLE TAXICABS PARITY AMENDMENT ACT OF 2011\".", + "created_at": "2012-01-06 20:53:35", + "updated_at": "2012-08-22 04:20:26", + "chamber": "upper", + "state": "dc", + "session": "19", + "subjects": [], + "type": [ "bill" ], + "id": "DCB00001506", + "bill_id": "B 19-0635" + }, + { + "title": "\"FISCAL YEAR 2012 BUDGET SUPPORT ACT OF 2011\".", + "created_at": "2011-04-06 01:53:14", + "updated_at": "2012-10-18 03:32:58", + "chamber": "upper", + "state": "dc", + "session": "19", + "subjects": [], + "type": [ "bill" ], + "id": "DCB00000427", + "bill_id": "B 19-0203" + }, + { + "title": "\"FISCAL YEAR 2012 BUDGET SUPPORT EMERGENCY ACT OF 2011\".\r\n ", + "created_at": "2011-06-16 04:18:55", + "updated_at": "2012-08-22 04:20:21", + "chamber": "upper", + "state": "dc", + "session": "19", + "subjects": [], + "type": [ "bill" ], + "id": "DCB00000794", + "bill_id": "B 19-0338" + }, + { + "title": "\"PROFESSIONAL TAXICAB STANDARDS AND MEDALLION ESTABLISHMENT ACT OF 2011\".", + "created_at": "2011-03-21 18:55:32", + "updated_at": "2012-08-22 04:20:17", + "chamber": "upper", + "state": "dc", + "session": "19", + "subjects": [], + "type": [ "bill" ], + "id": "DCB00000339", + "bill_id": "B 19-0172" + } +] +``` + +### Bill Detail + +``http://openstates.org/api/v1/bills/ca/20092010/AB%20667/`` + +```json +{ + "action_dates": { + "passed_upper": null, + "passed_lower": null, + "last": "2009-08-06 00:00:00", + "signed": null, + "first": "2009-02-25 00:00:00" + }, + "actions": [ + { "date": "2009-02-25 00:00:00", + "action": "Read first time. To print.", + "type": [ "bill:introduced", "bill:reading:1" ], + "actor": "lower (Desk)" }, + { "date": "2009-02-26 00:00:00", + "action": "From printer. May be heard in committee March 28.", + "type": [ "other" ], + "actor": "lower (Desk)" }, + { "date": "2009-03-23 00:00:00", + "action": "Referred to Com. on HEALTH.", + "type": [ "committee:referred" ], + "actor": "lower (Committee CX08)" }, + { "date": "2009-04-02 00:00:00", + "action": "From committee chair, with author's amendments: Amend, and re-refer to Com. on HEALTH. Read second time and amended.", + "type": [ "bill:reading:2" ], + "actor": "lower (E&E Engrossing)" }, + { "date": "2009-04-13 00:00:00", + "action": "Re-referred to Com. on HEALTH.", + "type": [ "committee:referred" ], + "actor": "lower (Committee CX08)" }, + { "date": "2009-04-15 00:00:00", + "action": "From committee: Do pass, and re-refer to Com. on B. & P. with recommendation: To Consent Calendar. Re-referred. (Ayes 19. Noes 0.) (April 14).", + "type": [ "other" ], + "actor": "lower (Committee)" }, + { "date": "2009-04-29 00:00:00", + "action": "From committee: Do pass, and re-refer to Com. on APPR. with recommendation: To Consent Calendar. Re-referred. (Ayes 10. Noes 0.) (April 28).", + "type": [ "other" ], + "actor": "lower (Committee)" }, + { "date": "2009-05-04 00:00:00", + "action": "From committee chair, with author's amendments: Amend, and re-refer to Com. on APPR. Read second time and amended.", + "type": [ "bill:reading:2" ], + "actor": "lower (E&E Engrossing)" }, + { "date": "2009-05-05 00:00:00", + "action": "Re-referred to Com. on APPR.", + "type": [ "committee:referred" ], + "actor": "lower (Committee CX25)" }, + { "date": "2009-05-14 00:00:00", + "action": "From committee: Do pass. To Consent Calendar. (May 13).", + "type": [ "other" ], + "actor": "lower" }, + { "date": "2009-05-18 00:00:00", + "action": "Read second time. To Consent Calendar.", + "type": [ "bill:reading:2" ], + "actor": "lower" }, + { "date": "2009-05-21 00:00:00", + "action": "Read third time, passed, and to Senate. (Ayes 77. Noes 0. Page 1628.)", + "type": [ "other" ], + "actor": "lower (E&E Engrossing)" }, + { "date": "2009-05-21 00:00:00", + "action": "In Senate. Read first time. To Com. on RLS. for assignment.", + "type": [ "bill:reading:1", "committee:referred" ], + "actor": "upper (Rules)" }, + { "date": "2009-06-04 00:00:00", + "action": "Referred to Com. on B., P. & E.D.", + "type": [ "committee:referred" ], + "actor": "upper (Committee CS42)" }, + { "date": "2009-06-22 00:00:00", + "action": "From committee: Do pass, and re-refer to Com. on APPR. Re-referred. (Ayes 10. Noes 0.) (June 22).", + "type": [ "other" ], + "actor": "upper (Committee)" }, + { "date": "2009-06-29 00:00:00", + "action": "From committee: Be placed on second reading file pursuant to Senate Rule 28.8.", + "type": [ "other" ], + "actor": "upper" }, + { "date": "2009-06-30 00:00:00", + "action": "Read second time. To third reading.", + "type": [ "bill:reading:2" ], + "actor": "upper" }, + { "date": "2009-07-02 00:00:00", + "action": "Ordered to Special Consent Calendar.", + "type": [ "other" ], + "actor": "upper" }, + { "date": "2009-07-09 00:00:00", + "action": "Read third time, passed, and to Assembly. (Ayes 34. Noes 0. Page 1667.)", + "type": [ "other" ], + "actor": "upper (Desk)" }, + { "date": "2009-07-09 00:00:00", + "action": "In Assembly. To enrollment.", + "type": [ "other" ], + "actor": "lower (E&E Enrollment)" }, + { "date": "2009-07-30 00:00:00", + "action": "Enrolled and to the Governor at 2:30 p.m.", + "type": [ "other" ], + "actor": "executive" }, + { "date": "2009-08-05 00:00:00", + "action": "Approved by the Governor.", + "type": [ "other" ], + "actor": "executive" }, + { "date": "2009-08-06 00:00:00", + "action": "Chaptered by Secretary of State - Chapter 119, Statutes of 2009.", + "type": [ "other" ], + "actor": "Secretary of State" } + ], + "alternate_titles": [ + "An act to amend Section 104830 of, and to add Section 104762 to, the Health and Safety Code, relating to oral health." + ], + "bill_id": "AB 667", + "chamber": "lower", + "created_at": "2010-07-09 17:28:10", + "documents": [], + "id": "CAB00004148", + "level": "state", + "scraped_subjects": [ "Topical fluoride application." ], + "session": "20092010", + "sources": [ + { "url": "http://leginfo.legislature.ca.gov/faces/billNavClient.xhtml?bill_id=200920100AB667" } + ], + "sponsors": [ + { "leg_id": "CAL000044", "type": "primary", "name": "Block" } + ], + "state": "ca", + "subjects": [], + "title": "An act to amend Section 1750.1 of the Business and Professions Code, and to amend Section 104830 of, and to add Section 104762 to, the Health and Safety Code, relating to oral health.", + "type": [ "bill", "fiscal committee" ], + "updated_at": "2012-04-06 17:17:37", + "versions": [ + { + "url": "http://leginfo.legislature.ca.gov/faces/billNavClient.xhtml?bill_id=200920100AB667", + "mimetype": "text/html", "doc_id": "CAD00040031", "name": "AB667" + } + ], + "votes": [ + { + "other_count": 6, "+threshold": "1/2", + "other_votes": [ + { "leg_id": "CAL000014", "name": "Ashburn" }, + { "leg_id": "CAL000036", "name": "Calderon" }, + { "leg_id": "CAL000010", "name": "Corbett" }, + { "leg_id": "CAL000026", "name": "Harman" }, + { "leg_id": "CAL000021", "name": "Oropeza" }, + { "leg_id": "CAL000005", "name": "Wolk" } + ], + "yes_count": 34, + "yes_votes": [ + { "leg_id": "CAL000004", "name": "Aanestad" }, + { "leg_id": "CAL000039", "name": "Alquist" }, + { "leg_id": "CAL000029", "name": "Benoit" }, + { "leg_id": "CAL000017", "name": "Cedillo" }, + { "leg_id": "CAL000011", "name": "Cogdill" }, + { "leg_id": "CAL000037", "name": "Correa" }, + { "leg_id": "CAL000001", "name": "Cox" }, + { "leg_id": "CAL000007", "name": "DeSaulnier" }, + { "leg_id": "CAL000032", "name": "Denham" }, + { "leg_id": "CAL000038", "name": "Ducheny" }, + { "leg_id": "CAL000023", "name": "Dutton" }, + { "leg_id": "CAL000033", "name": "Florez" }, + { "leg_id": "CAL000009", "name": "Hancock" }, + { "leg_id": "CAL000027", "name": "Hollingsworth" }, + { "leg_id": "CAL000022", "name": "Huff" }, + { "leg_id": "CAL000030", "name": "Kehoe" }, + { "leg_id": "CAL000003", "name": "Leno" }, + { "leg_id": "CAL000016", "name": "Liu" }, + { "leg_id": "CAL000080", "name": "Lowenthal" }, + { "leg_id": "CAL000012", "name": "Maldonado" }, + { "leg_id": null, "name": "Negrete McLeod" }, + { "leg_id": "CAL000034", "name": "Padilla" }, + { "leg_id": "CAL000018", "name": "Pavley" }, + { "leg_id": "CAL000040", "name": "Price" }, + { "leg_id": "CAL000019", "name": "Romero" }, + { "leg_id": "CAL000013", "name": "Runner" }, + { "leg_id": "CAL000031", "name": "Simitian" }, + { "leg_id": "CAL000006", "name": "Steinberg" }, + { "leg_id": "CAL000015", "name": "Strickland" }, + { "leg_id": "CAL000025", "name": "Walters" }, + { "leg_id": "CAL000002", "name": "Wiggins" }, + { "leg_id": "CAL000035", "name": "Wright" }, + { "leg_id": "CAL000028", "name": "Wyland" }, + { "leg_id": "CAL000008", "name": "Yee" } + ], + "no_count": 0, + "motion": "Special Consent #12 AB667 Block By Alquist", + "chamber": "upper", + "state": "ca", + "session": "20092010", + "sources": [], + "passed": true, + "date": "2009-07-09 16:50:00", + "vote_id": "CAV00009230", + "type": "other", + "id": "CAV00009230", + "bill_id": "CAB00004148", + "no_votes": [] + } + ] +} +``` diff --git a/source/committees.md b/source/committees.md new file mode 100644 index 0000000..0ed3151 --- /dev/null +++ b/source/committees.md @@ -0,0 +1,152 @@ +Committees +========== + +There are two methods available for committee data: + + + + + + + + + + + + + +
Method URL pattern Description
[Committee Search](#methods/committee-search) /committees/ Search committees by any of their attributes.
[Committee Detail](#methods/committee-detail) /committees/`committee_id`/ Get full detail for committee, including all members.
+ +Committee Fields +---------------- + +The following fields are available on committee objects: + +* ``id`` Open States assigned committee ID. +* ``state`` State abbreviation. +* ``chamber`` Chamber committee belongs to: 'upper', 'lower', 'joint'. +* ``committee`` Name of committee. +* ``subcommittee`` Name of subcommittee. (if null, object describes the ``committee``) +* ``parent_id`` Committee id pointing to the parent committee if this is a subcommittee. +* ``sources`` List of URLs used in gathering information for this legislator. +* ``created_at`` The date that this object first appeared in our system. +* ``updated_at`` The date that this object was last updated in our system. +* ``members`` List of member objects, each has the following keys: + * ``name`` Name of legislator as provided by state source. + * ``leg_id`` Open States-assigned legislator id. (null if no match found). + * ``role`` Member's role on the committee (e.g. 'chair', 'vice-chair', default role is 'member') + +Methods +------- + +### Committee Search + +This method allows searching by a number of fields: + +* ``committee`` +* ``subcommittee`` +* ``chamber`` +* ``state`` + +Committee objects returned by this method do not include the list of members by default. + +**Example:** [openstates.org/api/v1/committees/?state=dc](#examples/committee-search) + +### Committee Detail + +This method returns the full committee object given a committee id. + +**Example:** [openstates.org/api/v1/committees/DCC000029/](#examples/committee-detail) + +Examples +-------- + +### Committee Search + +``http://openstates.org/api/v1/committees/?state=dc`` + +```json +[ + { "level": "state", + "created_at": "2011-11-09 02:43:35", + "updated_at": "2013-03-27 03:23:42", + "parent_id": null, + "state": "dc", + "subcommittee": null, + "committee": "Finance and Revenue", + "chamber": "upper", + "id": "DCC000017" }, + { "level": "state", + "created_at": "2011-11-09 02:43:35", + "updated_at": "2013-03-06 02:18:33", + "parent_id": null, + "state": "dc", + "subcommittee": null, + "committee": "Subcommittee on Redistricting 2011", + "chamber": "upper", + "id": "DCC000025" }, + { "chamber": "upper", + "created_at": "2013-01-07 21:05:11", + "updated_at": "2013-03-27 03:23:42", + "parent_id": null, + "state": "dc", + "subcommittee": null, + "committee": "Business, Consumer and Regulatory Affairs", + "id": "DCC000029" }, + { "level": "state", + "created_at": "2011-11-09 02:43:35", + "updated_at": "2013-03-27 03:23:41", + "parent_id": null, + "state": "dc", + "subcommittee": null, + "committee": "Human Services", + "chamber": "upper", + "id": "DCC000014" }, + ...truncated... +] +``` + +### Committee Detail + +``http://openstates.org/api/v1/committees/DCC000029/`` + +```json +{ + "chamber": "upper", + "committee": "Business, Consumer and Regulatory Affairs", + "created_at": "2013-01-07 21:05:11", + "id": "DCC000029", + "members": [ + { + "leg_id": "DCL000014", + "role": "chairperson", + "name": "Vincent Orange" + }, + { + "leg_id": "DCL000020", + "role": "member", + "name": "David Grosso" + }, + { + "leg_id": "DCL000007", + "role": "member", + "name": "Jim Graham" + }, + { + "leg_id": "DCL000002", + "role": "member", + "name": "Mary M. Cheh" + }, + { + "leg_id": "DCL000010", + "role": "member", + "name": "Yvette Alexander" + } + ], + "parent_id": null, + "sources": [ { "url": "http://dccouncil.us/committees/committee-on-business-consumer-and-regulatory-affairs" } ], + "state": "dc", + "subcommittee": null, + "updated_at": "2013-03-27 03:23:42" +} +``` diff --git a/source/compile.rb b/source/compile.rb new file mode 100644 index 0000000..1980eab --- /dev/null +++ b/source/compile.rb @@ -0,0 +1,92 @@ +#!/usr/bin/env ruby + +# Before use: copy config.yml.example to config.yml, and fill in the Google Analytics key. + +# Usage: +# +# Compile all .md scripts in this directory: +# ./compile.rb +# +# Compile a particular .md script in this directory: +# ./compile.rb index +# or: +# ./compile.rb index.md + +require 'yaml' + +unless File.exist?("config.yml") + puts "Copy config.yml.example to config.yml and fill it in before running." + exit +end + +settings = YAML.load(open("config.yml")) + +name = settings['name'] +twitter = settings['twitter'] +google_analytics = settings['google_analytics'] + +header = ' + + + + +' + +footer = " + +" + +if ARGV[0] + files = [File.basename(ARGV[0], ".md")] +else + files = Dir.glob("*.md").map {|f| File.basename f, ".md"} +end + +output_dir = ".." + +files.each do |filename| + output_file = "#{output_dir}/#{filename}.html" + system "curl -X POST \ + --data-urlencode content@#{filename}.md \ + --data-urlencode name=\"#{name}\" \ + --data-urlencode twitter=#{twitter} \ + --data-urlencode google_analytics=\"#{google_analytics}\" \ + \"http://documentup.com/compiled\" > #{output_file}" + + content = File.read output_file + + # add in our own header (custom styles) + content.sub! //im, "#{header}\n" + + # add in our own footer (Google Analytics) + content.sub! "", "#{footer}\n" + + # link the main header to the index page + content.sub! "", "" + + # custom title for non-index pages + if filename != "index" + title = filename.split("_").map(&:capitalize).join " " + content.sub! "#{name}", "#{name} | #{title}" + end + + # add mention of DocumentUp to the template, since we're not hosted there + content.sub! /<\/iframe>.*?<\/div>/im, "" + + # get rid of braces around unindented (partial) JSON blocks + content.gsub!(/(){\s*\n([^\s])(.*?)}(<\/code>)/im) { [$1, $2, $3, $4].join("") } + + File.open(output_file, "w") {|file| file.write content} +end \ No newline at end of file diff --git a/source/config.yml b/source/config.yml new file mode 100644 index 0000000..08c75be --- /dev/null +++ b/source/config.yml @@ -0,0 +1,3 @@ +name: Open States API +twitter: openstates +google_analytics: na diff --git a/source/events.md b/source/events.md new file mode 100644 index 0000000..604653a --- /dev/null +++ b/source/events.md @@ -0,0 +1,285 @@ +Events +====== + +Events are not available in all states, to ensure that events are available check the ``feature_flags`` list in a states' [metadata](metadata.html). + +There are two methods available for event data: + + + + + + + + + + + + + +
Method URL pattern Description
[Event Search](#methods/event-search) /events/ Search events by state and type.
[Event Detail](#methods/event-detail) /event/`event_id`/ Get full detail for event.
+ +Event Fields +------------ + +The following fields are available on event objects: + +* ``id`` Open States assigned event ID. +* ``state`` State abbreviation. +* ``type`` [Categorized event type.](TODO- categorization link here) +* ``description`` Description of event from state source. +* ``documents`` List of related documents. +* ``location`` Location if known, as given by state (is often just a room number). +* ``when`` Time event begins. +* ``end`` End time (null if unknown). +* ``timezone`` Timezone event occurs in (e.g. 'America/Chicago'). +* ``participants`` List of participant objects, consisting of the following fields: + * ``chamber`` Chamber of participant. + * ``type`` Type of participants ('legislator', 'committee') + * ``participant`` String representation of participant (e.g. 'Housing Committee', 'Jill Smith') + * ``id`` Open States id for participant if a match was found (e.g. 'TXC000150', 'MDL000101') + * ``type`` What role this participant played (e.g. 'host', 'speaker', etc.). +* ``related_bills`` List of related bills for this event. Comprised of the following fields: + * ``type`` Type of relationship (e.g. 'consideration') + * ``description`` Description of how the bill is related given by the state. + * ``bill_id`` State's bill id (e.g. 'HB 273') + * ``id`` Open States assigned bill id (e.g. 'TXB00001234') +* ``sources`` List of URLs used in gathering information for this legislator. +* ``created_at`` The date that this object first appeared in our system. +* ``updated_at`` The date that this object was last updated in our system. + +Methods +------- + +### Event Search + +This method allows searching by a number of fields: + +* ``state`` +* ``type`` + +This method also allows specifying an alternate output format, by specifying `format=rss` or `format=ics`. + +**Example:** [openstates.org/api/v1/events/?state=ca](#examples/event-search) + +### Event Detail + +This method returns an event object given an event id. + +**Example:** [openstates.org/api/v1/events/TXE00026474/](#examples/event-detail) + +Examples +-------- + +### Event Search + +``http://openstates.org/api/v1/events/?state=tx`` + +```json +[ + { + "documents": [], + "end": null, + "description": "Special Purpose Districts", + "state": "tx", + "+agenda": "HOUSE OF REPRESENTATIVES NOTICE OF FORMAL MEETING \u00a0 COMMITTEE:\u00a0\u00a0 Special Purpose Districts\u00a0 TIME & DATE: During reading and referral of bills Thursday, March 21, 2013\u00a0 PLACE:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 3W.9\u00a0 CHAIR:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Rep. Dennis Bonnen\u00a0 \u00a0 \u00a0 Notice of this meeting was announced from the house floor.", + "created_at": "2013-03-24 08:38:18", + "when": "2013-03-21 05:00:00", + "updated_at": "2013-03-24 08:38:18", + "sources": [ + { + "url": "http://www.capitol.state.tx.us/tlodocs/83R/schedules/html/C4482013032100001.HTM" + } + ], + "participants": [ + { + "chamber": "lower", + "participant_type": "committee", + "participant": "Special Purpose Districts", + "id": "TXC000150", + "type": "host" + }, + { + "chamber": "lower", + "participant_type": "legislator", + "participant": "Rep. Dennis Bonnen", + "id": "TXL000223", + "type": "chair" + } + ], + "session": "83", + "location": "3W.9\u00a0 ", + "related_bills": [], + "timezone": "America/Chicago", + "type": "committee:meeting", + "id": "TXE00026474", + "+chamber": "lower" + }, + { + "documents": [], + "end": null, + "description": "State Affairs", + "state": "tx", + "+agenda": "HOUSE OF REPRESENTATIVES NOTICE OF FORMAL MEETING \u00a0 COMMITTEE:\u00a0\u00a0 State Affairs\u00a0 TIME & DATE: During reading and referral of bills Thursday, March 21, 2013\u00a0 PLACE:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Agricultural Museum, 1W.14\u00a0 CHAIR:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Rep. Byron Cook\u00a0 \u00a0 Notice of this meeting was announced from the House floor.", + "created_at": "2013-03-24 08:38:18", + "when": "2013-03-21 05:00:00", + "updated_at": "2013-03-24 08:38:18", + "sources": [ + { + "url": "http://www.capitol.state.tx.us/tlodocs/83R/schedules/html/C4502013032100001.HTM" + } + ], + "participants": [ + { + "chamber": "lower", + "participant_type": "committee", + "participant": "State Affairs", + "id": "TXC000022", + "type": "host" + }, + { + "chamber": "lower", + "participant_type": "legislator", + "participant": "Rep. Byron Cook", + "id": "TXL000236", + "type": "chair" + } + ], + "session": "83", + "location": "Agricultural Museum, 1W.14\u00a0 ", + "related_bills": [], + "timezone": "America/Chicago", + "type": "committee:meeting", + "id": "TXE00026476", + "+chamber": "lower" + }, + { + "documents": [], + "end": null, + "description": "Defense & Veterans' Affairs", + "type": "committee:meeting", + "created_at": "2013-03-15 07:37:08", + "related_bills": [ + { + "type": "consideration", + "description": "Bill up for discussion", + "bill_id": "HB 846", + "id": "TXB00024869" + }, + { + "type": "consideration", + "description": "Bill up for discussion", + "bill_id": "HB 1348", + "id": "TXB00025984" + }, + { + "type": "consideration", + "description": "Bill up for discussion", + "bill_id": "HB 1832", + "id": "TXB00026956" + }, + { + "type": "consideration", + "description": "Bill up for discussion", + "bill_id": "HB 1939", + "id": "TXB00027260" + }, + { + "type": "consideration", + "description": "Bill up for discussion", + "bill_id": "HB 2387", + "id": "TXB00028147" + }, + { + "type": "consideration", + "description": "Bill up for discussion", + "bill_id": "HB 2392", + "id": "TXB00028152" + }, + { + "type": "consideration", + "description": "Bill up for discussion", + "bill_id": "HB 2071", + "id": "TXB00027470" + } + ], + "when": "2013-03-21 13:00:00", + "updated_at": "2013-03-21 08:03:49", + "sources": [ + { + "url": "http://www.capitol.state.tx.us/tlodocs/83R/schedules/html/C3052013032108001.HTM" + } + ], + "state": "tx", + "session": "83", + "location": "E2.012\u00a0 ", + "participants": [ + { + "chamber": "lower", + "participant_type": "committee", + "participant": "Defense & Veterans' Affairs", + "id": "TXC000058", + "type": "host" + }, + { + "chamber": "lower", + "participant_type": "legislator", + "participant": "Rep. Jos\u00e9 Men\u00e9ndez", + "id": "TXL000312", + "type": "chair" + } + ], + "timezone": "America/Chicago", + "+agenda": "** REVISION **HOUSE OF REPRESENTATIVES NOTICE OF PUBLIC HEARING \u00a0 COMMITTEE:\u00a0\u00a0 Defense & Veterans' Affairs\u00a0 TIME & DATE: 8:00 AM, Thursday, March 21, 2013\u00a0 PLACE:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 E2.012\u00a0 CHAIR:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Rep. Jos\u00e9 Men\u00e9ndez\u00a0 \u00a0 HB 846\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Lucio III Relating to additional periods of possession of or access to a child after conclusion of a parent's military deployment. HB 1348\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Men\u00e9ndez\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Relating to the taxation of certain tangible personal property located inside a defense base development authority. HB 1832\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Miller, Rick\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Relating to granting certain local governments general zoning authority around certain military facilities; providing a penalty. HB 1939\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Orr\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Relating to a veteran's employment preference for employment with a public entity or public work of this state. HB 2387\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Men\u00e9ndez\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Relating to the taxation of certain tangible personal property located inside a defense base development authority. HB 2392\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Men\u00e9ndez\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Relating to the mental health program for veterans. \u00a0 \u00a0 Bills deleted after last posting: HB 2071 HCR 69 \u00a0 **\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 See Committee Coordinator for previous versions\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ** of the schedule, if applicable. NOTICE OF ASSISTANCE AT PUBLIC MEETINGS Persons with disabilities who plan to attend this meeting and who may need assistance, such as a sign language interpreter, are requested to contact Stacey Nicchio at (512) 463-0850, 72 hours prior to the meeting so that appropriate arrangements can be made. \u00a0 To find information about electronic witness registration for a public hearing and to create a profile to be used when registering as a witness, please visit www.house.state.tx.us/resources/. Registration must be performed the day of the meeting and within the Capitol Complex.", + "id": "TXE00026387", + "+chamber": "lower" + }, + ...truncated... +] + +``` + +### Event Detail + +``http://openstates.org/api/v1/event/TXE00026474/`` + +```json +{ + "+agenda": "HOUSE OF REPRESENTATIVES NOTICE OF FORMAL MEETING \u00a0 COMMITTEE:\u00a0\u00a0 Special Purpose Districts\u00a0 TIME & DATE: During reading and referral of bills Thursday, March 21, 2013\u00a0 PLACE:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 3W.9\u00a0 CHAIR:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Rep. Dennis Bonnen\u00a0 \u00a0 \u00a0 Notice of this meeting was announced from the house floor.", + "+chamber": "lower", + "created_at": "2013-03-24 08:38:18", + "description": "Special Purpose Districts", + "documents": [], + "end": null, + "id": "TXE00026474", + "location": "3W.9\u00a0 ", + "participants": [ + { + "chamber": "lower", + "participant_type": "committee", + "participant": "Special Purpose Districts", + "id": "TXC000150", + "type": "host" + }, + { + "chamber": "lower", + "participant_type": "legislator", + "participant": "Rep. Dennis Bonnen", + "id": "TXL000223", + "type": "chair" + } + ], + "related_bills": [], + "session": "83", + "sources": [ + { + "url": "http://www.capitol.state.tx.us/tlodocs/83R/schedules/html/C4482013032100001.HTM" + } + ], + "state": "tx", + "timezone": "America/Chicago", + "type": "committee:meeting", + "updated_at": "2013-03-24 08:38:18", + "when": "2013-03-21 05:00:00" +} +``` diff --git a/source/index.md b/source/index.md new file mode 100644 index 0000000..95fb3a7 --- /dev/null +++ b/source/index.md @@ -0,0 +1,118 @@ +Open States API +=============== + +Open States provides a JSON API for accessing state legislative information. + +Basics +------ + +* All API calls are URLs in the form ``http://openstates.org/api/v1/METHOD/`` +* Responses are [JSON](http://json.org) unless otherwise specified. +* If an error occurs the response will be a plain text error message with an appropriate HTTP error code (404 if object is not found, 401 if authentication fails, etc.). +* An API key is required to be passed as request parameter ``apikey``. A key can be obtained via http://services.sunlightlabs.com/ +* All changes to the API will be announced on the [Open States Google Group](http://groups.google.com/group/fifty-state-project/). It is recommended you subscribe if you're using the API. +* For Python users, there's an official [python-sunlight](http://python-sunlight.readthedocs.org) package available with full support. + +Data Types +---------- + +Open States provides data about six core data types. + +* [State Metadata](metadata.html#metadata-fields) - Details on what data is available, including terms, sessions, and state-specific names for things. +* [Bills](bills.html#bill-fields) - Details on bills & resolutions, including actions & votes. +* [Legislators](legislators.html#legislator-fields) - Details on legislators, including contact details. +* [Committees](committees.html#committee-fields) - Details on committees as they currently stand. +* [Events](events.html#event-fields) - Details on upcoming events such as committee meetings and hearings. +* [Districts](districts.html#district-fields) - Details on districts and their boundaries. + +Methods +------- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Method URL pattern Description
[Metadata Overview](metadata.html#methods/metadata-overview) /metadata/ Get list of all states with data available and basic metadata about their status.
[State Metadata](metadata.html#methods/state-metadata) /metadata/`state`/ Get detailed metadata for a particular state.
[Bill Search](bills.html#methods/bill-search) /bills/ Search bills by (almost) any of their attributes, or full text.
[Bill Detail](bills.html#methods/bill-detail) /bills/`state`/`session`/`bill_id`/ Get full detail for bill, including any actions, votes, etc.
[Legislator Search](legislators.html#methods/legislator-search) /legislators/ Search legislators by their attributes.
[Legislator Detail](legislators.html#methods/legislator-detail) /legislators/`leg_id`/ Get full detail for a legislator, including all roles.
[Geo Lookup](legislators.html#methods/geo-lookup) /legislators/geo/?lat=`latitude`&long=`longitude` Lookup all legislators that serve districts containing a given point.
[Committee Search](#methods/committee-search) /committees/ Search committees by any of their attributes.
[Committee Detail](#methods/committee-detail) /committees/`committee_id`/ Get full detail for committee, including all members.
[Event Search](#methods/event-search) /events/ Search events by state and type.
[Event Detail](#methods/event-detail) /event/`event_id`/ Get full detail for event.
+ +Requesting A Custom Fieldset +---------------------------- + +On essentially every method in the API it is possible to specify a custom subset of fields on an object by specifying a ``fields`` parameter. + +There are two use cases that this functionality aims to serve: + +First, if you are writing an application that loads a lot of data but only uses some of it, specifying a limited subset of fields can reduce response time and bandwidth. We've seen this approach be particuarly useful for mobile applications where bandwidth is at a premium. + +An example would be a legislator search with ``fields=first_name,last_name,leg_id`` specified. All legislator objects returned will only have the three fields that you requested. + +Second, you can actually specify a set of fields that includes fields excluded in the default response. + +For instance, if you are conducting a bill search, it typically does not include sponsors, though many sites may wish to use sponsor information without making a request for the full bill (which is typically much larger as it includes versions, votes, actions, etc.). + +A bill search that specifies ``fields=bill_id,sponsors,title,chamber`` will include the full sponsor listing in addition to the standard bill_id, title and chamber fields. + + +Extra Fields +------------ + +You may notice that the fields documented are sometimes a subset of the fields actually included in a response. + +Many times as part of our scraping process we take in data that is available for a given state and is either not available or does not have an analog in other states. Instead of artificially limiting the data we provide to the smallest common subset we make this extra data available. + +To make it clear which fields can be relied upon and which are perhaps specific to a state or subset of states we prefix non-standard fields with a ``+``. + +If you are using the API to get data for multiple states, it is best to restrict your usage to the fields documented here. If you are only interested in data for a small subset of our available states it might make sense to take a more in depth look at the API responses for the state in question to see what extra data we are able to provide. + diff --git a/source/legislators.md b/source/legislators.md new file mode 100644 index 0000000..e2abc4e --- /dev/null +++ b/source/legislators.md @@ -0,0 +1,1159 @@ +Legislators +=========== + +There are three methods available for access to legislator information: + + + + + + + + + + + + + + + + + + + + + + +
Method URL pattern Description
[Legislator Search](#methods/legislator-search) /legislators/ Search legislators by their attributes.
[Legislator Detail](#methods/legislator-detail) /legislators/`leg_id`/ Get full detail for a legislator, including all roles.
[Geo Lookup](#methods/geo-lookup) /legislators/geo/?lat=`latitude`&long=`longitude` Lookup all legislators that serve districts containing a given point.
+ + +Legislator Fields +----------------- + +The following fields are available on legislator objects: + +* ``leg_id`` Legislator's permanent Open States ID. (e.g. 'ILL000555', 'NCL000123') +* ``state`` Legislator's state. +* ``active`` Boolean value indicating whether or not the legislator is currently in office. +* ``chamber`` Chamber the legislator is currently serving in if active ('upper' or 'lower') +* ``district`` District the legislator is currently serving in if active (e.g. '7', '6A') +* ``party`` Party the legislator is currently representing if active. +* ``email`` Legislator's primary email address. +* ``full_name`` Full display name for legislator. +* ``first_name`` First name of legislator. +* ``middle_name`` Middle name of legislator. +* ``last_name`` Last name of legislator. +* ``suffixes`` Name suffixes (e.g. 'Jr.', 'III') of legislator. +* ``photo_url`` URL of an official photo of this legislator. +* ``url`` URL of an official webpage for this legislator. +* ``created_at`` The date that this object first appeared in our system. +* ``updated_at`` The date that this object was last updated in our system. +* ``transparencydata_id`` Legislator's ID on [Influence Explorer](http://data.influenceexplorer.com/api) if a match has been found. +* ``created_at`` Date at which this legislator was added to our system. +* ``updated_at`` Date at which this legislator was last updated. +* ``offices`` List of office objects representing contact details for the legislator. Comprised of the following fields: + * ``type`` 'capitol' or 'district' + * ``name`` Name of the address (e.g. 'Council Office', 'District Office') + * ``address`` Street address. + * ``phone`` Phone number. + * ``fax`` Fax number. + * ``email`` Email address. + _Any of these fields may be ``null`` if not found._ +* ``roles`` List of currently active [role objects](#legislator-fields/roles) if legislator is in office. +* ``old_roles`` Dictionary mapping term keys to lists of roles that were valid for that term. + +### Roles + +`roles` and `old_roles` are comprised of role objects. + +Role objects can have the following fields: + +* ``term`` Term key for this role. (See metadata [notes on terms and sessions](metadata.html#metadata-fields/terms-sessions) for details.) +* ``chamber`` +* ``state`` +* ``start_date`` (optional) +* ``end_date`` (optional) +* ``type`` 'member' or 'committee member' + +If the role type is 'member': + +* ``party`` +* ``district`` + +And if the type is 'committee member': + +* ``committee`` name of parent committee +* ``subcommittee`` name of subcommittee (if null, membership is just for a committee) +* ``committee_id`` Open States id for committee that legislator is a member of +* ``position`` position on committee +* ``old_roles`` +* ``sources`` List of URLs used in gathering information for this legislator. + + +Methods +------- + +### Legislator Search + +This method allows looking up a legislator by a number of parameters, the results do not include the ``roles`` or ``old_roles`` items by default. + +#### Parameters + +* ``state`` Filter by state. +* ``first_name`` Filter by first name. +* ``last_name`` Filter by last name. +* ``chamber`` Only legislators with a role in the specified chamber. +* ``active`` 'true' (default) to only include current legislators, 'false' will include all legislators +* ``term`` Only legislators that have a role in a certain term. +* ``district`` Only legislators that have represented the specified district. +* ``party`` Only legislators that have been associated with a specified party. + + +**Example:** [openstates.org/api/v1/legislators/?state=dc&chamber=upper](#examples/legislator-search) + + +### Legislator Detail + +This method returns the full detail for a legislator. + +**Example:** [openstates.org/api/v1/legislators/DCL000012/](#examples/legislator-detail) + + +### Geo Lookup + +Lookup all legislators serving districts containing a given location. + +**Example:** [openstates.org/api/v1/legislators/geo/?lat=35.79&long=-78.78](#examples/geo-lookup) + + +Examples +-------- + +### Legislator Search + +``http://openstates.org/api/v1/legislators/?state=dc&chamber=upper`` + +```json +[ + { + "first_name": "Anita", + "last_name": "Bonds", + "middle_name": "", + "district": "At-Large", + "chamber": "upper", + "url": "http://dccouncil.us/council/anita-bonds", + "created_at": "2013-01-07 21:05:06", + "updated_at": "2013-03-26 03:22:24", + "email": "abonds@dccouncil.us", + "active": true, + "state": "dc", + "offices": [ + { + "fax": "(202) 724-8099", + "name": "Council Office", + "phone": "(202) 724-8064", + "address": "1350 Pennsylvania Avenue NW, Suite 408, Washington, DC 20004", + "type": "capitol", + "email": null + } + ], + "full_name": "Anita Bonds", + "leg_id": "DCL000021", + "party": "Democratic", + "suffixes": "", + "id": "DCL000021", + "photo_url": "http://dccouncil.us/files/user_uploads/member_photos/AAA_small.jpg" + }, + { + "+fax": "(202) 724-8099", + "last_name": "Mendelson", + "updated_at": "2013-03-26 03:20:14", + "full_name": "Phil Mendelson", + "id": "DCL000005", + "first_name": "Phil", + "middle_name": "", + "district": "Chairman", + "office_address": "1350 Pennsylvania Avenue NW, Suite 402, Washington, DC 20004", + "state": "dc", + "votesmart_id": "72089", + "party": "Democratic", + "email": "pmendelson@dccouncil.us", + "leg_id": "DCL000005", + "active": true, + "photo_url": "http://dccouncil.us/files/user_uploads/member_photos/mendelson.jpg", + "level": "state", + "url": "http://dccouncil.us/council/phil-mendelson", + "created_at": "2011-02-17 22:43:55", + "chamber": "upper", + "offices": [ + { + "fax": "(202) 724-8099", + "name": "Council Office", + "phone": "(202) 724-8032 ", + "address": "1350 Pennsylvania Avenue NW, Suite 504, Washington, DC 20004", + "type": "capitol", + "email": null + } + ], + "suffixes": "", + "+phone": "(202) 724-8064 " + }, + { + "first_name": "David", + "last_name": "Grosso", + "middle_name": "", + "district": "At-Large", + "chamber": "upper", + "url": "http://dccouncil.us/council/david-grosso", + "created_at": "2013-01-07 21:05:06", + "updated_at": "2013-03-26 03:22:24", + "email": "dgrosso@dccouncil.us", + "active": true, + "state": "dc", + "offices": [ + { + "fax": "(202) 724-8071", + "name": "Council Office", + "phone": "(202) 724-8105", + "address": "1350 Pennsylvania Avenue NW, Suite 406, Washington, DC 20004", + "type": "capitol", + "email": null + } + ], + "full_name": "David Grosso", + "leg_id": "DCL000020", + "party": "Independent", + "suffixes": "", + "id": "DCL000020", + "photo_url": "http://dccouncil.us/files/user_uploads/member_photos/david_grosso_color__small.jpg" + }, + { + "+fax": "(202) 741-0911", + "last_name": "Alexander", + "updated_at": "2013-03-26 03:22:24", + "full_name": "Yvette Alexander", + "id": "DCL000010", + "first_name": "Yvette", + "middle_name": "", + "district": "Ward 7", + "office_address": "1350 Pennsylvania Avenue, Suite 400, NW Washington, DC 20004", + "state": "dc", + "votesmart_id": "72072", + "party": "Democratic", + "email": "yalexander@dccouncil.us", + "leg_id": "DCL000010", + "active": true, + "photo_url": "http://dccouncil.us/files/user_uploads/member_photos/alexander_dec2011.jpg", + "level": "state", + "url": "http://dccouncil.us/council/yvette-alexander", + "created_at": "2011-02-17 22:43:55", + "chamber": "upper", + "offices": [ + { + "fax": "(202) 741-0911", + "name": "Council Office", + "phone": "(202) 724-8068", + "address": "1350 Pennsylvania Avenue, Suite 400, NW Washington, DC 20004", + "type": "capitol", + "email": null + } + ], + "+phone": "(202) 724-8068", + "suffixes": "" + }, + { + "+fax": "(202) 724-8054", + "last_name": "Wells", + "updated_at": "2013-03-26 03:22:24", + "full_name": "Tommy Wells", + "id": "DCL000008", + "first_name": "Tommy", + "middle_name": "", + "district": "Ward 6", + "office_address": "1350 Pennsylvania Avenue, Suite 408, NW Washington, DC 20004", + "state": "dc", + "votesmart_id": "72071", + "party": "Democratic", + "email": "twells@dccouncil.us", + "leg_id": "DCL000008", + "active": true, + "photo_url": "http://dccouncil.us/files/user_uploads/member_photos/wells2.jpg", + "level": "state", + "url": "http://dccouncil.us/council/tommy-wells", + "created_at": "2011-02-17 22:43:55", + "chamber": "upper", + "offices": [ + { + "fax": "(202) 724-8054", + "name": "Council Office", + "phone": "(202) 724-8072", + "address": "1350 Pennsylvania Avenue, Suite 402, NW Washington, DC 20004", + "type": "capitol", + "email": null + } + ], + "+phone": "(202) 724-8072", + "suffixes": "" + }, + { + "+fax": "(202) 727-8210", + "last_name": "Orange", + "updated_at": "2013-03-26 03:22:24", + "full_name": "Vincent Orange", + "id": "DCL000014", + "first_name": "Vincent", + "middle_name": "", + "district": "At-Large", + "office_address": "1350 Pennsylvania Avenue NW, Suite 107, Washington, DC 20004", + "state": "dc", + "party": "Democratic", + "email": "vorange@dccouncil.us", + "leg_id": "DCL000014", + "active": true, + "photo_url": "http://dccouncil.us/files/user_uploads/member_photos/orange.jpg", + "level": "state", + "url": "http://dccouncil.us/council/vincent-orange", + "created_at": "2011-05-12 02:08:19", + "chamber": "upper", + "offices": [ + { + "fax": "(202) 727-8210", + "name": "Council Office", + "phone": "(202) 724-8174 ", + "address": "1350 Pennsylvania Avenue NW, Suite 107, Washington, DC 20004", + "type": "capitol", + "email": null + } + ], + "+phone": "(202) 724-8174 ", + "suffixes": "" + }, + { + "+fax": "(202) 741-0908", + "last_name": "Bowser", + "updated_at": "2013-03-26 03:22:24", + "full_name": "Muriel Bowser", + "id": "DCL000011", + "first_name": "Muriel", + "middle_name": "", + "district": "Ward 4", + "office_address": "1350 Pennsylvania Avenue, Suite 110, NW Washington, DC 20004", + "state": "dc", + "votesmart_id": "72064", + "party": "Democratic", + "email": "mbowser@dccouncil.us", + "leg_id": "DCL000011", + "active": true, + "photo_url": "http://dccouncil.us/files/user_uploads/member_photos/Bowser_Official_Photo_2012_small.jpg", + "level": "state", + "url": "http://dccouncil.us/council/muriel-bowser", + "created_at": "2011-02-17 22:43:55", + "chamber": "upper", + "offices": [ + { + "fax": "(202) 741-0908", + "name": "Council Office", + "phone": "(202) 724-8052", + "address": "1350 Pennsylvania Avenue, Suite 110, NW Washington, DC 20004", + "type": "capitol", + "email": null + } + ], + "suffixes": "", + "+phone": "(202) 724-8052" + }, + { + "+fax": "(202) 724-8087", + "last_name": "Catania", + "updated_at": "2013-03-26 03:22:24", + "full_name": "David Catania", + "id": "DCL000003", + "first_name": "David", + "middle_name": "", + "district": "At-Large", + "office_address": "1350 Pennsylvania Avenue NW, Suite 404, Washington, DC 20004", + "state": "dc", + "votesmart_id": "72081", + "party": "Independent", + "email": "dcatania@dccouncil.us", + "leg_id": "DCL000003", + "active": true, + "photo_url": "http://dccouncil.us/files/user_uploads/member_photos/catania.jpg", + "level": "state", + "url": "http://dccouncil.us/council/david-catania", + "created_at": "2011-02-17 22:43:55", + "chamber": "upper", + "offices": [ + { + "fax": "(202) 724-8087", + "name": "Council Office", + "phone": "(202) 724-7772 ", + "address": "1350 Pennsylvania Avenue NW, Suite 404, Washington, DC 20004", + "type": "capitol", + "email": null + } + ], + "+phone": "(202) 724-7772 ", + "suffixes": "" + }, + { + "+fax": "(202) 724-8076", + "last_name": "McDuffie", + "updated_at": "2013-03-26 03:22:24", + "full_name": "Kenyan McDuffie", + "id": "DCL000017", + "first_name": "Kenyan", + "middle_name": "", + "district": "Ward 5", + "office_address": "1350 Pennsylvania Avenue NW, Suite 410, Washington, DC 20004", + "state": "dc", + "party": "Democratic", + "email": "kmcduffie@dccouncil.us", + "leg_id": "DCL000017", + "active": true, + "photo_url": "http://dccouncil.us/files/user_uploads/member_photos/Councilmember_Kenyan_R._McDuffie_Official_Photograph_small.jpg", + "level": "state", + "url": "http://dccouncil.us/council/kenyan-mcduffie", + "created_at": "2012-05-31 02:28:23", + "chamber": "upper", + "offices": [ + { + "fax": "(202) 724-8076", + "name": "Council Office", + "phone": "(202) 724-8028 ", + "address": "1350 Pennsylvania Avenue NW, Suite 506, Washington, DC 20004", + "type": "capitol", + "email": null + } + ], + "suffixes": "", + "+phone": "(202) 724-8028 " + }, + { + "+fax": "(202) 724-8023", + "last_name": "Evans", + "updated_at": "2013-03-26 03:22:24", + "full_name": "Jack Evans", + "id": "DCL000009", + "first_name": "Jack", + "middle_name": "", + "district": "Ward 2", + "office_address": "1350 Pennsylvania Avenue, Suite 106, NW Washington, DC 20004", + "state": "dc", + "votesmart_id": "72044", + "party": "Democratic", + "email": "jevans@dccouncil.us", + "leg_id": "DCL000009", + "active": true, + "photo_url": "http://dccouncil.us/files/user_uploads/member_photos/evans.jpg", + "level": "state", + "url": "http://dccouncil.us/council/jack-evans", + "created_at": "2011-02-17 22:43:55", + "chamber": "upper", + "offices": [ + { + "fax": "(202) 724-8023", + "name": "Council Office", + "phone": "(202) 724-8058", + "address": "1350 Pennsylvania Avenue, Suite 106, NW Washington, DC 20004", + "type": "capitol", + "email": null + } + ], + "+phone": "(202) 724-8058", + "suffixes": "" + }, + { + "+fax": "(202) 724-8109", + "last_name": "Graham", + "updated_at": "2013-03-26 03:22:24", + "full_name": "Jim Graham", + "id": "DCL000007", + "first_name": "Jim", + "middle_name": "", + "district": "Ward 1", + "office_address": "1350 Pennsylvania Avenue, Suite 105, NW Washington, DC 20004", + "state": "dc", + "votesmart_id": "72038", + "party": "Democratic", + "email": "jgraham@dccouncil.us", + "leg_id": "DCL000007", + "active": true, + "photo_url": "http://dccouncil.us/files/user_uploads/member_photos/graham.jpg", + "level": "state", + "url": "http://dccouncil.us/council/jim-graham", + "created_at": "2011-02-17 22:43:55", + "chamber": "upper", + "offices": [ + { + "fax": "(202) 724-8109", + "name": "Council Office", + "phone": "(202) 724-8181", + "address": "1350 Pennsylvania Avenue, Suite 105, NW Washington, DC 20004", + "type": "capitol", + "email": null + } + ], + "+phone": "(202) 724-8181", + "suffixes": "" + }, + { + "+fax": "(202) 724-8118", + "last_name": "Cheh", + "updated_at": "2013-03-26 03:22:24", + "full_name": "Mary M Cheh", + "id": "DCL000002", + "first_name": "Mary", + "middle_name": "M", + "district": "Ward 3", + "office_address": "1350 Pennsylvania Avenue, Suite 108, NW Washington, DC 20004", + "state": "dc", + "votesmart_id": "72047", + "party": "Democratic", + "email": "mcheh@dccouncil.us", + "leg_id": "DCL000002", + "active": true, + "photo_url": "http://dccouncil.us/files/user_uploads/member_photos/cheh.jpg", + "level": "state", + "url": "http://dccouncil.us/council/mary-m.-cheh", + "created_at": "2011-02-17 22:43:55", + "chamber": "upper", + "offices": [ + { + "fax": "(202) 724-8118", + "name": "Council Office", + "phone": "(202) 724-8062", + "address": "1350 Pennsylvania Avenue, Suite 108, NW Washington, DC 20004", + "type": "capitol", + "email": null + } + ], + "+phone": "(202) 724-8062", + "suffixes": "" + }, + { + "+fax": "(202) 724-8055", + "last_name": "Barry", + "updated_at": "2013-03-26 03:22:24", + "full_name": "Marion Barry", + "id": "DCL000012", + "first_name": "Marion", + "middle_name": "", + "district": "Ward 8", + "office_address": "1350 Pennsylvania Avenue NW, Suite 102, Washington, DC 20004", + "state": "dc", + "votesmart_id": "72074", + "party": "Democratic", + "email": "mbarry@dccouncil.us", + "leg_id": "DCL000012", + "active": true, + "photo_url": "http://dccouncil.us/files/user_uploads/member_photos/barry.jpg", + "level": "state", + "url": "http://dccouncil.us/council/marion-barry", + "created_at": "2011-02-17 22:43:55", + "chamber": "upper", + "offices": [ + { + "fax": "(202) 724-8055", + "name": "Council Office", + "phone": "(202) 724-8045", + "address": "1350 Pennsylvania Avenue NW, Suite 102, Washington, DC 20004", + "type": "capitol", + "email": null + } + ], + "+phone": "(202) 724-8045", + "suffixes": "" + } +] +``` + + +### Legislator Detail + +``http://openstates.org/api/v1/legislators/DCL000012/`` + +```json +{ + "active": true, + "chamber": "upper", + "created_at": "2011-02-17 22:43:55", + "district": "Ward 8", + "email": "mbarry@dccouncil.us", + "first_name": "Marion", + "full_name": "Marion Barry", + "id": "DCL000012", + "last_name": "Barry", + "leg_id": "DCL000012", + "level": "state", + "middle_name": "", + "office_address": "1350 Pennsylvania Avenue NW, Suite 102, Washington, DC 20004", + "offices": [ + { + "fax": "(202) 724-8055", + "name": "Council Office", + "phone": "(202) 724-8045", + "address": "1350 Pennsylvania Avenue NW, Suite 102, Washington, DC 20004", + "type": "capitol", + "email": null + } + ], + "old_roles": { + "2011-2012": [ + { + "term": "2011-2012", + "end_date": null, + "district": "Ward 8", + "chamber": "upper", + "state": "dc", + "party": "Democratic", + "type": "member", + "start_date": null + }, + { + "term": "2011-2012", + "committee_id": "DCC000017", + "chamber": "upper", + "state": "dc", + "subcommittee": null, + "committee": "Finance and Revenue", + "position": "member", + "type": "committee member" + }, + { + "term": "2011-2012", + "committee_id": "DCC000027", + "chamber": "upper", + "state": "dc", + "subcommittee": null, + "committee": "Jobs and Workforce Development", + "position": "member", + "type": "committee member" + }, + { + "term": "2011-2012", + "committee_id": "DCC000021", + "chamber": "upper", + "state": "dc", + "subcommittee": null, + "committee": "the Judiciary", + "position": "member", + "type": "committee member" + }, + { + "term": "2011-2012", + "committee_id": "DCC000019", + "chamber": "upper", + "state": "dc", + "subcommittee": null, + "committee": "Aging and Community Affairs", + "position": "member", + "type": "committee member" + }, + { + "term": "2011-2012", + "committee_id": "DCC000026", + "chamber": "upper", + "state": "dc", + "subcommittee": null, + "committee": "Economic Development and Housing", + "position": "member", + "type": "committee member" + }, + { + "term": "2011-2012", + "committee_id": "DCC000014", + "chamber": "upper", + "state": "dc", + "subcommittee": null, + "committee": "Human Services", + "position": "member", + "type": "committee member" + }, + { + "term": "2011-2012", + "committee_id": "DCC000023", + "chamber": "upper", + "state": "dc", + "subcommittee": null, + "committee": "Health", + "position": "member", + "type": "committee member" + } + ] + }, + "party": "Democratic", + "photo_url": "http://dccouncil.us/files/user_uploads/member_photos/barry.jpg", + "roles": [ + { + "term": "2013-2014", + "end_date": null, + "district": "Ward 8", + "chamber": "upper", + "state": "dc", + "party": "Democratic", + "type": "member", + "start_date": null + }, + { + "term": "2013-2014", + "committee_id": "DCC000014", + "chamber": "upper", + "state": "dc", + "subcommittee": null, + "committee": "Human Services", + "position": "member", + "type": "committee member" + }, + { + "term": "2013-2014", + "committee_id": "DCC000017", + "chamber": "upper", + "state": "dc", + "subcommittee": null, + "committee": "Finance and Revenue", + "position": "member", + "type": "committee member" + }, + { + "term": "2013-2014", + "committee_id": "DCC000032", + "chamber": "upper", + "state": "dc", + "subcommittee": null, + "committee": "Education", + "position": "member", + "type": "committee member" + }, + { + "term": "2013-2014", + "committee_id": "DCC000031", + "chamber": "upper", + "state": "dc", + "subcommittee": null, + "committee": "Workforce and Community Affairs", + "position": "member", + "type": "committee member" + } + ], + "sources": [ { "url": "http://dccouncil.us/council/marion-barry" } ], + "state": "dc", + "suffixes": "", + "updated_at": "2013-03-26 03:22:24", + "url": "http://dccouncil.us/council/marion-barry", + "votesmart_id": "72074" +} +``` + +### Geo Lookup + +``http://openstates.org/api/v1/legislators/geo/?lat=35.79&long=-78.78`` + +```json +[ + { + "last_name": "Stein", + "suffix": "", + "updated_at": "2013-03-27 02:35:39", + "sources": [ { "url": "http://www.ncga.state.nc.us/gascripts/members/viewMember.pl?sChamber=Senate&nUserID=267" } ], + "full_name": "Josh Stein", + "old_roles": { + "2009-2010": [ + { + "term": "2009-2010", + "end_date": null, + "district": "16", + "level": "state", + "chamber": "upper", + "state": "nc", + "party": "Democratic", + "type": "member", + "start_date": null + }, + { + "term": "2009-2010", + "committee_id": "NCC000002", + "level": "state", + "chamber": "upper", + "state": "nc", + "subcommittee": null, + "committee": "Appropriations on Department of Transportation", + "type": "committee member" + }, + { + "term": "2009-2010", + "committee_id": "NCC000008", + "level": "state", + "chamber": "upper", + "state": "nc", + "subcommittee": null, + "committee": "Appropriations/Base Budget", + "type": "committee member" + }, + { + "term": "2009-2010", + "committee_id": "NCC000009", + "level": "state", + "chamber": "upper", + "state": "nc", + "subcommittee": null, + "committee": "Commerce", + "type": "committee member" + }, + { + "term": "2009-2010", + "committee_id": "NCC000010", + "level": "state", + "chamber": "upper", + "state": "nc", + "subcommittee": null, + "committee": "Education/Higher Education", + "type": "committee member" + }, + { + "term": "2009-2010", + "committee_id": "NCC000073", + "level": "state", + "chamber": "upper", + "state": "nc", + "subcommittee": null, + "committee": "Finance", + "type": "committee member" + }, + { + "term": "2009-2010", + "committee_id": "NCC000012", + "level": "state", + "chamber": "upper", + "state": "nc", + "subcommittee": null, + "committee": "Health Care", + "type": "committee member" + }, + { + "term": "2009-2010", + "committee_id": "NCC000074", + "level": "state", + "chamber": "upper", + "state": "nc", + "subcommittee": null, + "committee": "Judiciary I", + "type": "committee member" + }, + { + "term": "2009-2010", + "committee_id": "NCC000022", + "level": "state", + "chamber": "upper", + "state": "nc", + "subcommittee": null, + "committee": "Select Committee on Economic Recovery", + "type": "committee member" + }, + { + "term": "2009-2010", + "committee_id": "NCC000024", + "level": "state", + "chamber": "upper", + "state": "nc", + "subcommittee": null, + "committee": "Select Committee on Energy, Science and Technology", + "type": "committee member" + } + ], + "2011-2012": [ + { + "term": "2011-2012", + "end_date": null, + "district": "16", + "chamber": "upper", + "state": "nc", + "party": "Democratic", + "type": "member", + "start_date": null + }, + { + "term": "2011-2012", + "committee_id": "NCC000009", + "chamber": "upper", + "state": "nc", + "subcommittee": null, + "committee": "Commerce", + "position": "member", + "type": "committee member" + }, + { + "term": "2011-2012", + "committee_id": "NCC000100", + "chamber": "upper", + "state": "nc", + "subcommittee": null, + "committee": "Education / Higher Education", + "position": "member", + "type": "committee member" + }, + { + "term": "2011-2012", + "committee_id": "NCC000073", + "chamber": "upper", + "state": "nc", + "subcommittee": null, + "committee": "Finance", + "position": "member", + "type": "committee member" + }, + { + "term": "2011-2012", + "committee_id": "NCC000074", + "chamber": "upper", + "state": "nc", + "subcommittee": null, + "committee": "Judiciary I", + "position": "member", + "type": "committee member" + }, + { + "term": "2011-2012", + "committee_id": "NCC000018", + "chamber": "upper", + "state": "nc", + "subcommittee": null, + "committee": "Rules and Operations of the Senate", + "position": "member", + "type": "committee member" + } + ] + }, + "id": "NCL000047", + "first_name": "Josh", + "middle_name": "", + "district": "16", + "state": "nc", + "votesmart_id": "102971", + "party": "Democratic", + "email": "Josh.Stein@ncleg.net", + "leg_id": "NCL000047", + "boundary_id": "sldu/nc-16", + "active": true, + "transparencydata_id": "d3917a35b626477a9a7afaf7dbf206be", + "photo_url": "http://www.ncga.state.nc.us/Senate/pictures/hiRes/267.jpg", + "roles": [ + { + "term": "2013-2014", + "end_date": null, + "district": "16", + "chamber": "upper", + "state": "nc", + "party": "Democratic", + "type": "member", + "start_date": null + }, + { + "term": "2013-2014", + "committee_id": "NCC000009", + "chamber": "upper", + "state": "nc", + "subcommittee": null, + "committee": "Commerce", + "position": "member", + "type": "committee member" + }, + { + "term": "2013-2014", + "committee_id": "NCC000100", + "chamber": "upper", + "state": "nc", + "subcommittee": null, + "committee": "Education / Higher Education", + "position": "member", + "type": "committee member" + }, + { + "term": "2013-2014", + "committee_id": "NCC000073", + "chamber": "upper", + "state": "nc", + "subcommittee": null, + "committee": "Finance", + "position": "member", + "type": "committee member" + }, + { + "term": "2013-2014", + "committee_id": "NCC000012", + "chamber": "upper", + "state": "nc", + "subcommittee": null, + "committee": "Health Care", + "position": "member", + "type": "committee member" + }, + { + "term": "2013-2014", + "committee_id": "NCC000074", + "chamber": "upper", + "state": "nc", + "subcommittee": null, + "committee": "Judiciary I", + "position": "member", + "type": "committee member" + }, + { + "term": "2013-2014", + "committee_id": "NCC000018", + "chamber": "upper", + "state": "nc", + "subcommittee": null, + "committee": "Rules and Operations of the Senate", + "position": "member", + "type": "committee member" + } + ], + "level": "state", + "url": "http://www.ncga.state.nc.us/gascripts/members/viewMember.pl?sChamber=Senate&nUserID=267", + "created_at": "2010-08-03 17:14:46", + "nimsp_id": "9383", + "chamber": "upper", + "offices": [ + { + "fax": null, + "name": "Capitol Office", + "phone": "(919) 715-6400", + "address": "NC Senate\n16 W. Jones Street, Room 1113\n\nRaleigh, NC 27601-2808", + "type": "capitol", + "email": null + } + ], + "suffixes": "" + }, + { + "last_name": "Hall", + "updated_at": "2013-03-27 02:35:42", + "sources": [ + { + "url": "http://www.ncga.state.nc.us/gascripts/members/viewMember.pl?sChamber=House&nUserID=679" + } + ], + "full_name": "Duane Hall", + "id": "NCL000282", + "first_name": "Duane", + "middle_name": "", + "district": "11", + "state": "nc", + "party": "Democratic", + "email": "Duane.Hall@ncleg.net", + "leg_id": "NCL000282", + "boundary_id": "sldl/nc-11", + "+notice": null, + "transparencydata_id": "07eff70ee51441d093b33667a2a6f877", + "active": true, + "photo_url": "http://www.ncga.state.nc.us/House/pictures/hiRes/679.jpg", + "roles": [ + { + "term": "2013-2014", + "end_date": null, + "district": "11", + "chamber": "lower", + "state": "nc", + "party": "Democratic", + "type": "member", + "start_date": null + }, + { + "term": "2013-2014", + "committee_id": "NCC000028", + "chamber": "lower", + "state": "nc", + "subcommittee": null, + "committee": "Appropriations", + "position": "member", + "type": "committee member" + }, + { + "term": "2013-2014", + "committee_id": "NCC000035", + "chamber": "lower", + "state": "nc", + "subcommittee": null, + "committee": "Appropriations Subcommittee on Transportation", + "position": "member", + "type": "committee member" + }, + { + "term": "2013-2014", + "committee_id": "NCC000082", + "chamber": "lower", + "state": "nc", + "subcommittee": null, + "committee": "Commerce and Job Development", + "position": "member", + "type": "committee member" + }, + { + "term": "2013-2014", + "committee_id": "NCC000178", + "chamber": "lower", + "state": "nc", + "subcommittee": null, + "committee": "Commerce and Job Development Subcommittee on Alcoholic Beverage Control", + "position": "member", + "type": "committee member" + }, + { + "term": "2013-2014", + "committee_id": "NCC000168", + "chamber": "lower", + "state": "nc", + "subcommittee": null, + "committee": "Elections", + "position": "member", + "type": "committee member" + }, + { + "term": "2013-2014", + "committee_id": "NCC000088", + "chamber": "lower", + "state": "nc", + "subcommittee": null, + "committee": "Government", + "position": "member", + "type": "committee member" + }, + { + "term": "2013-2014", + "committee_id": "NCC000107", + "chamber": "lower", + "state": "nc", + "subcommittee": null, + "committee": "Homeland Security, Military, and Veterans Affairs", + "position": "member", + "type": "committee member" + }, + { + "term": "2013-2014", + "committee_id": "NCC000172", + "chamber": "lower", + "state": "nc", + "subcommittee": null, + "committee": "Public Utilities and Energy", + "position": "member", + "type": "committee member" + } + ], + "url": "http://www.ncga.state.nc.us/gascripts/members/viewMember.pl?sChamber=House&nUserID=679", + "created_at": "2013-01-03 19:15:14", + "chamber": "lower", + "offices": [ + { + "fax": null, + "name": "Capitol Office", + "phone": "919-733-5755", + "address": "NC House of Representatives\n16 W. Jones Street, Room 1019\n\nRaleigh, NC 27601-1096", + "type": "capitol", + "email": null + } + ], + "suffixes": "" + } +] +``` diff --git a/source/metadata.md b/source/metadata.md new file mode 100644 index 0000000..3a1dea1 --- /dev/null +++ b/source/metadata.md @@ -0,0 +1,184 @@ +State Metadata +============== + +There are two methods available for access to general metadata: + + + + + + + + + + + + + +
Method URL pattern Description
[Metadata Overview](#methods/metadata-overview) /metadata/ Get list of all states with data available and basic metadata about their status.
[State Metadata](#methods/state-metadata) /metadata/`state`/ Get detailed metadata for a particular state.
+ +Metadata Fields +--------------- + +The following fields are available on metadata objects: + +* ``abbreviation`` The two-letter abbreviation of the state. +* ``capitol_timezone`` Timezone of state capitol (e.g. 'America/New_York') +* ``chambers`` Dictionary mapping chamber type (upper/lower) to an object with the following fields: + * ``name`` Short name of the chamber (e.g. 'House', 'Senate') + * ``title`` Title of legislators in this chamber (e.g. 'Senator') +* ``feature_flags`` A list of which optional features are available, options include: + * 'subjects' - bills have categorized subjects + * 'influenceexplorer' - legislators have influence explorer ids + * 'events' - event data is present +* ``latest_csv_date`` Date that the CSV file at ``latest_csv_url`` was generated. +* ``latest_csv_url`` URL from which a CSV dump of all data for this state can be obtained. +* ``latest_json_date`` Date that the JSON file at ``latest_json_url`` was generated. +* ``latest_json_url`` URL from which a JSON dump of all data for this state can be obtained. +* ``latest_update`` Last time a successful scrape was run. +* ``legislature_name`` Full name of legislature (e.g. 'North Carolina General Assembly') +* ``legislature_url`` URL to legislature's official website. +* ``name`` Name of state. +* ``session_details`` Dictionary of session names to detail dictionaries with the following keys: + * ``type`` 'primary' or 'special' + * ``display_name`` e.g. '2009-2010 Session' + * ``start_date`` date session began + * ``end_date`` date session began +* ``terms`` List of terms in order that they occurred. Each item in the list is comprised of the following keys: + * ``start_year`` Year session started. + * ``end_year`` Year session ended. + * ``name`` Display name for term (e.g. '2009-2011'). + * ``sessions`` List of sessions (e.g. '2009'). Each session will be present in ``session_details``. + +### Terms & Sessions + +A common area for confusion, terms describe a period of time between legislative elections, for example '2009-2010'. A term can be comprised of one or more sessions:depending on how often the legislature met/adjourned within the term. + +Terms are associated with legislators, while sessions are associated with bills. + +Methods +------- + +### Metadata Overview + +This method returns just a subset (``abbreviation``, ``state``, ``chambers``, ``feature_flags``) of metadata across all available entities. + +**Example:** [openstates.org/api/v1/metadata/](#examples/metadata-overview) + + +### State Metadata + +This method returns the full metadata for a state. + +**Example:** [openstates.org/api/v1/metadata/nc/](#examples/state-metadata) + + +Examples +-------- + +### Metadata Overview + +``http://openstates.org/api/v1/metadata/`` + +```json +[ + { "name": "Alabama", + "abbreviation": "al", + "feature_flags": [ "subjects", "influenceexplorer" ], + "chambers": { + "upper": { "name": "Senate", "title": "Senator" }, + "lower": { "name": "House", "title": "Representative" } + } }, + { "name": "Alaska", + "abbreviation": "ak", + "feature_flags": [ "subjects", "influenceexplorer" ], + "chambers": { + "upper": { "name": "Senate", "title": "Senator" }, + "lower": { "name": "House", "title": "Representative" } + } }, + { "name": "Arizona", + "abbreviation": "az", + "feature_flags": [ "events", "influenceexplorer" ], + "chambers": { + "upper": { "name": "Senate", "title": "Senator" }, + "lower": { "name": "House", "title": "Representative" } + } }, + { "name": "Arkansas", + "abbreviation": "ar", + "feature_flags": [ "influenceexplorer" ], + "chambers": { + "upper": { "name": "Senate", "title": "Senator" }, + "lower": { "name": "House", "title": "Representative" } + } }, + { "name": "California", + "abbreviation": "ca", + "feature_flags": [ "subjects", "influenceexplorer" ], + "chambers": { + "upper": { "name": "Senate", "title": "Senator" }, + "lower": { "name": "Assembly", "title": "Assemblymember" } + } }, + { "name": "Colorado", + "abbreviation": "co", + "feature_flags": [ "influenceexplorer" ], + "chambers": { + "upper": { "name": "Senate", "title": "Senator" }, + "lower": { "name": "House", "title": "Representative" } + } }, + { "name": "Connecticut", + "abbreviation": "ct", + "feature_flags": [ "subjects", "events", "influenceexplorer" ], + "chambers": { + "upper": { "name": "Senate", "title": "Senator" }, + "lower": { "name": "House", "title": "Representative" } + } }, + { "name": "Delaware", + "abbreviation": "de", + "feature_flags": [ "events", "influenceexplorer" ], + "chambers": { + "upper": { "name": "Senate", "title": "Senator" }, + "lower": { "name": "House", "title": "Representative" } + } }, + { "name": "District of Columbia", + "abbreviation": "dc", + "feature_flags": [], + "chambers": { + "upper": { "name": "Council", "title": "Councilmember" } + } }, + ...truncated... +] +``` + +### State Metadata + +``http://openstates.org/api/v1/metadata/nc/`` + +```json +{ + "abbreviation": "nc", + "capitol_timezone": "America/New_York", + "chambers": { + "upper": { "name": "Senate", "title": "Senator" }, + "lower": { "name": "House", "title": "Representative" } + }, + "feature_flags": [ "subjects", "influenceexplorer" ], + "id": "nc", + "latest_csv_date": "2013-03-01 09:04:45", + "latest_csv_url": "http://static.openstates.org/downloads/2013-03-01-nc-csv.zip", + "latest_json_date": "2013-03-05 23:46:34", + "latest_json_url": "http://static.openstates.org/downloads/2013-03-05-nc-json.zip", + "latest_update": "2013-03-24 01:38:51", + "legislature_name": "North Carolina General Assembly", + "legislature_url": "http://www.ncleg.net/", + "name": "North Carolina", + "session_details": { + "2009": { "type": "primary", "display_name": "2009-2010 Session", "start_date": "2009-01-28 00:00:00" }, + "2011": { "type": "primary", "display_name": "2011-2012 Session", "start_date": "2011-01-26 00:00:00" }, + "2013": { "type": "primary", "display_name": "2013-2014 Session", "start_date": "2013-01-30 00:00:00" } + }, + "terms": [ + { "end_year": 2010, "start_year": 2009, "name": "2009-2010", "sessions": [ "2009" ] }, + { "end_year": 2012, "start_year": 2011, "name": "2011-2012", "sessions": [ "2011" ] }, + { "end_year": 2014, "start_year": 2013, "name": "2013-2014", "sessions": [ "2013" ] } + ] +} +```