diff --git a/.gitignore b/.gitignore index 4447b3c9..c08f9add 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -source/config.yml \ No newline at end of file +_site \ No newline at end of file diff --git a/_config.yml b/_config.yml new file mode 100644 index 00000000..ff625775 --- /dev/null +++ b/_config.yml @@ -0,0 +1,5 @@ +# fill in with google analytics key +google_analytics: UA-22821126-30 +pygments: true +server: true +auto: true \ No newline at end of file diff --git a/_layouts/page.html b/_layouts/page.html new file mode 100644 index 00000000..3722a050 --- /dev/null +++ b/_layouts/page.html @@ -0,0 +1,55 @@ + + + + + + + Sunlight Congress API | {{ page.title }} + + + + + + + + + +
+ +
+ + {{ content }} + +
+
+ + + + \ No newline at end of file diff --git a/bills.html b/bills.html deleted file mode 100644 index 6b3e1680..00000000 --- a/bills.html +++ /dev/null @@ -1,788 +0,0 @@ - - - - - - - Sunlight Congress API | Bills - - - - - - - -
- -
- -

Bills

-

Data on bills in Congress goes back to 2009, and comes from a mix of sources: - -

- -

Methods

-

All requests require a valid API key, and use the domain: - -

-
http://congress.api.sunlightfoundation.com
-

/bills

-

Filter through bills in Congress. Filter by any fields below that have a star next to them. All standard operators apply. - -

-

Bills enacted into law in the 112th Congress - -

-
/bills?congress=112&history.enacted=true
-

Active bills, ordered by recent activity -

-
/bills?history.active=true&order=last_action_at
-

Bills sponsored by Republicans that have been vetoed - -

-
/bills?sponsor.party=R&history.vetoed=true
-

Most recent private laws - -

-
/bills?enacted.law_type=private&order=history.enacted_at
-

Joint resolutions that received a vote in the House and Senate - -

-
/bills?bill_type__in=hjres|sjres&history.house_passage_result__exists=true&history.senate_passage_result__exists=true
- -

Search the full text of legislation, and other fields. - -

-

The query parameter allows wildcards, quoting for phrases, and nearby word operators (full reference) You can also retrieve highlighted excerpts, and all normal operators and filters. - -

-

This searches the bill's full text, short_title, official_title, popular_title, nicknames, summary, and keywords fields. - -

-

Laws matching "health care" - -

-
/bills/search?query="health care"&history.enacted=true
-

Bills matching "freedom of information" and words starting with "accountab" - -

-
/bills/search?query="freedom of information" accountab*
-

Bills with "transparency" and "accountability" within 5 words of each other, with excerpts - -

-
/bills/search?query="transparency accountability"~5&highlight=true
-

Fields

-

All examples below are from H.R. 3590 of the 111th Congress, the Patient Protection and Affordable Care Act (Obamacare). - -

-

Many fields are not returned unless requested. You can request specific fields with the fields parameter. See the partial responses documentation for more details. - -

-

* = can be used as a filter - -

-
"bill_id": "hr3590-111", 
-"bill_type": "hr", 
-"number": 3590, 
-"congress": 111, 
-"chamber": "house",
-"introduced_on": "2009-09-17",
-"last_action_at": "2010-03-23",
-"last_vote_at": "2010-03-22T03:48:00Z",
-"last_version_on": "2012-08-25"
-
-

* bill_id
-The unique ID for this bill. Formed from the bill_type, number, and congress. - -

-

* bill_type
-The type for this bill. For the bill "H.R. 4921", the bill_type represents the "H.R." part. Bill types can be: hr, hres, hjres, hconres, s, sres, sjres, sconres. - -

-

* number
-The number for this bill. For the bill "H.R. 4921", the number is 4921. - -

-

* congress
-The Congress in which this bill was introduced. For example, bills introduced in the "111th Congress" have a congress of 111. - -

-

* chamber
-The chamber in which the bill originated. - -

-

* introduced_on
-The date this bill was introduced. - -

-

* last_action_at
-The date or time of the most recent official action. - -

-

* last_vote_at
-The date or time of the most recent vote on this bill. - -

-

* last_version_on
-The date the last version of this bill was published. This will be set to the introduced_on date until an official version of the bill's text is published. - -

-

Titles

-
"official_title": "An act entitled The Patient Protection and Affordable Care Act.", 
-"popular_title": "Health care reform bill", 
-"short_title": "Patient Protection and Affordable Care Act",
-
-"titles": [
-  {
-    "as": null, 
-    "title": "Health care reform bill", 
-    "type": "popular"
-  }, 
-  {
-    "as": "enacted", 
-    "title": "Patient Protection and Affordable Care Act", 
-    "type": "short"
-  }, 
-  {
-    "as": "amended by senate", 
-    "title": "An act entitled The Patient Protection and Affordable Care Act.", 
-    "type": "official"
-  }
-]
-
-

official_title
-The current official title of a bill. Official titles are sentences. Always present. Assigned at introduction, and can be revised any time. - -

-

short_title
-The current shorter, catchier title of a bill. About half of bills get these, and they can be assigned any time. - -

-

popular_title
-The current popular handle of a bill, as denoted by the Library of Congress. They are rare, and are assigned by the LOC for particularly ubiquitous bills. They are non-capitalized descriptive phrases. They can be assigned any time. - -

-

titles
-A list of all titles ever assigned to this bill, with accompanying data. - -

-

titles.as
-The state the bill was in when assigned this title. - -

-

titles.title
-The title given to the bill. - -

-

titles.type
-The type of title this is. "official", "short", or "popular". - -

-

Nicknames

-
"nicknames": [
-  "obamacare",
-  "ppaca"
-]
-
-

* nicknames
-An array of common nicknames for a bill that don't appear in official data. These nicknames are sourced from a public dataset at unitedstates/bill-nicknames, and will only appear for a tiny fraction of bills. In the future, we plan to auto-generate acronyms from bill titles and add them to this array. - -

-

Summary and keywords

-
"subjects": [
-  "Abortion", 
-  "Administrative law and regulatory procedures", 
-  "Adoption and foster care",
-  ...
-], 
-
-"summary": "Patient Protection and Affordable Care Act - Title I: Quality, Affordable Health Care for All Americans...",
-
-"summary_short": "Patient Protection and Affordable Care Act - Title I: Quality, Affordable Health Care for All Americans..."
-
-

* keywords
-A list of official keywords and phrases assigned by the Library of Congress. These keywords can be used to group bills into tags or topics, but there are many of them (1,023 unique keywords since 2009, as of late 2012), and they are not grouped into a hierarchy. They can be assigned or revised at any time after introduction. - -

-

summary
-An official summary written and assigned at some point after introduction by the Library of Congress. These summaries are generally more accessible than the text of the bill, but can still be technical. The LOC does not write summaries for all bills, and when they do can assign and revise them at any time. - -

-

summary_short
-The official summary, but capped to 1,000 characters (and an ellipse). Useful when you want to show only the first part of a bill's summary, but don't want to download a potentially large amount of text. - -

-

URLs

-
"urls": {
-  "congress" :"http://beta.congress.gov/bill/111th/house-bill/3590",
-  "govtrack" :"http://www.govtrack.us/congress/bills/111/hr3590",
-  "opencongress" :"http://www.opencongress.org/bill/111-h3590/show"
-}
-
-

urls -An object with URLs for this bill's landing page on Congress.gov, GovTrack.us, and OpenCongress.org. - -

-

History

-
"history": {
-  "active": true,
-  "active_at": "2009-10-07T18:35:00Z",
-  "house_passage_result": "pass", 
-  "house_passage_result_at": "2010-03-22T02:48:00Z", 
-  "senate_cloture_result": "pass",
-  "senate_cloture_result_at": "2009-12-23",
-  "senate_passage_result": "pass", 
-  "senate_passage_result_at": "2009-12-24", 
-  "vetoed": false,
-  "awaiting_signature": false, 
-  "enacted": true, 
-  "enacted_at": "2010-03-23"
-}
-
-

The history field includes useful flags and dates/times in a bill's life. The above is a real-life example of H.R. 3590 - not all fields will be present for every bill. - -

-

Time fields can hold either dates or times - Congress is inconsistent about providing specific timestamps. - -

-

* history.active
-Whether this bill has had any action beyond the standard action all bills get (introduction, referral to committee, sponsors' introductory remarks). Only a small percentage of bills get this additional activity. - -

-

* history.active_at
-If this bill got any action beyond initial introduction, the date or time of the first such action. This field will stay constant even as further action occurs. For the time of the most recent action, look to the last_action_at field. - -

-

* history.house_passage_result
-The result of the last time the House voted on passage. Only present if this vote occurred. "pass" or "fail". - -

-

* history.house_passage_result_at
-The date or time the House last voted on passage. Only present if this vote occurred. - -

-

* history.senate_cloture_result
-The result of the last time the Senate voted on cloture. Only present if this vote occurred. "pass" or "fail". - -

-

* history.senate_cloture_result_at
-The date or time the Senate last voted on cloture. Only present if this vote occurred. - -

-

* history.senate_passage_result
-The result of the last time the Senate voted on passage. Only present if this vote occurred. "pass" or "fail". - -

-

* history.senate_passage_result_at
-The date or time the Senate last voted on passage. Only present if this vote occurred. - -

-

* history.vetoed
-Whether the bill has been vetoed by the President. Always present. - -

-

* history.vetoed_at
-The date or time the bill was vetoed by the President. Only present if this happened. - -

-

* history.house_override_result
-The result of the last time the House voted to override a veto. Only present if this vote occurred. "pass" or "fail". - -

-

* history.house_override_result_at
-The date or time the House last voted to override a veto. Only present if this vote occurred. - -

-

* history.senate_override_result
-The result of the last time the Senate voted to override a veto. Only present if this vote occurred. "pass" or "fail". - -

-

* history.senate_override_result_at
-The date or time the Senate last voted to override a veto. Only present if this vote occurred. - -

-

* history.awaiting_signature
-Whether the bill is currently awaiting the President's signature. Always present. - -

-

* history.awaiting_signature_since
-The date or time the bill began awaiting the President's signature. Only present if this happened. - -

-

* history.enacted
-Whether the bill has been enacted into law. Always present. - -

-

* history.enacted_at
-The date or time the bill was enacted into law. Only present if this happened. - - -

-

Actions

-
"actions": [
-  {
-    "type": "vote", 
-    "acted_at": "2010-03-21T22:48:00-05:00", 
-    "chamber": "house",
-    "how": "roll", 
-    "vote_type": "pingpong", 
-    "result": "pass", 
-    "roll_id": "165", 
-    "text": "On motion that the House agree to the Senate amendments Agreed to by recorded vote: 219 - 212 (Roll no. 165).", 
-    "references": [
-      {
-        "reference": "CR H1920-2152", 
-        "type": "text as House agreed to Senate amendments"
-      }
-    ]
-  }, 
-  {
-    "type": "signed",
-    "acted_at": "2010-03-23", 
-    "text": "Signed by President.",
-    "references": []
-  }, 
-  {
-    "type": "enacted",
-    "acted_at": "2010-03-23", 
-    "text": "Became Public Law No: 111-148.",
-    "references": []
-  }
-],
-"last_action": {
-  "type": "enacted",
-  "acted_at": "2010-03-23", 
-  "text": "Became Public Law No: 111-148.",
-  "references": []
-}
-
-

The actions field has a list of all official activity that has occurred to a bill. All fields are parsed out of non-standardized sentence text, so mistakes and omissions are possible. - -

-

actions.type
-The type of action. The default is "action", but there can be many others. Always present. - -

-

actions.acted_at
-The date or time the action occurred. Always present. - -

-

actions.text
-The official text that describes this action. Always present. - -

-

actions.references
-A list of references to the Congressional Record that this action links to. - -

-

actions.chamber
-Which chamber this action occured in. "house" or "senate". - -

-

actions.vote_type
-If the action is a vote, this is the type of vote. "vote", "vote2", "cloture", or "pingpong". - -

-

actions.how
-If the action is a vote, how the vote was taken. Can be "roll", "voice", or "Unanimous Consent". - -

-

actions.result
-If the action is a vote, the result. "pass" or "fail". - -

-

actions.roll_id
-If the action is a roll call vote, the ID of the roll call. - -

-

last_action
-The most recent action. - -

-

Votes

-
"votes": [
-  {
-    "type": "vote", 
-    "acted_at": "2010-03-21T22:48:00-05:00", 
-    "chamber": "house",
-    "how": "roll", 
-    "vote_type": "pingpong", 
-    "result": "pass", 
-    "roll_id": "165", 
-    "text": "On motion that the House agree to the Senate amendments Agreed to by recorded vote: 219 - 212 (Roll no. 165).", 
-    "references": [
-      {
-        "reference": "CR H1920-2152", 
-        "type": "text as House agreed to Senate amendments"
-      }
-    ]
-  }
-]
-
-

The votes array is identical to the actions array, but limited to actions that are votes. - - -

-

Sponsorships

-
"sponsor_id": "R000053",
-"sponsor": {
-  "bioguide_id": "R000053",
-  "in_office": true,
-  "last_name": "Rangel"
-  ...
-},
-
-"cosponsor_ids": [
-  "B000287",
-  "B001231"
-  ...
-],
-"cosponsors_count": 90,
-"cosponsors": [
-  {
-    "sponsored_at": "2009-09-17",
-    "legislator": {
-      "bioguide_id": "B000287",
-      "in_office": true,
-      "last_name": "Becerra"
-      ...
-    }
-  }, 
-  {
-    "sponsored_at": "2009-09-17",
-    "legislator": {
-      "bioguide_id":"B001231",
-      "in_office":true,
-      "last_name":"Berkley"
-      ...
-    }
-  },
-  ...
-],
-
-"withdrawn_cosponsor_ids": [],
-"withdrawn_cosponsors": [],
-"withdrawn_cosponsors_count": 0
-
-

* sponsor_id
-The bioguide ID of the bill's sponsor, if there is one. It is possible, but rare, to have bills with no sponsor. - -

-

sponsor
-An object with most simple legislator fields for the bill's sponsor, if there is one. - -

-

* cosponsor_ids
-An array of bioguide IDs for each cosponsor of the bill. Bills do not always have cosponsors. - -

-

* cosponsors_count
-The number of active cosponsors of the bill. - -

-

cosponsors.sponsored_on
-When a legislator signed on as a cosponsor of the legislation. - -

-

cosponsors.legislator
-An object with most simple legislator fields for that cosponsor. - -

-

* withdrawn_cosponsor_ids
-An array of bioguide IDs for each legislator who has withdrawn their cosponsorship of the bill. - -

-

* withdrawn_cosponsors_count
-The number of withdrawn cosponsors of the bill. - -

-

withdrawn_cosponsors.withdrawn_on
-The date the legislator withdrew their cosponsorship of the bill. - -

-

withdrawn_cosponsors.sponsored_on
-The date the legislator originally cosponsored the bill. - -

-

withdrawn_cosponsors.legislator
-An object with most simple legislator fields for that withdrawn cosponsor. - -

-

Committees

-
"committee_ids": [
-  "HSWM"
-],
-"committees": [
-  {
-    "activity": [
-      "referral"
-    ],
-    "committee": {
-      "address": "1102 LHOB; Washington, DC 20515-6348",
-      "chamber": "house",
-      "committee_id": "HSWM",
-      "house_committee_id": "WM",
-      "name": "House Committee on Ways and Means",
-      "office": "1102 LHOB",
-      "phone": "(202) 225-3625",
-      "subcommittee": false
-    }
-  }
-]
-
-

* committee_ids
-A list of IDs of committees related to this bill. - -

-

committees.activity
-A list of relationships that the committee has to the bill, as they appear on THOMAS.gov. The most common is "referral", which means a committee has jurisdiction over this bill. - -

-

Related Bills

-
"related_bill_ids": [
-  "hconres254-111",
-  "hres1203-111",
-  "hr3780-111",
-  "hr4872-111",
-  "s1728-111",
-  "s1790-111"
-]
-
-

* related_bill_ids
-A list of IDs of bills that the Library of Congress has declared "related". Relations can be pretty loose, use this field with caution. - -

-

Versions

-
"versions": [
-  {
-    "version_code": "eas",
-    "issued_on": "2009-12-24",
-    "version_name": "Engrossed Amendment Senate",
-    "bill_version_id": "hr3590-111-eas",
-    "urls": {
-      "html": "http://www.gpo.gov/fdsys/pkg/BILLS-111hr3590eas/html/BILLS-111hr3590eas.htm",
-      "pdf": "http://www.gpo.gov/fdsys/pkg/BILLS-111hr3590eas/pdf/BILLS-111hr3590eas.pdf"
-    }
-  },
-  {
-    "version_code": "enr",
-    "issued_on": "2010-08-25",
-    "version_name": "Enrolled Bill",
-    "bill_version_id": "hr3590-111-enr",
-    "urls": {
-      "html": "http://www.gpo.gov/fdsys/pkg/BILLS-111hr3590enr/html/BILLS-111hr3590enr.htm",
-      "pdf": "http://www.gpo.gov/fdsys/pkg/BILLS-111hr3590enr/pdf/BILLS-111hr3590enr.pdf"
-    }
-  }
-],
-"last_version": {
-  "version_code": "enr",
-  "issued_on": "2010-08-25",
-  "version_name": "Enrolled Bill",
-  "bill_version_id": "hr3590-111-enr",
-  "urls": {
-    "html": "http://www.gpo.gov/fdsys/pkg/BILLS-111hr3590enr/html/BILLS-111hr3590enr.htm",
-    "pdf": "http://www.gpo.gov/fdsys/pkg/BILLS-111hr3590enr/pdf/BILLS-111hr3590enr.pdf"
-  }
-}
-
-

The versions field is an array of information on each version of the bill. This data is sourced from GPO, and is published on a different schedule than most other bill information. - -

-

versions.bill_version_id
-The unique ID for this bill version. It's the bill's bill_id plus the version's version_code. - -

-

versions.version_code
-The short-code for what stage the version of the bill is at. - -

-

versions.version_name
-The full name for the stage the version of the bill is at. - -

-

versions.urls
-A set of HTML, PDF, and XML links (when available) for the official permanent URL of a bill version's text. Our full text search uses the text from the HTML version of a bill. - -

-

last_version
-Information for only the most recent version of a bill. Useful to limit the size of a request with partial responses. - -

-

Upcoming Debate

-
"upcoming": [
-  {
-    "source_type": "senate_daily",
-    "url": "http://democrats.senate.gov/2013/01/21/senate-floor-schedule-for-monday-january-21-2013/",
-    "chamber": "senate",
-    "congress" :113,
-    "legislative_day": "2013-01-21",
-    "context": "The Senate stands in recess under the provisions of S.Con.Res.3.  The Senate will meet at 11:30am on Monday, January 21, 2013 for the Joint Session for the Inaugural Ceremonies."
-  }
-]
-
-

The upcoming field has an array of objects describing when a bill has been scheduled for future debate on the House or Senate floor. Its information is taken from party leadership websites in the House and Senate, and updated frequently throughout the day. - -

-

While this information is official, party leadership in both chambers have unilateral and immediate control over what is scheduled on the floor, and it can change at any time. We do our best to automatically remove entries when a bill has been yanked from the floor schedule. - -

-

upcoming.source_type
-Where this information is coming from. Currently, the only values are "senate_daily" or "house_daily". - -

-

upcoming.url
-An official reference URL for this information. - -

-

upcoming.chamber
-What chamber the bill is scheduled for debate in. - -

-

upcoming.congress
-What Congress this is occurring in. - -

-

upcoming.legislative_day
-The date the bill is scheduled for floor debate. - -

-

upcoming.context
-Some surrounding context of why the bill is scheduled. This is only present for Senate updates right now. - -

-

Becoming Law

-
"enacted_as": {
-  "congress": 111,
-  "law_type": "public",
-  "number": 148
-}
-
-

If a bill has been enacted into law, the enacted_as field contains information about the law number it was assigned. The above information is for Public Law 111-148. - -

-

* enacted_as.congress
-The Congress in which this bill was enacted into law. - -

-

* enacted_as.law_type
-Whether the law is a public or private law. Most laws are public laws; private laws affect individual citizens. "public" or "private". - -

-

* enacted_as.number
-The number the law was assigned.

- -
-
- - - - \ No newline at end of file diff --git a/source/bills.md b/bills.md similarity index 95% rename from source/bills.md rename to bills.md index 57299054..5ce52d68 100644 --- a/source/bills.md +++ b/bills.md @@ -1,3 +1,7 @@ +--- +layout: page +title: Bills +--- # Bills Data on bills in Congress goes back to 2009, and comes from a mix of sources: @@ -10,9 +14,9 @@ Data on bills in Congress goes back to 2009, and comes from a mix of sources: All requests require a valid [API key](index.html#parameters/api-key), and use the domain: -```text +{% highlight text %} http://congress.api.sunlightfoundation.com -``` +{% endhighlight %} ### /bills @@ -20,32 +24,32 @@ Filter through bills in Congress. Filter by any [fields below](#fields) that hav **Bills enacted into law in the 112th Congress** -```text +{% highlight text %} /bills?congress=112&history.enacted=true -``` +{% endhighlight %} **Active bills, ordered by recent activity** -```text +{% highlight text %} /bills?history.active=true&order=last_action_at -``` +{% endhighlight %} **Bills sponsored by Republicans that have been vetoed** -```text +{% highlight text %} /bills?sponsor.party=R&history.vetoed=true -``` +{% endhighlight %} **Most recent private laws** -```text +{% highlight text %} /bills?enacted.law_type=private&order=history.enacted_at -``` +{% endhighlight %} **Joint resolutions that received a vote in the House and Senate** -```text +{% highlight text %} /bills?bill_type__in=hjres|sjres&history.house_passage_result__exists=true&history.senate_passage_result__exists=true -``` +{% endhighlight %} ### /bills/search @@ -57,21 +61,21 @@ This searches the bill's full text, `short_title`, `official_title`, `popular_ti **Laws matching "health care"** -```text +{% highlight text %} /bills/search?query="health care"&history.enacted=true -``` +{% endhighlight %} **Bills matching "freedom of information" and words starting with "accountab"** -```text +{% highlight text %} /bills/search?query="freedom of information" accountab* -``` +{% endhighlight %} **Bills with "transparency" and "accountability" within 5 words of each other, with excerpts** -```text +{% highlight text %} /bills/search?query="transparency accountability"~5&highlight=true -``` +{% endhighlight %} ## Fields @@ -82,7 +86,7 @@ All examples below are from H.R. 3590 of the 111th Congress, the [Patient Protec \* = can be used as a filter -```json +{% highlight json %} { "bill_id": "hr3590-111", "bill_type": "hr", @@ -94,7 +98,7 @@ All examples below are from H.R. 3590 of the 111th Congress, the [Patient Protec "last_vote_at": "2010-03-22T03:48:00Z", "last_version_on": "2012-08-25" } -``` +{% endhighlight %} \* **bill_id**
The unique ID for this bill. Formed from the `bill_type`, `number`, and `congress`. @@ -125,12 +129,12 @@ The date the last version of this bill was published. This will be set to the `i ### Titles -```json +{% highlight json %} { "official_title": "An act entitled The Patient Protection and Affordable Care Act.", "popular_title": "Health care reform bill", "short_title": "Patient Protection and Affordable Care Act", - + "titles": [ { "as": null, @@ -149,8 +153,7 @@ The date the last version of this bill was published. This will be set to the `i } ] } -``` - +{% endhighlight %} **official_title**
The current official title of a bill. Official titles are sentences. Always present. Assigned at introduction, and can be revised any time. @@ -174,21 +177,21 @@ The type of title this is. "official", "short", or "popular". ### Nicknames -```json +{% highlight json %} { "nicknames": [ "obamacare", "ppaca" ] } -``` +{% endhighlight %} \* **nicknames**
An array of common nicknames for a bill that don't appear in official data. These nicknames are sourced from a public dataset at [unitedstates/bill-nicknames](https://github.com/unitedstates/bill-nicknames), and will only appear for a tiny fraction of bills. In the future, we plan to auto-generate acronyms from bill titles and add them to this array. ### Summary and keywords -```json +{% highlight json %} { "subjects": [ "Abortion", @@ -201,8 +204,7 @@ An array of common nicknames for a bill that don't appear in official data. Thes "summary_short": "Patient Protection and Affordable Care Act - Title I: Quality, Affordable Health Care for All Americans..." } -``` - +{% endhighlight %} \* **keywords**
A list of official keywords and phrases assigned by the Library of Congress. These keywords can be used to group bills into tags or topics, but there are many of them (1,023 unique keywords since 2009, as of late 2012), and they are not grouped into a hierarchy. They can be assigned or revised at any time after introduction. @@ -214,7 +216,7 @@ The official summary, but capped to 1,000 characters (and an ellipse). Useful wh ### URLs -```json +{% highlight json %} { "urls": { "congress" :"http://beta.congress.gov/bill/111th/house-bill/3590", @@ -222,14 +224,14 @@ The official summary, but capped to 1,000 characters (and an ellipse). Useful wh "opencongress" :"http://www.opencongress.org/bill/111-h3590/show" } } -``` +{% endhighlight %} **urls** An object with URLs for this bill's landing page on Congress.gov, GovTrack.us, and OpenCongress.org. ### History -```json +{% highlight json %} { "history": { "active": true, @@ -246,7 +248,7 @@ An object with URLs for this bill's landing page on Congress.gov, GovTrack.us, a "enacted_at": "2010-03-23" } } -``` +{% endhighlight %} The **history** field includes useful flags and dates/times in a bill's life. The above is a real-life example of H.R. 3590 - not all fields will be present for every bill. @@ -309,7 +311,7 @@ The date or time the bill was enacted into law. Only present if this happened. ### Actions -```json +{% highlight json %} { "actions": [ { @@ -348,7 +350,7 @@ The date or time the bill was enacted into law. Only present if this happened. "references": [] } } -``` +{% endhighlight %} The **actions** field has a list of all official activity that has occurred to a bill. All fields are parsed out of non-standardized sentence text, so mistakes and omissions are possible. @@ -384,7 +386,7 @@ The most recent action. ### Votes -```json +{% highlight json %} { "votes": [ { @@ -405,14 +407,14 @@ The most recent action. } ] } -``` +{% endhighlight %} The **votes** array is identical to the `actions` array, but limited to actions that are votes. ### Sponsorships -```json +{% highlight json %} { "sponsor_id": "R000053", "sponsor": { @@ -454,8 +456,7 @@ The **votes** array is identical to the `actions` array, but limited to actions "withdrawn_cosponsors": [], "withdrawn_cosponsors_count": 0 } -``` - +{% endhighlight %} \* **sponsor_id**
The bioguide ID of the bill's sponsor, if there is one. It is possible, but rare, to have bills with no sponsor. @@ -491,7 +492,7 @@ An object with most simple [legislator fields](legislators.html#fields) for that ### Committees -```json +{% highlight json %} { "committee_ids": [ "HSWM" @@ -514,7 +515,7 @@ An object with most simple [legislator fields](legislators.html#fields) for that } ] } -``` +{% endhighlight %} \* **committee_ids**
A list of IDs of committees related to this bill. @@ -524,7 +525,7 @@ A list of relationships that the committee has to the bill, as they appear on [T ### Related Bills -```json +{% highlight json %} { "related_bill_ids": [ "hconres254-111", @@ -535,14 +536,14 @@ A list of relationships that the committee has to the bill, as they appear on [T "s1790-111" ] } -``` +{% endhighlight %} \* **related_bill_ids**
A list of IDs of bills that the Library of Congress has declared "related". Relations can be pretty loose, use this field with caution. ### Versions -```json +{% highlight json %} { "versions": [ { @@ -577,7 +578,7 @@ A list of IDs of bills that the Library of Congress has declared "related". Rela } } } -``` +{% endhighlight %} The **versions** field is an array of information on each version of the bill. This data is sourced from [GPO](http://www.gpo.gov/fdsys/browse/collection.action?collectionCode=BILLS), and is published on a different schedule than most other bill information. @@ -598,7 +599,7 @@ Information for only the most recent version of a bill. Useful to limit the size ### Upcoming Debate -```json +{% highlight json %} { "upcoming": [ { @@ -611,7 +612,7 @@ Information for only the most recent version of a bill. Useful to limit the size } ] } -``` +{% endhighlight %} The **upcoming** field has an array of objects describing when a bill has been scheduled for future debate on the House or Senate floor. Its information is taken from party leadership websites in the [House](http://majorityleader.gov/) and [Senate](http://democrats.senate.gov/), and updated frequently throughout the day. @@ -637,7 +638,7 @@ Some surrounding context of why the bill is scheduled. This is only present for ### Becoming Law -```json +{% highlight json %} { "enacted_as": { "congress": 111, @@ -645,7 +646,7 @@ Some surrounding context of why the bill is scheduled. This is only present for "number": 148 } } -``` +{% endhighlight %} If a bill has been enacted into law, the **enacted_as** field contains information about the law number it was assigned. The above information is for [Public Law 111-148](http://www.gpo.gov/fdsys/pkg/PLAW-111publ148/content-detail.html). diff --git a/committees.html b/committees.html deleted file mode 100644 index fe2e63eb..00000000 --- a/committees.html +++ /dev/null @@ -1,224 +0,0 @@ - - - - - - - Sunlight Congress API | Committees - - - - - - - -
- -
- -

Committees

-

Names, IDs, contact info, and memberships of committees and subcommittees in the House and Senate. - -

-

All committee information is sourced from bulk data at github.com/unitedstates, which in turn comes from official House and Senate sources. - -

-

We only provide information on current committees and memberships. For historic data on committee names, IDs, and contact info, refer to the bulk data. - -

-

Methods

-

All requests require a valid API key, and use the domain: - -

-
http://congress.api.sunlightfoundation.com
-

/committees

-

Filter through committees in the House and Senate. Filter by any fields below that have a star next to them. All standard operators apply. - -

-

Committees and subcommittees a given legislator is assigned to - -

-
/committees?member_ids=L000551
-

Joint committees, excluding subcommittees - -

-
/committees?chamber=joint&subcommittee=false
-

Subcommittees of the House Ways and Means Committee - -

-
/committees?parent_committee_id=HSWM
-

Fields

-

* = can be used as a filter - -

-
"name": "House Committee on Homeland Security",
-"committee_id":"HSHM",
-"chamber":"house",
-"url": "http://homeland.house.gov/",
-"office": "H2-176 FHOB",
-"phone": "(202) 226-8417",
-"subcommittee": false,
-
-

name
-Official name of the committee. Parent committees tend to have a prefix, e.g. "House Committee on", and subcommittees do not, e.g. "Health". - -

-

* committee_id
-Official ID of the committee, as it appears in various official sources (Senate, House, and Library of Congress). - -

-

* chamber
-The chamber this committee is part of. "house", "senate", or "joint". - -

-

url
-The committee's official website. - -

-

office
-The committe's building and room number. - -

-

phone
-The committee's phone number. - -

-

* subcommittee
-Whether or not the committee is a subcommittee. - -

-

Members

-
"member_ids":[
-  "K000210",
-  "S000583"
-  ...
-],
-
-"members": [
-  {
-    "side": "majority",
-    "rank": 1,
-    "title": "Chair",
-    "legislator": {
-      "bioguide_id": "K000210",
-      "chamber": "house"
-      ...
-    }
-  }
-  ...
-]
-
-

* member_ids
-An array of bioguide IDs of legislators that are assigned to this committee. - -

-

members.side
-Whether a member is in the majority or minority of this committee. - -

-

members.rank
-The rank this member holds on the committee. Typically, this is calculated by seniority, but there can be exceptions. - -

-

members.title
-A title, if any, the member holds on the committee. "Chair" (in the House) and "Chairman" (in the Senate) signifies the chair of the committee. "Ranking Member" (in both chambers) signifies the highest ranking minority member. - -

-

Subcommittees

-
"subcommittees": [
-  {
-    "name": "Cybersecurity, Infrastructure Protection, and Security Technologies",
-    "committee_id": "HSHM08",
-    "phone": "(202) 226-8417",
-    "chamber": "house"
-  }
-  ...
-]
-
-

If the committee is a parent committee, the subcommittees field contains a few basic fields about its subcommittees. - -

-

Parent Committee

-
"parent_committee_id": "HSSM",
-"parent_committee": {
-  "committee_id": "HSSM",
-  "name": "House Committee on Small Business",
-  "chamber": "house",
-  "website": null,
-  "office": "2361 RHOB",
-  "phone":  "(202) 225-5821"
-}
-
-

* parent_committee_id
-If the committee is a subcommittee, the ID of its parent committee. - -

-

parent_committee
-If the committee is a subcommittee, some basic details

- -
-
- - - - \ No newline at end of file diff --git a/source/committees.md b/committees.md similarity index 91% rename from source/committees.md rename to committees.md index f56d6330..f360ed62 100644 --- a/source/committees.md +++ b/committees.md @@ -1,3 +1,7 @@ +--- +layout: page +title: Committees +--- # Committees Names, IDs, contact info, and memberships of committees and subcommittees in the House and Senate. @@ -10,9 +14,9 @@ We only provide information on current committees and memberships. For historic All requests require a valid [API key](index.html#parameters/api-key), and use the domain: -```text +{% highlight text %} http://congress.api.sunlightfoundation.com -``` +{% endhighlight %} ### /committees @@ -20,27 +24,27 @@ Filter through committees in the House and Senate. Filter by any [fields below]( **Committees and subcommittees a given legislator is assigned to** -```text +{% highlight text %} /committees?member_ids=L000551 -``` +{% endhighlight %} **Joint committees, excluding subcommittees** -```text +{% highlight text %} /committees?chamber=joint&subcommittee=false -``` +{% endhighlight %} **Subcommittees of the House Ways and Means Committee** -```text +{% highlight text %} /committees?parent_committee_id=HSWM -``` +{% endhighlight %} ## Fields \* = can be used as a filter -```json +{% highlight json %} { "name": "House Committee on Homeland Security", "committee_id":"HSHM", @@ -50,11 +54,10 @@ Filter through committees in the House and Senate. Filter by any [fields below]( "phone": "(202) 226-8417", "subcommittee": false, } -``` +{% endhighlight %} **name**
Official name of the committee. Parent committees tend to have a prefix, e.g. "House Committee on", and subcommittees do not, e.g. "Health". - \* **committee_id**
Official ID of the committee, as it appears in various official sources (Senate, House, and Library of Congress). @@ -75,7 +78,7 @@ Whether or not the committee is a subcommittee. ### Members -```json +{% highlight json %} { "member_ids":[ "K000210", @@ -97,8 +100,7 @@ Whether or not the committee is a subcommittee. ... ] } -``` - +{% endhighlight %} \* **member_ids**
An array of bioguide IDs of [legislators](legislators.html) that are assigned to this committee. @@ -113,7 +115,7 @@ A title, if any, the member holds on the committee. "Chair" (in the House) and " ### Subcommittees -```json +{% highlight json %} { "subcommittees": [ { @@ -125,13 +127,13 @@ A title, if any, the member holds on the committee. "Chair" (in the House) and " ... ] } -``` +{% endhighlight %} If the committee is a parent committee, the **subcommittees** field contains a few basic fields about its subcommittees. ### Parent Committee -```json +{% highlight json %} { "parent_committee_id": "HSSM", "parent_committee": { @@ -143,8 +145,7 @@ If the committee is a parent committee, the **subcommittees** field contains a f "phone": "(202) 225-5821" } } -``` - +{% endhighlight %} \* **parent_committee_id**
If the committee is a subcommittee, the ID of its parent committee. diff --git a/districts.html b/districts.html deleted file mode 100644 index 6870bc30..00000000 --- a/districts.html +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - Sunlight Congress API | Districts - - - - - - - -
- -
- -

Districts

-

Find a congressional district for a given coordinate, or for a zip code. Congressional districts are calculated based on data from the 2010 Census. - -

-

For zip code lookup, we use ZIP Code Tabulation Areas (ZCTAs), also published by the Census. - -

-

Methods

-

All requests require a valid API key, and use the domain: - -

-
http://congress.api.sunlightfoundation.com
-

/districts/locate

-

Find congressional districts by a latitude and longitude, or a zip code. There is no support for pagination, operators, ordering, or partial responses. - -

-

At-large districts, which encompass an entire state, are assigned a district number of 0. - -

-

By latitude/longitude - -

-
/districts/locate?latitude=42.96&longitude=-108.09
-

For a given latitude and longitude, this should return 1 congressional district. - -

-

By zip code - -

-
/districts/locate?zip=11216
-

A zip code may intersect multiple Congressional districts, so it is not as precise as using a latitude and longitude. - -

-

In general, we recommend against using zip codes to look up members of Congress. For one, it's imprecise: a zip code can intersect multiple congressional districts. More importantly, zip codes are not shapes. They are lines (delivery routes), and treating them as shapes leads to inaccuracies. - -

-

Fields

-
"state": "NY",
-"district": 8
-
-

state
-The two-letter state code of the state this district is in. - -

-

district
-The number of the congressional district. For "At Large" districts, where a state has only one representative, the district number is 0.

- -
-
- - - - \ No newline at end of file diff --git a/source/districts.md b/districts.md similarity index 89% rename from source/districts.md rename to districts.md index a054afbc..956bd748 100644 --- a/source/districts.md +++ b/districts.md @@ -1,3 +1,7 @@ +--- +layout: page +title: Districts +--- # Districts Find a congressional district for a given coordinate, or for a zip code. Congressional districts are calculated based on data from the [2010 Census](http://www.census.gov/rdo/data/). @@ -8,9 +12,9 @@ For zip code lookup, we use [ZIP Code Tabulation Areas](http://www.census.gov/ge All requests require a valid [API key](index.html#parameters/api-key), and use the domain: -```text +{% highlight text %} http://congress.api.sunlightfoundation.com -``` +{% endhighlight %} ### /districts/locate @@ -20,17 +24,17 @@ At-large districts, which encompass an entire state, are assigned a district num **By latitude/longitude** -```text +{% highlight text %} /districts/locate?latitude=42.96&longitude=-108.09 -``` +{% endhighlight %} For a given `latitude` and `longitude`, this should return 1 congressional district. **By zip code** -```text +{% highlight text %} /districts/locate?zip=11216 -``` +{% endhighlight %} A `zip` code may intersect multiple Congressional districts, so it is not as precise as using a `latitude` and `longitude`. @@ -38,12 +42,12 @@ In general, we [recommend against using zip codes](http://sunlightlabs.com/blog/ ## Fields -```json +{% highlight json %} { "state": "NY", "district": 8 } -``` +{% endhighlight %} **state**
The two-letter state code of the state this district is in. diff --git a/floor_updates.html b/floor_updates.html deleted file mode 100644 index a505586b..00000000 --- a/floor_updates.html +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - - Sunlight Congress API | Floor Updates - - - - - - - -
- -
- -

Floor Updates

-

Recent real time, to-the-minute updates from the House and Senate floor. House floor updates are sourced from XML at the House Clerk, and Senate updates from the Senate Periodical Press Gallery. - -

-

This endpoint focuses on the recent past. We don't automatically delete old floor updates, but we also don't guarantee non-recent data will remain available. - -

-

Methods

-

All requests require a valid API key, and use the domain: - -

-
http://congress.api.sunlightfoundation.com
-

/floor_updates

-

Search and filter through floor updates in the House and Senate. Filter by any fields below that have a star next to them. All standard operators apply. - -

-

Senate floor updates in the 113th Congress - -

-
/floor_updates?chamber=senate&congress=113
-

Floor activity on a given bill - -

-
/floor_updates?bill_ids=s968-112
-

House voice votes - -

-
/floor_updates?chamber=house&query=Agreed to by voice vote
-

The value of the query parameter will be matched against floor updates' update field. - -

-

Fields

-

* = can be used as a filter - -

-
"chamber": "house",
-"timestamp": "2013-01-04T18:34:14Z",
-"congress": 113,
-"year": 2013,
-"legislative_day": "2013-01-04",
-"update": "The House adjourned pursuant to S. Con. Res. 3. The next meeting is scheduled for 2:00 p.m. on January 14, 2013.",
-"bill_ids": [
-  "sconres3-113"
-],
-"roll_ids": [],
-"legislator_ids": []
-
-

* chamber
-The chamber this update took place in. "house" or "senate". - -

-

* timestamp
-The time this update took place. For Senate updates, this actually means the time our system first observed the update, and is susceptible to error; the Senate does not offer precise timestamps. - -

-

* congress
-The number of the Congress this update took place during. - -

-

* legislative_day
-The "legislative day" this update took place in. The "legislative day" is a formal construct that is usually, but not always, the same as the calendar day. For example, if a day's session of Congress runs past midnight, the legislative_day will often stay the same as it was before midnight, until that session adjourns. On January 3rd, it is possible that the same legislative_day could span two Congresses. (This occurred in 2013.) - -

-

* year
-The "legislative year" of the update. This is not quite the same as the calendar year - the legislative year changes at noon EST on January 3rd. A vote taken on January 1, 2013 has a "legislative year" of 2012. - -

-

update
-The text of the update. - -

-

* bill_ids
-An array of IDs of bills that are referenced by or associated with this floor update. - -

-

* roll_ids
-An array of IDs of roll call votes that are referenced by or associated with this floor update. - -

-

* legislator_ids
-An array of bioguide IDs of legislators that are referenced by this floor update.

- -
-
- - - - \ No newline at end of file diff --git a/source/floor_updates.md b/floor_updates.md similarity index 92% rename from source/floor_updates.md rename to floor_updates.md index 3f3a2159..e8dee319 100644 --- a/source/floor_updates.md +++ b/floor_updates.md @@ -1,3 +1,7 @@ +--- +layout: page +title: Floor Updates +--- # Floor Updates Recent real time, to-the-minute updates from the House and Senate floor. House floor updates are sourced from XML at the [House Clerk](http://clerk.house.gov/floorsummary/floor.aspx), and Senate updates from the [Senate Periodical Press Gallery](http://www.senate.gov/galleries/pdcl/index.htm). @@ -8,9 +12,9 @@ This endpoint focuses on the recent past. We don't automatically delete old floo All requests require a valid [API key](index.html#parameters/api-key), and use the domain: -```text +{% highlight text %} http://congress.api.sunlightfoundation.com -``` +{% endhighlight %} ### /floor_updates @@ -18,21 +22,21 @@ Search and filter through floor updates in the House and Senate. Filter by any [ **Senate floor updates in the 113th Congress** -```text +{% highlight text %} /floor_updates?chamber=senate&congress=113 -``` +{% endhighlight %} **Floor activity on a given bill** -```text +{% highlight text %} /floor_updates?bill_ids=s968-112 -``` +{% endhighlight %} **House voice votes** -```text +{% highlight text %} /floor_updates?chamber=house&query=Agreed to by voice vote -``` +{% endhighlight %} The value of the `query` parameter will be matched against floor updates' `update` field. @@ -40,7 +44,7 @@ The value of the `query` parameter will be matched against floor updates' `updat \* = can be used as a filter -```json +{% highlight json %} { "chamber": "house", "timestamp": "2013-01-04T18:34:14Z", @@ -54,7 +58,7 @@ The value of the `query` parameter will be matched against floor updates' `updat "roll_ids": [], "legislator_ids": [] } -``` +{% endhighlight %} \* **chamber**
The chamber this update took place in. "house" or "senate". diff --git a/hearings.html b/hearings.html deleted file mode 100644 index 44b96183..00000000 --- a/hearings.html +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - Sunlight Congress API | Hearings - - - - - - - -
- -
- -

Hearings

-

Committee hearings scheduled by the House and Senate. This data is taken from original House and Senate sources. - -

-

This endpoint is future-looking. We don't automatically delete data on past hearings, but we also don't guarantee non-recent data will remain available. - -

-

Methods

-

All requests require a valid API key, and use the domain: - -

-
http://congress.api.sunlightfoundation.com
-

/hearings

-

Search and filter through committee hearings in the House and Senate. Filter by any fields below that have a star next to them. All standard operators apply. - -

-

House committee hearings in DC - -

-
/hearings?chamber=house&dc=true
-

Hearings about 'children' - -

-
/hearings?query=children
-

This will search hearings' description field. - -

-

Fields

-

* = can be used as a filter - -

-
"committee_id": "HSIF",
-"occurs_at": "2013-01-22T15:00:00Z",
-"congress": 113,
-"chamber": "house",
-
-"dc": true,
-"room": "2123 Rayburn HOB",
-"description": "Hearings to examine the state of the right to vote after the 2012 election.",
-
-"bill_ids": [],
-
-"url": "http://energycommerce.house.gov/markup/committee-organizational-meeting-113th-congress",
-"hearing_type": "Hearing"
-
-

* committee_id
-The ID of the committee holding the hearing. - -

-

* occurs_at
-The time the hearing will occur. - -

-

* congress
-The number of the Congress the committee hearing is taking place during. - -

-

* chamber
-The chamber of the committee holding the hearing. "house", "senate", or "joint". - -

-

* dc
-Whether the committee hearing is held in DC (true) or in the field (false). - -

-

room
-If the hearing is in DC, the building and room number the hearing is in. If the hearing is in the field, the address of the hearing. - -

-

description
-A description of the hearing. - -

-

* bill_ids
-The IDs of any bills mentioned by or associated with the hearing. - -

-

url
-(House only) A permalink to that hearing's description on that committee's official website. - -

-

* hearing_type
-(House only) The type of hearing this is. Can be: "Hearing", "Markup", "Business Meeting", "Field Hearing". - -

-

Committee Details

-
"committee": {
-  "address": "2125 RHOB; Washington, DC 20515",
-  "chamber": "house",
-  "committee_id": "HSIF",
-  "name": "House Committee on Energy and Commerce",
-  "office": "2125 RHOB",
-  "phone": "(202) 225-2927",
-  "subcommittee" :false
-}
-
-

Basic details about the related committee will appear in the committee field.

- -
-
- - - - \ No newline at end of file diff --git a/source/hearings.md b/hearings.md similarity index 91% rename from source/hearings.md rename to hearings.md index b4d3d77d..6f3e6fa1 100644 --- a/source/hearings.md +++ b/hearings.md @@ -1,3 +1,7 @@ +--- +layout: page +title: Hearings +--- # Hearings Committee hearings scheduled by the House and Senate. This data is taken from original [House](http://house.gov/legislative/) and [Senate](http://www.senate.gov/pagelayout/committees/b_three_sections_with_teasers/committee_hearings.htm) sources. @@ -8,9 +12,9 @@ This endpoint is future-looking. We don't automatically delete data on past hear All requests require a valid [API key](index.html#parameters/api-key), and use the domain: -```text +{% highlight text %} http://congress.api.sunlightfoundation.com -``` +{% endhighlight %} ### /hearings @@ -18,15 +22,15 @@ Search and filter through committee hearings in the House and Senate. Filter by **House committee hearings in DC** -```text +{% highlight text %} /hearings?chamber=house&dc=true -``` +{% endhighlight %} **Hearings about 'children'** -```text +{% highlight text %} /hearings?query=children -``` +{% endhighlight %} This will search hearings' `description` field. @@ -34,7 +38,7 @@ This will search hearings' `description` field. \* = can be used as a filter -```json +{% highlight json %} { "committee_id": "HSIF", "occurs_at": "2013-01-22T15:00:00Z", @@ -50,8 +54,7 @@ This will search hearings' `description` field. "url": "http://energycommerce.house.gov/markup/committee-organizational-meeting-113th-congress", "hearing_type": "Hearing" } -``` - +{% endhighlight %} \* **committee_id**
The ID of the [committee](committees.html) holding the hearing. @@ -84,7 +87,7 @@ The IDs of any bills mentioned by or associated with the hearing. ### Committee Details -```json +{% highlight json %} { "committee": { "address": "2125 RHOB; Washington, DC 20515", @@ -96,6 +99,6 @@ The IDs of any bills mentioned by or associated with the hearing. "subcommittee" :false } } -``` +{% endhighlight %} Basic details about the related committee will appear in the **committee** field. \ No newline at end of file diff --git a/index.html b/index.html deleted file mode 100644 index bef36e34..00000000 --- a/index.html +++ /dev/null @@ -1,569 +0,0 @@ - - - - - - - Sunlight Congress API - - - - - - - -
- -
- -

Sunlight Congress API

-

A live JSON API for the people and work of Congress, provided by the Sunlight Foundation. - -

-

Features

-

Lots of features and data for members of Congress: - -

- -

We also provide Congress' daily work: - -

- -

All data is served in JSON, and requires a Sunlight API key. An API key is free to register and has no usage limits. - -

-

We have an API mailing list, and can be found on Twitter at @sunlightlabs. Bugs and feature requests can be made on Github Issues. - - -

-

Methods

-

Calls to the Sunlight Congress API are of the form: - -

-
http://congress.api.sunlightfoundation.com/[method]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/legislatorsCurrent legislators' names, IDs, biography, and social media.
/legislators/locateFind representatives and senators for a latitude/longitude or zip.
/districts/locateFind congressional districts for a latitude/longitude or zip.
/committeesCurrent committees, subcommittees, and their membership.
/billsLegislation in the House and Senate, back to 2009. Updated daily.
/bills/searchFull text search over legislation.
/votesRoll call votes in Congress, back to 2009. Updated within minutes of votes.
/floor_updatesTo-the-minute updates from the floor of the House and Senate.
/hearingsCommittee hearings in Congress. Updated as hearings are announced.
/upcoming_billsBills scheduled for debate in the future, as announced by party leadership.
- -

Parameters

-

API Key

-

All requests to the Congress API require a Sunlight API key. An API key is free to register and has no usage limits. - -

-

API keys can be provided with a request through the query string: - -

-
/bills?apikey=[your_api_key]
-

Or, by setting the key as the value of an X-APIKEY HTTP request header. - -

-

Filtering

-

You can filter on many fields with a simple key/value pair: - -

-
/legislators?last_name=Smith
-
/bills?bill_type=hr&congress=112
-

The API will automatically treat numbers as numbers, and "true" and "false" as booleans. Dates and times are compared as strings. - -

-

To force the API to treat a value as a string, use quotes: - -

-
/legislators?thomas_id="136"
-

See the documentation for a specific data type to see what fields can be filtered on. - -

-

Operators

-

The API supports 8 operators that can be combined with filters: - -

-

gt - the field is greater than this value
-gte - the fiels is greater than or equal to this value
-lt - the field is less than this value
-lte - the field is less than or equal to this value
-not - the field is not this value
-all - the field is an array that contains all of these values (separated by "|")
-in - the field is a string that is one of these values (separated by "|")
-nin - the field is a string that is not one of these values (separated by "|")
-exists - the field is both present and non-null (supply "true" or "false")
- -

-

All operators are applied by adding two underscores ("__") after the field name. They cannot be combined. - -

-

Senate votes that got more than 70 Yea votes - -

-
/votes?breakdown.total.Yea__gte=70&chamber=senate
-

Bills that got an up or down vote in the House - -

-
/bills?history.house_passage_result__exists=true&chamber=house
-

Bills cosponsored by both John McCain and Joe Lieberman - -

-
/bills?cosponsor_ids__all=M000303|L000304
-

Bills sponsored by either John McCain and Joe Lieberman - -

-
/bills?sponsor_id__in=M000303|L000304
-

Pagination

-

All results in the Congress API are paginated. Set per_page and page to control the page size and offset. The maximum per_page is 50. - -

-
/floor_updates?chamber=house&per_page=50&page=3
-

At the top-level of every response are count and page fields, with pagination information. - -

-
"count": 163,
-"page": {
-  "per_page": 50,
-  "page": 3,
-  "count": 50
-}
-
-

count
-The total number of documents that match the query. - -

-

page.per_page
-The per_page value used to find the response. Defaults to 20. - -

-

page.page
-The page value used to find the response. Defaults to 1. - -

-

page.count
-The number of actual documents in the response. Can be less than the given per_page if there are too few documents. - -

-

Sorting

-

Sort results by one or more fields with the order parameter. order is optional, but if no order is provided, the order of results is not guaranteed to be predictable. - -

-

Append __asc or __desc to the field names to control sort direction. The default direction is desc, because it is expected most queries will sort by a date. - -

-

Any field which can be used for filtering may be used for sorting. On full-text search endpoints (URLs ending in /search), you may sort by score to order by relevancy. - -

-

Most recent bills - -

-
/bills?order=introduced_on
-

Legislators from each state, sorted by last name within state - -

-
/legislators?order=state__asc,last_name__asc
-

Most relevant bills matching "health care" - -

-
/bills/search?query="health care"&order=score
-

Partial responses

-

You can request specific fields by supplying a comma-separated list of fields as the fields parameter. - -

-

Many fields are not returned unless requested. If you don't supply a fields parameter, you will get the most commonly used subset of fields only. - -

-

To save on bandwidth, parsing time, and confusion, it's recommended to always specify which fields you will be using. - -

-

Latest vote numbers and their results - -

-
/votes?fields=roll_id,result,breakdown.total
-
"results": [
-  {
-    "breakdown": {
-      "total": {
-        "Yea": 222,
-        "Nay": 190,
-        "Not Voting": 19,
-        "Present": 0
-      }
-    },
-    "result": "Passed",
-    "roll_id": "h43-2013"
-  },
-  {
-    "breakdown": {
-      "total": {
-        "Yea": 261,
-        "Nay": 154,
-        "Not Voting": 16,
-        "Present": 0
-      }
-    },
-    "result": "Passed",
-    "roll_id": "h44-2013"
-  }
-  ...
-]
-
-

JSONP

-

Provide a callback parameter to wrap the results in a JavaScript function, suitable for use with JSONP. This can be used to make cross-domain requests to the Congress API within the browser. - -

-

For example: - -

-
/legislators?last_name=Reid&callback=myCallback
-

will return: - -

-
myCallback({
-  "results": [
-    {
-      "bioguide_id": "R000146",
-      "chamber": "senate",
-      "last_name": "Reid"
-      ...
-    }
-  ],
-  "count": 1,
-  "page": {
-    "count": 1,
-    "per_page": 20,
-    "page": 1
-  }
-}
-});
-

Search

-

Provide a query parameter to return results the API thinks best match your query. Queries are interpreted as phrases. - -

-

Senate hearings matching "environment" - -

-
/hearings?query=environment&chamber=senate
-

House floor updates matching "committee of the whole" - -

-
/floor_updates?query=committee of the whole&chamber=house
-

Explain mode

-

Add an explain=true parameter to any API request to return a JSON response with how the API interpreted the query, and database-specific explain information. - -

-

This is a convenience for debugging, not a "supported" API feature. Don't make automatic requests with explain mode turned on. - -

- -

Endpoints ending with /search that are given a query parameter perform full text search. These queries can use some advanced operators. Queries are interpreted as keywords (use quotes to form phrases). - -

-

Laws matching "health care" and "medicine" - -

-
/bills/search?query="health care" medicine&history.enacted=true
-

Operators allowed: - -

- -

Bills matching "freedom of information" and words starting with "accountab" - -

-
/bills/search?query="freedom of information" accountab*
-

Bills with "transparency" and "accountability" within 5 words of each other - -

-
/bills/search?query="transparency accountability"~5
-

Highlighting

-

When performing full text search, you can retrieve highlighted excerpts of where your search matched by using the parameter highlight=true. (This will make the request slower, so only use if needed.) - -

-

Recent bills matching "gun control", with highlighting - -

-
/bills/search?query="gun control"&highlight=true&order=introduced_on
-

By default, highlighting is performed with the <em> and </em> tags. Control these tags by passing start and close tags to the highlight.tags parameter. (Disable highlighting altogether by passing only ,.) - -

-

Bills matching "immigration", highlighted with <b> tags - -

-
/bills/search?query=immigration&highlight=true&highlight.tags=<b>,</b>
-

Bills matching "immigration", with no highlighting - -

-
/bills/search?query=immigration&highlight=true&highlight.tags=,
-

Control the size of highlighted excerpts with the highlight.size parameter. (Note: This doesn't always work; the database makes a best attempt.) The default highlight.size is 200. - -

-

Bills matching "drugs", with larger excerpts - -

-
/bills/search?query=drugs&highlight=true&highlight.size=500
-

Bulk Data

-

We provide some data for direct download. The Congress API is not designed for retrieving bulk data. Requests are limited to a maximum of 50 per page, and many fields need to be specifically requested. If you need data in bulk, please use these resources rather than fetching it all through the API. - -

-

Legislator spreadsheet

-

We offer a CSV of basic legislator information for direct download here (right-click and Save As). - -

-

It includes basic information about names, positions, biographical details, contact information, social media accounts, and identifiers for various public databases. - -

-

It contains current information only - it does not include a legislator's history of changes to name, party, chamber, etc. - -

-

Zip Codes to Congressional Districts

-

We provide a CSV connecting Zip Code Tabulation Areas (ZCTAs) to congressional districts for direct download here. - -

-

This is the data we use in our /legislators/locate and /districts/locate endpoints when a zip is provided. These are technically not zip codes, but ZCTAs: all of our warnings and caveats about using ZCTAs apply. - -

-

Legislator Photos

-

We provide zip files of official photos of members of Congress, as taken from the Congressional Pictorial Directory. We offer them in 3 sizes, and the files are all named using the member's Bioguide ID. - -

- -

Core Information

-

Core information for legislators, committees, and bills come from public domain scrapers and bulk data at github.com/unitedstates. - -

- -

Client Libraries

-

If you've written a client library, please tweet at @sunlightlabs or email us so we can link to it here. - -

- -

Other

-

Migrating from our old Sunlight Congress API

-

This Sunlight Congress API replaces and deprecates our old Sunlight Congress API. We will keep the old Congress API running until at least the end of the 113th Congress (January 2015). We advise users of the old Congress API to upgrade to this one as soon as possible. - -

-

We have prepared a migration guide that shows how to move from each method in the old API to the new API. - -

-

Planned Additions

- -

To suggest new data and features, open a ticket on Github Issues. - -

-

More APIs

-

If the Sunlight Congress API doesn't have what you're looking for, check out other Congress APIs: - -

- -

Or if you're looking for other government data: - -

- - -
-
- - - - \ No newline at end of file diff --git a/source/index.md b/index.md similarity index 85% rename from source/index.md rename to index.md index c6003b5f..8fddabea 100644 --- a/source/index.md +++ b/index.md @@ -1,5 +1,12 @@ +--- +layout: page +title: Sunlight Congress API +--- # Sunlight Congress API +* toc +{:toc} + A live JSON API for the people and work of Congress, provided by the [Sunlight Foundation](http://sunlightfoundation.com). ## Features @@ -25,40 +32,22 @@ We have an [API mailing list](https://groups.google.com/forum/?fromgroups#!forum Calls to the Sunlight Congress API are of the form: -```text +{% highlight text %} http://congress.api.sunlightfoundation.com/[method] -``` - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[/legislators](legislators.html)Current legislators' names, IDs, biography, and social media.
[/legislators/locate](legislators.html)Find representatives and senators for a `latitude`/`longitude` or `zip`.
[/districts/locate](districts.html)Find congressional districts for a `latitude`/`longitude` or `zip`.
[/committees](committees.html)Current committees, subcommittees, and their membership.
[/bills](bills.html)Legislation in the House and Senate, back to 2009. Updated daily.
[/bills/search](bills.html)Full text search over legislation.
[/votes](votes.html)Roll call votes in Congress, back to 2009. Updated within minutes of votes.
[/floor_updates](floor_updates.html)To-the-minute updates from the floor of the House and Senate.
[/hearings](hearings.html)Committee hearings in Congress. Updated as hearings are announced.
[/upcoming_bills](upcoming_bills.html)Bills scheduled for debate in the future, as announced by party leadership.
+{% endhighlight %} + + Method | Description +--------------------------------------- | ----------------------------------------------------------------- +[/legislators](legislators.html) | Current legislators' names, IDs, biography, and social media. +[/legislators/locate](legislators.html) | Find representatives and senators for a `latitude`/`longitude` or `zip`. +[/districts/locate](districts.html) | Find congressional districts for a `latitude`/`longitude` or `zip`. +[/committees](committees.html) | Current committees, subcommittees, and their membership. +[/bills](bills.html) | Legislation in the House and Senate, back to 2009. Updated daily. +[/bills/search](bills.html) | Full text search over legislation. +[/votes](votes.html) | Roll call votes in Congress, back to 2009. Updated within minutes of votes. +[/floor_updates](floor_updates.html) | To-the-minute updates from the floor of the House and Senate. +[/hearings](hearings.html) | Committee hearings in Congress. Updated as hearings are announced. +[/upcoming_bills](upcoming_bills.html) | Bills scheduled for debate in the future, as announced by party leadership. ## Parameters @@ -68,9 +57,9 @@ All requests to the Congress API require a Sunlight API key. An API key is [free API keys can be provided with a request through the query string: -```text +{% highlight text %} /bills?apikey=[your_api_key] -``` +{% endhighlight %} Or, by setting the key as the value of an `X-APIKEY` HTTP request header. @@ -78,21 +67,21 @@ Or, by setting the key as the value of an `X-APIKEY` HTTP request header. You can filter on many fields with a simple key/value pair: -```text +{% highlight text %} /legislators?last_name=Smith -``` +{% endhighlight %} -```text +{% highlight text %} /bills?bill_type=hr&congress=112 -``` +{% endhighlight %} The API will automatically treat numbers as numbers, and "true" and "false" as booleans. Dates and times are compared as strings. To force the API to treat a value as a string, use quotes: -```text +{% highlight text %} /legislators?thomas_id="136" -``` +{% endhighlight %} See the documentation for a specific data type to see what fields can be filtered on. @@ -114,39 +103,39 @@ All operators are applied by adding two underscores ("__") after the field name. **Senate votes that got more than 70 Yea votes** -```text +{% highlight text %} /votes?breakdown.total.Yea__gte=70&chamber=senate -``` +{% endhighlight %} **Bills that got an up or down vote in the House** -```text +{% highlight text %} /bills?history.house_passage_result__exists=true&chamber=house -``` +{% endhighlight %} **Bills cosponsored by both John McCain and Joe Lieberman** -```text +{% highlight text %} /bills?cosponsor_ids__all=M000303|L000304 -``` +{% endhighlight %} **Bills sponsored by either John McCain and Joe Lieberman** -```text +{% highlight text %} /bills?sponsor_id__in=M000303|L000304 -``` +{% endhighlight %} ### Pagination All results in the Congress API are paginated. Set `per_page` and `page` to control the page size and offset. The maximum `per_page` is 50. -```text +{% highlight text %} /floor_updates?chamber=house&per_page=50&page=3 -``` +{% endhighlight %} At the top-level of every response are **count** and **page** fields, with pagination information. -```json +{% highlight json %} { "count": 163, "page": { @@ -155,7 +144,7 @@ At the top-level of every response are **count** and **page** fields, with pagin "count": 50 } } -``` +{% endhighlight %} **count**
The total number of documents that match the query. @@ -179,21 +168,21 @@ Any field which can be used for filtering may be used for sorting. On full-text **Most recent bills** -```text +{% highlight text %} /bills?order=introduced_on -``` +{% endhighlight %} **Legislators from each state, sorted by last name within state** -```text +{% highlight text %} /legislators?order=state__asc,last_name__asc -``` +{% endhighlight %} **Most relevant bills matching "health care"** -```text +{% highlight text %} /bills/search?query="health care"&order=score -``` +{% endhighlight %} ### Partial responses @@ -205,11 +194,11 @@ To save on bandwidth, parsing time, and confusion, it's recommended to always sp **Latest vote numbers and their results** -```text +{% highlight text %} /votes?fields=roll_id,result,breakdown.total -``` +{% endhighlight %} -```json +{% highlight json %} { "results": [ { @@ -239,7 +228,7 @@ To save on bandwidth, parsing time, and confusion, it's recommended to always sp ... ] } -``` +{% endhighlight %} ### JSONP @@ -247,13 +236,13 @@ Provide a `callback` parameter to wrap the results in a JavaScript function, sui For example: -```text +{% highlight text %} /legislators?last_name=Reid&callback=myCallback -``` +{% endhighlight %} will return: -```javascript +{% highlight javascript %} myCallback({ "results": [ { @@ -271,7 +260,7 @@ myCallback({ } } }); -``` +{% endhighlight %} ### Search @@ -279,15 +268,15 @@ Provide a `query` parameter to return results the API thinks best match your que **Senate hearings matching "environment"** -```text +{% highlight text %} /hearings?query=environment&chamber=senate -``` +{% endhighlight %} **House floor updates matching "committee of the whole"** -```text +{% highlight text %} /floor_updates?query=committee of the whole&chamber=house -``` +{% endhighlight %} ### Explain mode @@ -301,9 +290,9 @@ Endpoints ending with `/search` that are given a `query` parameter perform full **Laws matching "health care" and "medicine"** -```text +{% highlight text %} /bills/search?query="health care" medicine&history.enacted=true -``` +{% endhighlight %} Operators allowed: @@ -312,15 +301,15 @@ Operators allowed: **Bills matching "freedom of information" and words starting with "accountab"** -```text +{% highlight text %} /bills/search?query="freedom of information" accountab* -``` +{% endhighlight %} **Bills with "transparency" and "accountability" within 5 words of each other** -```text +{% highlight text %} /bills/search?query="transparency accountability"~5 -``` +{% endhighlight %} ### Highlighting @@ -329,31 +318,31 @@ When performing full text search, you can retrieve highlighted excerpts of where **Recent bills matching "gun control", with highlighting** -```text +{% highlight text %} /bills/search?query="gun control"&highlight=true&order=introduced_on -``` +{% endhighlight %} By default, highlighting is performed with the `` and `` tags. Control these tags by passing start and close tags to the `highlight.tags` parameter. (Disable highlighting altogether by passing only `,`.) **Bills matching "immigration", highlighted with <b> tags** -```text +{% highlight text %} /bills/search?query=immigration&highlight=true&highlight.tags=, -``` +{% endhighlight %} **Bills matching "immigration", with no highlighting** -```text +{% highlight text %} /bills/search?query=immigration&highlight=true&highlight.tags=, -``` +{% endhighlight %} Control the size of highlighted excerpts with the `highlight.size` parameter. (Note: This doesn't always work; the database makes a best attempt.) The default `highlight.size` is 200. **Bills matching "drugs", with larger excerpts** -```text +{% highlight text %} /bills/search?query=drugs&highlight=true&highlight.size=500 -``` +{% endhighlight %} ## Bulk Data diff --git a/legislators.html b/legislators.html deleted file mode 100644 index 38143772..00000000 --- a/legislators.html +++ /dev/null @@ -1,396 +0,0 @@ - - - - - - - Sunlight Congress API | Legislators - - - - - - - -
- -
- -

Legislators

-

Data on members of Congress, dating back to 1789. All member information is sourced from the bulk data at github.com/unitedstates. - -

-

Unique ID: The bioguide_id will be present and unique for all members of Congress. It is an official ID, assigned by Congress, and is the most suitable for use as a unique ID. - -

-

Methods

-

All requests require a valid API key, and use the domain: - -

-
http://congress.api.sunlightfoundation.com
-

/legislators/locate

-

Find members of Congress by a latitude and longitude, or a zip code. - -

-

There is no support for further operators, ordering, or partial responses. All you can do is filter by location. - -

-

At-large districts, which encompass an entire state, are assigned a district number of 0. - -

-

By latitude/longitude - -

-
/legislators/locate?latitude=42.96&longitude=-108.09
-

This will return both representatives and senators that currently represent the given point or zip. For a given latitude and longitude, this should return up to 1 representative and 2 senators. - -

-

By zip code - -

-
/legislators/locate?zip=11216
-

A zip code may intersect multiple Congressional districts, so locating by zip may return multiple representatives, and possibly more than 2 senators if the zip code crosses state borders. - -

-

In general, we recommend against using zip codes to look up members of Congress. For one, it's imprecise: a zip code can intersect multiple congressional districts. More importantly, zip codes are not shapes. They are lines (delivery routes), and treating them as shapes leads to inaccuracies. - -

-

/legislators

-

Search and filter for members of Congress. All standard operators apply. - -

-

By default, all requests will return currently serving members, but you can override this by supplying all_legislators=true. - -

-

Filtering on fields - -

-
/legislators?party=D&chamber=senate
-

Filter by any fields below that have a star next to them. All standard operators apply. - -

-

Locating a particular member, whether in office or not - -

-
/legislators?bioguide_id=F000444&all_legislators=true
-

Searching by a string - -

-
/legislators?query=mcconnell
-

This will search legislators' name fields: first_name, last_name, middle_name, nickname, other_names.last - -

-

Disabling pagination - -

-

You can turn off pagination for requests to /legislators, but doing so will force a filter of in_office=true (that cannot be overridden). - -

-
/legislators?per_page=all
-

Fields

-

* = can be used as a filter - -

-
"in_office": true,
-"party": "D",
-"gender": "M",
-"state": "OH",
-"state_name": "Ohio",
-"district": null,
-"title": "Sen",
-"chamber": "senate",
-"senate_class": 1,
-"state_rank": "senior",
-"birthday": "1946-12-24",
-"term_start": "2007-01-04",
-"term_end": "2012-12-31"
-
-

* in_office
-Whether a legislator is currently holding elected office in Congress. - -

-

* party
-First letter of the party this member belongs to. "R", "D", or "I". - -

-

* gender
-First letter of this member's gender. "M" or "F". - -

-

* state
-Two-letter code of the state this member represents. - -

-

* state_name
-The full state name of the state this member represents. - -

-

* district
-(House only) The number of the district that a House member represents. - -

-

* state_rank
-(Senate only) The seniority of that Senator for that state. "junior" or "senior". - -

-

* title
-Title of this member. "Sen", "Rep", "Del", or "Com". - -

-

* chamber
-Chamber the member is in. "senate" or "house". - -

-

* senate_class
-Which senate "class" the member belongs to (1, 2, or 3). Every 2 years, a separate one third of the Senate is elected to a 6-year term. Senators of the same class face election in the same year. Blank for members of the House. - -

-

* birthday
-The date of this legislator's birthday. - -

-

* term_start
-The date a member's current term started. - -

-

* term_end
-The date a member's current term will end. - -

-

Identifiers

-
"bioguide_id": "B000944",
-"thomas_id": "136",
-"govtrack_id": "400050",
-"votesmart_id": "27018",
-"crp_id": "N00003535",
-"lis_id": "S307",
-"fec_ids": [
-  "H2OH13033"
-]
-
-

* bioguide_id
-Identifier for this member in various Congressional sources. Originally taken from the Congressional Biographical Directory, but used in many places. If you're going to pick one ID as a Congressperson's unique ID, use this. - -

-

* thomas_id
-Identifier for this member as it appears on THOMAS.gov and Congress.gov. - -

-

* lis_id
-Identifier for this member as it appears on some of Congress' data systems (namely Senate votes). - -

-

* govtrack_id
-Identifier for this member as it appears on GovTrack.us. - -

-

* votesmart_id
-Identifier for this member as it appears on Project Vote Smart. - -

-

* crp_id
-Identifier for this member as it appears on CRP's OpenSecrets. - -

-

* fec_ids
-A list of identifiers for this member as they appear in filings at the Federal Election Commission. - -

-

Names

-
"first_name": "Jefferson",
-"nickname": "Jeff",
-"last_name": "Brown",
-"middle_name": "B.",
-"name_suffix": null
-
-

* first_name
-The member's first name. This may or may not be the name they are usually called. - -

-

* nickname
-The member's nickname. If present, usually safe to assume this is the name they go by. - -

-

* last_name
-The member's last name. - -

-

* middle_name
-The member's middle name, if they have one. - -

-

* name_suffix
-A name suffix, if the member uses one. For example, "Jr." or "III". - -

-

Contact info

-
"phone": "202-224-2315",
-"website": "http://brown.senate.gov/",
-"office": "713 Hart Senate Office Building",
-"contact_form": "http://www.brown.senate.gov/contact/",
-"fax": "202-228-6321"
-
-

phone
-Phone number of the members's DC office. - -

-

fax
-Fax number of the members's DC office. - -

-

office
-Office number for the member's DC office. - -

-

website
-Official legislative website. - -

-

contact_form
-URL to their official contact form. - -

-

Social Media

-
"twitter_id": "SenSherrodBrown",
-"youtube_id": "SherrodBrownOhio",
-"facebook_id": "109453899081640"
-
-

twitter_id
-The Twitter username for a member's official legislative account. This field does not contain the handles of campaign accounts. - -

-

youtube_id
-The YouTube username or channel for a member's official legislative account. This field does not contain the handles of campaign accounts. A few legislators use YouTube "channels" instead of regular accounts. These channels will be of the form channel/[id]. - -

-

facebook_id
-The Facebook username or ID for a member's official legislative Facebook presence. ID numbers and usernames can be used interchangeably in Facebook's URLs and APIs. The referenced account may be either a Facebook Page or a user account. - -

-

All social media account values can be turned into URLs by preceding them with the domain name of the service in question: - -

- -

Terms

-

An array of information for each term the member has served, from oldest to newest. Example: - -

-
"terms": [{
-  "start": "2013-01-03",
-  "end": "2019-01-03",
-  "state": "NJ",
-  "party": "D",
-  "class": 1,
-  "title": "Sen",
-  "chamber": "senate"
-}]
-
-

terms.start
-The date this term began. - -

-

terms.end
-The date this term ended, or will end. - -

-

terms.state
-The two-letter state code this member was serving during this term. - -

-

terms.party
-The party this member belonged to during this term. - -

-

terms.title
-The title this member had during this term. "Rep", "Sen", "Del", or "Com". - -

-

terms.chamber
-The chamber this member served in during this term. "house" or "senate". - -

-

terms.class
-The Senate class this member belonged to during this term, if they served in the Senate. Determines in which cycle they run for re-election. 1, 2, or 3.

- -
-
- - - - \ No newline at end of file diff --git a/source/legislators.md b/legislators.md similarity index 93% rename from source/legislators.md rename to legislators.md index d678641a..f7cc4c46 100644 --- a/source/legislators.md +++ b/legislators.md @@ -1,3 +1,7 @@ +--- +layout: page +title: Legislators +--- # Legislators Data on members of Congress, dating back to 1789. All member information is sourced from the bulk data at [github.com/unitedstates](https://github.com/unitedstates/congress-legislators). @@ -8,9 +12,9 @@ Data on members of Congress, dating back to 1789. All member information is sour All requests require a valid [API key](index.html#parameters/api-key), and use the domain: -```text +{% highlight text %} http://congress.api.sunlightfoundation.com -``` +{% endhighlight %} ### /legislators/locate @@ -22,17 +26,17 @@ At-large districts, which encompass an entire state, are assigned a district num **By latitude/longitude** -```text +{% highlight text %} /legislators/locate?latitude=42.96&longitude=-108.09 -``` +{% endhighlight %} This will return both representatives and senators that currently represent the given point or zip. For a given `latitude` and `longitude`, this should return up to 1 representative and 2 senators. **By zip code** -```text +{% highlight text %} /legislators/locate?zip=11216 -``` +{% endhighlight %} A `zip` code may intersect multiple Congressional districts, so locating by `zip` may return multiple representatives, and possibly more than 2 senators if the zip code crosses state borders. @@ -46,23 +50,23 @@ By default, all requests will return **currently serving members**, but you can **Filtering on fields** -```text +{% highlight text %} /legislators?party=D&chamber=senate -``` +{% endhighlight %} Filter by any [fields below](#fields) that have a star next to them. All [standard operators](index.html#parameters/operators) apply. **Locating a particular member, whether in office or not** -```text +{% highlight text %} /legislators?bioguide_id=F000444&all_legislators=true -``` +{% endhighlight %} **Searching by a string** -```text +{% highlight text %} /legislators?query=mcconnell -``` +{% endhighlight %} This will search legislators' name fields: `first_name`, `last_name`, `middle_name`, `nickname`, `other_names.last` @@ -70,16 +74,16 @@ This will search legislators' name fields: `first_name`, `last_name`, `middle_na You can turn off pagination for requests to `/legislators`, but doing so will force a filter of `in_office=true` (that cannot be overridden). -```text +{% highlight text %} /legislators?per_page=all -``` +{% endhighlight %} ## Fields \* = can be used as a filter -```json +{% highlight json %} { "in_office": true, "party": "D", @@ -95,7 +99,7 @@ You can turn off pagination for requests to `/legislators`, but doing so will fo "term_start": "2007-01-04", "term_end": "2012-12-31" } -``` +{% endhighlight %} \* **in_office**
Whether a legislator is currently holding elected office in Congress. @@ -138,7 +142,7 @@ The date a member's current term will end. ### Identifiers -```json +{% highlight json %} { "bioguide_id": "B000944", "thomas_id": "136", @@ -150,7 +154,7 @@ The date a member's current term will end. "H2OH13033" ] } -``` +{% endhighlight %} \* **bioguide_id**
Identifier for this member in various Congressional sources. Originally taken from the [Congressional Biographical Directory](http://bioguide.congress.gov), but used in many places. If you're going to pick one ID as a Congressperson's unique ID, use this. @@ -175,7 +179,7 @@ A list of identifiers for this member as they appear in filings at the [Federal ### Names -```json +{% highlight json %} { "first_name": "Jefferson", "nickname": "Jeff", @@ -183,7 +187,7 @@ A list of identifiers for this member as they appear in filings at the [Federal "middle_name": "B.", "name_suffix": null } -``` +{% endhighlight %} \* **first_name**
The member's first name. This may or may not be the name they are usually called. @@ -202,7 +206,7 @@ A name suffix, if the member uses one. For example, "Jr." or "III". ### Contact info -```json +{% highlight json %} { "phone": "202-224-2315", "website": "http://brown.senate.gov/", @@ -210,7 +214,7 @@ A name suffix, if the member uses one. For example, "Jr." or "III". "contact_form": "http://www.brown.senate.gov/contact/", "fax": "202-228-6321" } -``` +{% endhighlight %} **phone**
Phone number of the members's DC office. @@ -229,13 +233,13 @@ URL to their official contact form. ### Social Media -```json +{% highlight json %} { "twitter_id": "SenSherrodBrown", "youtube_id": "SherrodBrownOhio", "facebook_id": "109453899081640" } -``` +{% endhighlight %} **twitter_id**
The Twitter *username* for a member's official legislative account. This field does not contain the handles of campaign accounts. @@ -256,7 +260,7 @@ All social media account values can be turned into URLs by preceding them with t An array of information for each term the member has served, from oldest to newest. Example: -```json +{% highlight json %} { "terms": [{ "start": "2013-01-03", @@ -268,7 +272,7 @@ An array of information for each term the member has served, from oldest to newe "chamber": "senate" }] } -``` +{% endhighlight %} **terms.start**
The date this term began. diff --git a/migration.html b/migration.html deleted file mode 100644 index 2458e489..00000000 --- a/migration.html +++ /dev/null @@ -1,424 +0,0 @@ - - - - - - - Sunlight Congress API | Migration - - - - - - - -
- -
- -

Migrating

-

This Congress API deprecates our previous Congress API. The new Congress API keeps nearly all the data and features the old one offered. - -

-

We will keep our previous Congress API running until the end of the 113th Congress. Users are advised to upgrade to our new Congress API as soon as possible. - -

-

This guide shows how to move from each method in the old API to the new API. - -

-

General

-

New URL

-

The previous API root was http://services.sunlightlabs.com/api/. The new API root is: - -

-
http://congress.api.sunlightfoundation.com
-

Both the previous API and the new API require your Sunlight API key, so an API method documented as /legislators/locate would be used as: - -

-
http://congress.api.sunlightfoundation.com/legislators/locate?apikey=[your_api_key]
-

JSON only

-

We no longer support XML responses in our Congress API. All responses are in JSON. - -

-

JSONP parameter change

-

We still support JSONP, but the parameter has been changed from jsonp to callback. See the JSONP documentation for more details. - -

-

Response structure

-

All responses in the new Congress API are in the following form: - -

-
{
-  "results": [
-    ... result objects ...
-  ],
-  "count": 123,
-  "page": {
-    "count": 20,
-    "per_page": 20,
-    "page": 1
-  }
-}
-

All endpoints are plural, and return an array of objects. To look up a single object, use search criteria that guarantee a single result and look for the first (and only) result. - -

-

The count and page fields are always present, explained in Pagination. The only exceptions are requests to /districts/locate, which does not use pagination. - -

-

Requesting fields

-

By default, not all fields are returned for most objects in the new Congress API. - -

-

For example, a legislator's terms field, which contains extensive data on that member's past terms, does not appear for a plain request to /legislators. - -

-

Fields can be requested using the fields parameter: - -

-
/legislators?fields=bioguide_id,last_name,state,terms
-

This is documented further in Partial Responses. - -

-

Legislators

-

Field changes

-

The following fields have been renamed: - -

- -

The following fields have been dropped altogether: - -

- -

The following fields have changed: - -

- -

The following fields are new: - -

- -

See the documentation for legislators for more information. - - -

-

legislators.getList

-

In general, finding legislators is very similar. - -

-

Filtering on fields - -

-

When filtering on a chamber, use the chamber field instead of title. - -

-
# old API:
-/legislators.getList.json?title=Sen&state=MT&lastname=Tester
-
-# new API:
-/legislators?chamber=senate&state=MT&last_name=Tester
-

Multiple values for a parameter - -

-

Instead of repeating a parameter, use the "in" operator with a pipe-separated list of values: - -

-
# old API:
-/legislators.getList?lastname=Obama&lastname=McCain
-
-# new API:
-/legislators?last_name__in=Obama|McCain
-

The Operators documentation has more details on operators and filtering. - -

-

legislators.get

-

Finding a single legislator is the same as finding many. Filter by criteria that uniquely identify a legislator, and use the first (and only) result. - -

-
# old API:
-/legislators.get?bioguide_id=L000551
-
-# new API:
-/legislators?bioguide_id=L000551
-

legislators.allForLatLong

-

Use the /legislators/locate endpoint. - -

-
# old API:
-/legislators.allForLatLong.json?latitude=47.603560&longitude=-122.329439
-
-# new API:
-/legislators/locate?latitude=47.603560&longitude=-122.329439
-

legislators.allForZip

-

Use the /legislators/locate endpoint. - -

-
# old API:
-/legislators.allForZip.json?zip=11216
-
-# new API:
-/legislators/locate?zip=11216
- -

You can use the query parameter to match a text fragment against any of legislators' name fields. - -

-

We no longer support "fuzzy search" of legislator names. The given query must match or be contained in one of the fields exactly. - -

-

Any legislators whose name somehow matches "smi" - -

-
# old API:
-/legislators.search?name=smi
-
-# new API:
-/legislators?query=smi
-

Districts

-

Districts can still only be found by location. The /districts/locate endpoint does not return pagination information. The fields remain the same: state and district, where an "At-Large" district is coded as 0. - -

-

districts.allForLatLong

-
# old API:
-/districts.allForLatLong.json?latitude=47.603560&longitude=-122.329439
-
-# new API:
-/districts/locate?latitude=47.603560&longitude=-122.329439
-

districts.allForZip

-
# old API:
-/districts.allForZip.json?zip=11216
-
-# new API:
-/districts/locate?zip=11216
-

Committees

-

Committees and subcommittees are now mixed together. Finding all committees a legislator is assigned to no longer requires its own endpoint. - -

-

IDs have changed for a few committees, and for all subcommittees - they are now sourced entirely from official resources. - -

-

We have added contact information for committees, and title information for membership (e.g. "Chair", "Ranking Member", etc.) - -

-

Field changes

-

The following fields have been renamed: - -

- -

The following fields have changed: - -

- -

The following fields are new: - -

- -

See the full Committees documentation for more information. - -

-

committees.getList

-

In general, finding committees is very similar. - -

-

Filtering on fields - -

-
# old API:
-/committees.getList?chamber=House
-
-# new API:
-/committees?chamber=house
-

committees.get

-

Finding a single committee is the same as finding many. Filter by criteria that uniquely identify a committee, and use the first (and only) result. - -

-
# old API:
-/committees.get?id=HSSM
-
-# new API:
-/committees?committee_id=HSSM
-

committees.allForLegislator

-

Use the /committees endpoint with a filter on member_ids to limit the response to committees and subcommittees the legislator servers on. - -

-
# old API:
-/committees.allForLegislator?bioguide_id=S000148
-
-# new API:
-/committees?member_ids=S000148
- -
-
- - - - \ No newline at end of file diff --git a/source/migration.md b/migration.md similarity index 92% rename from source/migration.md rename to migration.md index 50894a72..36842213 100644 --- a/source/migration.md +++ b/migration.md @@ -1,3 +1,7 @@ +--- +layout: page +title: Migrating +--- # Migrating This Congress API deprecates our previous [Congress API](http://services.sunlightlabs.com/docs/Sunlight_Congress_API/). The new Congress API keeps nearly all the data and features the old one offered. @@ -12,15 +16,15 @@ This guide shows how to move from each method in the old API to the new API. The previous API root was `http://services.sunlightlabs.com/api/`. The new API root is: -```text +{% highlight text %} http://congress.api.sunlightfoundation.com -``` +{% endhighlight %} Both the previous API and the new API require your [Sunlight API key](http://services.sunlightlabs.com/accounts/register/), so an API method documented as `/legislators/locate` would be used as: -```text +{% highlight text %} http://congress.api.sunlightfoundation.com/legislators/locate?apikey=[your_api_key] -``` +{% endhighlight %} ### JSON only @@ -34,7 +38,7 @@ We still support [JSONP](http://en.wikipedia.org/wiki/JSONP), but the parameter All responses in the new Congress API are in the following form: -```json +{% highlight json %} { "results": [ ... result objects ... @@ -46,7 +50,7 @@ All responses in the new Congress API are in the following form: "page": 1 } } -``` +{% endhighlight %} All endpoints are plural, and return an array of objects. To look up a single object, use search criteria that guarantee a single result and look for the first (and only) result. @@ -60,9 +64,9 @@ For example, a legislator's `terms` field, which contains extensive data on that Fields can be requested using the `fields` parameter: -```text +{% highlight text %} /legislators?fields=bioguide_id,last_name,state,terms -``` +{% endhighlight %} This is documented further in [Partial Responses](index.html#parameters/partial-responses). @@ -115,25 +119,25 @@ In general, finding legislators is very similar. When filtering on a chamber, use the `chamber` field instead of `title`. -```text +{% highlight text %} # old API: /legislators.getList.json?title=Sen&state=MT&lastname=Tester # new API: /legislators?chamber=senate&state=MT&last_name=Tester -``` +{% endhighlight %} **Multiple values for a parameter** Instead of repeating a parameter, use the "in" operator with a pipe-separated list of values: -```text +{% highlight text %} # old API: /legislators.getList?lastname=Obama&lastname=McCain # new API: /legislators?last_name__in=Obama|McCain -``` +{% endhighlight %} The [Operators](index.html#parameters/operators) documentation has more details on operators and filtering. @@ -141,37 +145,37 @@ The [Operators](index.html#parameters/operators) documentation has more details Finding a single legislator is the same as finding many. Filter by criteria that uniquely identify a legislator, and use the first (and only) result. -```text +{% highlight text %} # old API: /legislators.get?bioguide_id=L000551 # new API: /legislators?bioguide_id=L000551 -``` +{% endhighlight %} ### legislators.allForLatLong Use the `/legislators/locate` endpoint. -```text +{% highlight text %} # old API: /legislators.allForLatLong.json?latitude=47.603560&longitude=-122.329439 # new API: /legislators/locate?latitude=47.603560&longitude=-122.329439 -``` +{% endhighlight %} ### legislators.allForZip Use the `/legislators/locate` endpoint. -```text +{% highlight text %} # old API: /legislators.allForZip.json?zip=11216 # new API: /legislators/locate?zip=11216 -``` +{% endhighlight %} ### legislators.search @@ -181,13 +185,13 @@ We **no longer support** "fuzzy search" of legislator names. The given `query` m **Any legislators whose name somehow matches "smi"** -```text +{% highlight text %} # old API: /legislators.search?name=smi # new API: /legislators?query=smi -``` +{% endhighlight %} ## Districts @@ -195,23 +199,23 @@ We **no longer support** "fuzzy search" of legislator names. The given `query` m ### districts.allForLatLong -```text +{% highlight text %} # old API: /districts.allForLatLong.json?latitude=47.603560&longitude=-122.329439 # new API: /districts/locate?latitude=47.603560&longitude=-122.329439 -``` +{% endhighlight %} ### districts.allForZip -```text +{% highlight text %} # old API: /districts.allForZip.json?zip=11216 # new API: /districts/locate?zip=11216 -``` +{% endhighlight %} ## Committees @@ -252,34 +256,34 @@ In general, finding committees is very similar. **Filtering on fields** -```text +{% highlight text %} # old API: /committees.getList?chamber=House # new API: /committees?chamber=house -``` +{% endhighlight %} ### committees.get Finding a single committee is the same as finding many. Filter by criteria that uniquely identify a committee, and use the first (and only) result. -```text +{% highlight text %} # old API: /committees.get?id=HSSM # new API: /committees?committee_id=HSSM -``` +{% endhighlight %} ### committees.allForLegislator Use the `/committees` endpoint with a filter on `member_ids` to limit the response to committees and subcommittees the legislator servers on. -```text +{% highlight text %} # old API: /committees.allForLegislator?bioguide_id=S000148 # new API: /committees?member_ids=S000148 -``` \ No newline at end of file +{% endhighlight %} \ No newline at end of file diff --git a/pygments.css b/pygments.css new file mode 100644 index 00000000..67e6ea39 --- /dev/null +++ b/pygments.css @@ -0,0 +1,61 @@ +.hll { background-color: #ffffcc } +.c { color: #408080; font-style: italic } /* Comment */ +.err { border: 1px solid #FF0000 } /* Error */ +.k { color: #008000; font-weight: bold } /* Keyword */ +.o { color: #666666 } /* Operator */ +.cm { color: #408080; font-style: italic } /* Comment.Multiline */ +.cp { color: #BC7A00 } /* Comment.Preproc */ +.c1 { color: #408080; font-style: italic } /* Comment.Single */ +.cs { color: #408080; font-style: italic } /* Comment.Special */ +.gd { color: #A00000 } /* Generic.Deleted */ +.ge { font-style: italic } /* Generic.Emph */ +.gr { color: #FF0000 } /* Generic.Error */ +.gh { color: #000080; font-weight: bold } /* Generic.Heading */ +.gi { color: #00A000 } /* Generic.Inserted */ +.go { color: #888888 } /* Generic.Output */ +.gp { color: #000080; font-weight: bold } /* Generic.Prompt */ +.gs { font-weight: bold } /* Generic.Strong */ +.gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +.gt { color: #0044DD } /* Generic.Traceback */ +.kc { color: #008000; font-weight: bold } /* Keyword.Constant */ +.kd { color: #008000; font-weight: bold } /* Keyword.Declaration */ +.kn { color: #008000; font-weight: bold } /* Keyword.Namespace */ +.kp { color: #008000 } /* Keyword.Pseudo */ +.kr { color: #008000; font-weight: bold } /* Keyword.Reserved */ +.kt { color: #B00040 } /* Keyword.Type */ +.m { color: #666666 } /* Literal.Number */ +.s { color: #BA2121 } /* Literal.String */ +.na { color: #7D9029 } /* Name.Attribute */ +.nb { color: #008000 } /* Name.Builtin */ +.nc { color: #0000FF; font-weight: bold } /* Name.Class */ +.no { color: #880000 } /* Name.Constant */ +.nd { color: #AA22FF } /* Name.Decorator */ +.ni { color: #999999; font-weight: bold } /* Name.Entity */ +.ne { color: #D2413A; font-weight: bold } /* Name.Exception */ +.nf { color: #0000FF } /* Name.Function */ +.nl { color: #A0A000 } /* Name.Label */ +.nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ +.nt { color: #008000; font-weight: bold } /* Name.Tag */ +.nv { color: #19177C } /* Name.Variable */ +.ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ +.w { color: #bbbbbb } /* Text.Whitespace */ +.mf { color: #666666 } /* Literal.Number.Float */ +.mh { color: #666666 } /* Literal.Number.Hex */ +.mi { color: #666666 } /* Literal.Number.Integer */ +.mo { color: #666666 } /* Literal.Number.Oct */ +.sb { color: #BA2121 } /* Literal.String.Backtick */ +.sc { color: #BA2121 } /* Literal.String.Char */ +.sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */ +.s2 { color: #BA2121 } /* Literal.String.Double */ +.se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */ +.sh { color: #BA2121 } /* Literal.String.Heredoc */ +.si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */ +.sx { color: #008000 } /* Literal.String.Other */ +.sr { color: #BB6688 } /* Literal.String.Regex */ +.s1 { color: #BA2121 } /* Literal.String.Single */ +.ss { color: #19177C } /* Literal.String.Symbol */ +.bp { color: #008000 } /* Name.Builtin.Pseudo */ +.vc { color: #19177C } /* Name.Variable.Class */ +.vg { color: #19177C } /* Name.Variable.Global */ +.vi { color: #19177C } /* Name.Variable.Instance */ +.il { color: #666666 } /* Literal.Number.Integer.Long */ diff --git a/source/compile.rb b/source/compile.rb deleted file mode 100755 index 60b8f339..00000000 --- a/source/compile.rb +++ /dev/null @@ -1,91 +0,0 @@ -#!/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 - -google_analytics = YAML.load(open("config.yml"))['google_analytics'] - -header = ' - - - -' - -footer = " - -" - -name = "Sunlight Congress API" -twitter = "sunlightlabs" - - -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, "
powered by DocumentUp
" - - # 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.example b/source/config.yml.example deleted file mode 100644 index d04c0e95..00000000 --- a/source/config.yml.example +++ /dev/null @@ -1,2 +0,0 @@ -# fill in with google analytics key -google_analytics: \ No newline at end of file diff --git a/documentup.css b/style.css similarity index 100% rename from documentup.css rename to style.css diff --git a/upcoming_bills.html b/upcoming_bills.html deleted file mode 100644 index 81c9304b..00000000 --- a/upcoming_bills.html +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - - Sunlight Congress API | Upcoming Bills - - - - - - - -
- -
- -

Upcoming Bills

-

Bills that have been scheduled by party leadership for upcoming House and Senate floor action. House schedules are taken from the House Majority Leader, and Senate schedules from the Senate Democratic Caucus. - -

-

This endpoint is future-looking only. Old data on bills scheduled in the past is automatically deleted. - -

-

Methods

-

All requests require a valid API key, and use the domain: - -

-
http://congress.api.sunlightfoundation.com
-

/upcoming_bills

-

Filter through upcoming bills in the House and Senate. Filter by any fields below that have a star next to them. All standard operators apply. - -

-

Upcoming bills in the House - -

-
/upcoming_bills?chamber=house
-

Any scheduling of a particular bill - -

-
/upcoming_bills?bill_id=s968-112
-

Fields

-

* = can be used as a filter - -

-
"bill_id": "sconres3-113",
-"congress": 113,
-"chamber": "senate",
-"source_type": "senate_daily",
-"legislative_day": "2013-01-21",
-"range": "day",
-"context": "The Senate stands in recess under the provisions of S.Con.Res.3.  The Senate will meet at 11:30am on Monday, January 21, 2013 for the Joint Session for the Inaugural Ceremonies.",
-"url": "http://democrats.senate.gov/2013/01/21/senate-floor-schedule-for-monday-january-21-2013/"
-
-

* legislative_day
-The legislative day this bill is scheduled for. Combine with the range field to understand precision. May be null. - -

-

* range
-How precise this information is. "day", "week", or null. - -

-
    -
  • range is "day": bill has been scheduled specifically for the legislative_day.
  • -
  • range is "week": bill has been scheduled for the "Week of" the legislative_day.
  • -
  • range is null: bill has been scheduled at an indefinite time in the future. (legislative_day is null.)
  • -
-

The "legislative day" is a formal construct that is usually, but not always, the same as the calendar day. For example, if a day's session of Congress runs past midnight, the legislative_day will often stay the same as it was before midnight, until that session adjourns. On January 3rd, it is possible that the same legislative_day could span two Congresses. (This occurred in 2013.) - -

-

* congress
-The number of the Congress this bill has been scheduled in. - -

-

* chamber
-The chamber which has scheduled this bill. - -

-

* source_type
-The source for this information. "house_daily" (Majority Leader daily schedule or "senate_daily" (Senate Democrats' Floor feed. - -

-

context
-(Senate only) Some context for what kind of activity will be occurring to the bill. - -

-

url
-A permalink for this information. For the House, this may be a PDF. - -

-

Associated Bill

-
"bill_id": "hr41-113",
-"bill": {
-  "bill_id": "hr41-113",
-  "bill_type": "hr",
-  "congress": 113
-  ...
-}
-
-

* bill_id
-The ID of the bill that is being scheduled. - -

-

bill
-Some basic fields about the bill that is being scheduled.

- -
-
- - - - \ No newline at end of file diff --git a/source/upcoming_bills.md b/upcoming_bills.md similarity index 92% rename from source/upcoming_bills.md rename to upcoming_bills.md index 55d37c4d..9233fdeb 100644 --- a/source/upcoming_bills.md +++ b/upcoming_bills.md @@ -1,3 +1,7 @@ +--- +layout: page +title: Upcoming Bills +--- # Upcoming Bills Bills that have been scheduled by party leadership for upcoming House and Senate floor action. House schedules are taken from the [House Majority Leader](http://majorityleader.gov/), and Senate schedules from the [Senate Democratic Caucus](http://democrats.senate.gov/). @@ -8,9 +12,9 @@ This endpoint is future-looking only. Old data on bills scheduled in the past is All requests require a valid [API key](index.html#parameters/api-key), and use the domain: -```text +{% highlight text %} http://congress.api.sunlightfoundation.com -``` +{% endhighlight %} ### /upcoming_bills @@ -18,21 +22,21 @@ Filter through upcoming bills in the House and Senate. Filter by any [fields bel **Upcoming bills in the House** -```text +{% highlight text %} /upcoming_bills?chamber=house -``` +{% endhighlight %} **Any scheduling of a particular bill** -```text +{% highlight text %} /upcoming_bills?bill_id=s968-112 -``` +{% endhighlight %} ## Fields \* = can be used as a filter -```json +{% highlight json %} { "bill_id": "sconres3-113", "congress": 113, @@ -43,7 +47,7 @@ Filter through upcoming bills in the House and Senate. Filter by any [fields bel "context": "The Senate stands in recess under the provisions of S.Con.Res.3. The Senate will meet at 11:30am on Monday, January 21, 2013 for the Joint Session for the Inaugural Ceremonies.", "url": "http://democrats.senate.gov/2013/01/21/senate-floor-schedule-for-monday-january-21-2013/" } -``` +{% endhighlight %} \* **legislative_day**
The legislative day this bill is scheduled for. Combine with the `range` field to understand precision. May be null. @@ -74,7 +78,7 @@ A permalink for this information. For the House, this may be a PDF. ### Associated Bill -```json +{% highlight json %} { "bill_id": "hr41-113", "bill": { @@ -84,7 +88,7 @@ A permalink for this information. For the House, this may be a PDF. ... } } -``` +{% endhighlight %} \* **bill_id**
The ID of the [bill](bills.html) that is being scheduled. diff --git a/votes.html b/votes.html deleted file mode 100644 index 3b3abb3e..00000000 --- a/votes.html +++ /dev/null @@ -1,296 +0,0 @@ - - - - - - - Sunlight Congress API | Votes - - - - - - - -
- -
- -

Votes

-

Roll call votes taken by the House and Senate. This data is taken from original House and Senate sources, and goes back to 2009. - -

-

House and Senate votes normally appear within an hour after the vote is taken. House data usually appears more quickly, since the House uses an electronic voting system. - -

-

Votes taken by voice or unanimous consent, where the votes of individual representatives and senators are not recorded, are not present here. - -

-

Methods

-

All requests require a valid API key, and use the domain: - -

-
http://congress.api.sunlightfoundation.com
-

/votes

-

Search and filter through votes in Congress. Filter by any fields below that have a star next to them. All standard operators apply. - -

-

Recent votes in the Senate - -

-
/votes?chamber=senate&order=voted_at
-

Votes about 'guns' - -

-
/votes?query=guns
-

This will search votes' question field. - -

-

= TBD = - -

-

Fields

-

Many fields are not returned unless requested. You can request specific fields with the fields parameter. See the partial responses documentation for more details. - -

-

* = can be used as a filter - -

-
"roll_id": "h7-2013",
-"chamber": "house",
-"number": 7,
-"year": 2013,
-"congress": 113,
-"voted_at": "2013-01-04T16:22:00Z",
-"vote_type": "passage",
-"roll_type": "On Motion to Suspend the Rules and Pass",
-"question": "On Motion to Suspend the Rules and Pass -- H.R. 41 -- To temporarily increase the borrowing authority of the Federal Emergency Management Agency for carrying out the National Flood Insurance Program",
-"required": "2/3",
-"result": "Passed",
-"source": "http://clerk.house.gov/evs/2013/roll007.xml"
-
-

* roll_id
-A unique identifier for a roll call vote. Made from the first letter of the chamber, the vote number, and the legislative year. - -

-

* chamber
-The chamber the vote was taken in. "house" or "senate". - -

-

* number
-The number that vote was assigned. Numbers reset every legislative year. - -

-

* year
-The "legislative year" of the vote. This is not quite the same as the calendar year - the legislative year changes at noon EST on January 3rd. A vote taken on January 1, 2013 has a "legislative year" of 2012. - -

-

* congress
-The Congress this vote was taken in. - -

-

* voted_at
-The time the vote was taken. - -

-

* vote_type
-The type of vote being taken. This classification is imperfect and unofficial, and may change as we improve our detection. Valid types are "passage", "cloture", "nomination", "impeachment", "treaty", "recommit", "quorum", "leadership", and "other". - -

-

* roll_type
-The official description of the type of vote being taken. - -

-

question
-The official full question that the vote is addressing. - -

-

* required
-The required ratio of Aye votes necessary to pass the legislation. A value of "1/2" actually means more than 1/2. Ties are not possible in the Senate (the Vice President casts a tie-breaker vote), and in the House, a tie vote means the vote does not pass. - -

-

* result
-The official result of the vote. This is not completely standardized (both "Passed" and "Bill Passed" may appear). In the case of a vote for Speaker of the House, the result field contains the name of the victor. - -

-

source
-The original, official source XML for this vote information. - -

-

Associated Bill

-
"bill_id": "hr41-113",
-"bill": {
-  "bill_id": "hr41-113",
-  "bill_type": "hr",
-  "congress": 113
-  ...
-}
-
-

* bill_id
-If a vote is related to a bill, the bill's ID. - -

-

bill
-If a vote is related to a bill, some basic fields about the bill. - -

-

Voters

-
"voter_ids": {
-  "A000055": "Yea",
-  "A000361": "Yea"
-  ...
-},
-"voters": {
-  "A000055": {
-    "vote": "Yea",
-    "voter": {
-      "bioguide_id": "A000055",
-      "chamber": "house"
-      ...
-    }
-  },
-  "A000361": {
-    "vote": "Yea",
-    "voter": {
-      "bioguide_id": "A000361",
-      "chamber": "house"
-      ...
-    }
-  }
-  ...
-}
-
-

Most votes are "Yea", "Nay", "Present", and "Not Voting". There are exceptions: in the Senate, impeachment votes are "Guilty" or "Not Guilty". In the House, votes for the Speaker of the House are the name of the person being voted for (e.g. "Pelosi" or "Boehner"). There may be other exceptions. - -

-

voter_ids
-An object connecting bioguide IDs of members to the vote values they cast. - -

-

voters
-An object connecting bioguide IDs to their vote value, and some basic information about the voter. - -

-

voters.vote
-The value of the vote this voter cast. - -

-

voters.voter
-Some basic fields about the voter. - -

-

Vote Breakdown

-
"breakdown": {
-  "total": {
-    "Yea": 62,
-    "Nay": 36,
-    "Not Voting": 2,
-    "Present": 0
-  },
-  "party": {
-    "R": {
-      "Yea": 9,
-      "Nay": 36,
-      "Not Voting": 0,
-      "Present": 0
-    },
-    "D": {
-      "Yea": 52,
-      "Not Voting": 1,
-      "Nay": 0,
-      "Present": 0
-    },
-    "I": {
-      "Not Voting": 1,
-      "Yea": 1,
-      "Nay": 0,
-      "Present": 0
-    }
-  }
-}
-
-

The vote breakdown gives top-level numbers about what votes were cast. - -

-

Most votes are "Yea", "Nay", "Present", and "Not Voting". There are exceptions: in the Senate, impeachment votes are "Guilty" or "Not Guilty". In the House, votes for the Speaker of the House are the name of the person being voted for (e.g. "Pelosi" or "Boehner"). There may be other exceptions. - -

-

Values for "Present" and "Not Voting" will always be present, no matter what kind of vote it is. - -

-

These fields are dynamic, but can all be filtered on. - -

-

* breakdown.total.[vote]
-The number of members who cast [vote], where [vote] is a valid vote as defined above. - -

-

* breakdown.party.[party].[vote]
-The number of members of [party] who cast [vote], where [party] is one of "D", "R", or "I", and [vote] is a valid vote as defined above.

- -
-
- - - - \ No newline at end of file diff --git a/source/votes.md b/votes.md similarity index 95% rename from source/votes.md rename to votes.md index 1d43a4e5..369037dc 100644 --- a/source/votes.md +++ b/votes.md @@ -1,3 +1,7 @@ +--- +layout: page +title: Votes +--- # Votes Roll call votes taken by the House and Senate. This data is taken from original [House](http://clerk.house.gov/legislative/legvotes.aspx) and [Senate](http://www.senate.gov/pagelayout/legislative/a_three_sections_with_teasers/votes.htm) sources, and goes back to 2009. @@ -10,9 +14,9 @@ Votes taken by voice or unanimous consent, where the votes of individual represe All requests require a valid [API key](index.html#parameters/api-key), and use the domain: -```text +{% highlight text %} http://congress.api.sunlightfoundation.com -``` +{% endhighlight %} ### /votes @@ -20,15 +24,15 @@ Search and filter through votes in Congress. Filter by any [fields below](#field **Recent votes in the Senate** -```text +{% highlight text %} /votes?chamber=senate&order=voted_at -``` +{% endhighlight %} **Votes about 'guns'** -```text +{% highlight text %} /votes?query=guns -``` +{% endhighlight %} This will search votes' `question` field. @@ -40,7 +44,7 @@ This will search votes' `question` field. \* = can be used as a filter -```json +{% highlight json %} { "roll_id": "h7-2013", "chamber": "house", @@ -55,7 +59,7 @@ This will search votes' `question` field. "result": "Passed", "source": "http://clerk.house.gov/evs/2013/roll007.xml" } -``` +{% endhighlight %} \* **roll_id**
A unique identifier for a roll call vote. Made from the first letter of the `chamber`, the vote `number`, and the legislative `year`. @@ -95,7 +99,7 @@ The original, official source XML for this vote information. ### Associated Bill -```json +{% highlight json %} { "bill_id": "hr41-113", "bill": { @@ -105,7 +109,7 @@ The original, official source XML for this vote information. ... } } -``` +{% endhighlight %} \* **bill_id**
If a vote is related to a bill, the bill's ID. @@ -115,7 +119,7 @@ If a vote is related to a bill, some basic fields about the bill. ### Voters -```json +{% highlight json %} { "voter_ids": { "A000055": "Yea", @@ -142,7 +146,7 @@ If a vote is related to a bill, some basic fields about the bill. ... } } -``` +{% endhighlight %} Most votes are "Yea", "Nay", "Present", and "Not Voting". There are exceptions: in the Senate, impeachment votes are "Guilty" or "Not Guilty". In the House, votes for the Speaker of the House are the name of the person being voted for (e.g. "Pelosi" or "Boehner"). There may be other exceptions. @@ -160,7 +164,7 @@ Some basic fields about the voter. ### Vote Breakdown -```json +{% highlight json %} { "breakdown": { "total": { @@ -191,7 +195,7 @@ Some basic fields about the voter. } } } -``` +{% endhighlight %} The vote **breakdown** gives top-level numbers about what votes were cast.