Congressional Speech Project

search

Congressional Record Data

Providing API access to researchers

How to use the API

Usage

The 'speeches' table contains the following columns:

"id", "speaker_state", "congress", "origin_url", "the_order", "chamber", "speaking", "speaker_party", "bills", "pages", "speaker_raw", "speaker_first", "speaker_last", "title", "number", "volume", "session", "capitolwords_url", "date", "bioguide_id", "origin_id"

List

List all speeches.

GET http://congressionalspeech.lib.uiowa.edu/api.php/speeches

note: Listing ALL data is not recommended. See rules for filtering and searching below.

Output:

{  
  "speeches":{  
     "columns":[  
        "id",
        "speaker_state",
        "congress",
        "origin_url",
        "the_order",
        "chamber",
        "speaking",
        "speaker_party",
        "bills",
        "pages",
        "speaker_raw",
        "speaker_first",
        "speaker_last",
        "title",
        "number",
        "volume",
        "session",
        "capitolwords_url",
        "date",
        "bioguide_id",
        "origin_id"
     ],
     "records":[  
        [  
           1,
           "HI",
           104,
           "http:\/\/origin.www.gpo.gov\/fdsys\/pkg\/CREC-1996-03-13\/html\/CREC-1996-03-13-pt1-PgE336.htm",
           "0",
           "Extensions",
           "            Mr. Speaker,
           I rise today to share the experiences of Pamela Ferguson-Brey. She is the Honolulu League of Women Voters Human Resource chair and she atteded the
          ...
          ...
          ...
          ...
        ]
      ]
    }
          

List + Transform

List all records and transform them to objects (as formatted in the read operation below).

GET http://congressionalspeech.lib.uiowa.edu/api.php/speeches?transform=1

note: This transform is CPU and memory intensive.

Read

If you want to read a single object you can use:

GET http://congressionalspeech.lib.uiowa.edu/api.php/speeches/1

Output:

{  
  "id":1,
  "speaker_state":"HI",
  "congress":104,
  "origin_url":"http:\/\/origin.www.gpo.gov\/fdsys\/pkg\/CREC-1996-03-13\/html\/CREC-1996-03-13-pt1-PgE336.htm",
  "the_order":"0",
  "chamber":"Extensions",
  "speaking":"Mr. Speaker, I rise today to share the experiences of Pamela Ferguson-Brey. She is the Honolulu League of Women Voters Human Resource chair and she atteded the U.N. Fourth World Conference on Women in Beijing, China.In September, 1995, I joined women from around the world at the United Nations Fourth World Conference in China. The Non- Governmental Organization (NGO) conference provided a platform for community organizations from around the world to influence their governments to move more quickly toward equal rights and human rights for women and girls. The NGO forum also provided women from around the world with a forum to highlight issues from their neighborhood, town, city, region, and country and brought participants together to discuss local, national, international solutions to these issues. The NGO conference was an overwhelming experience. From the moment that I first boarded the plane to China and during the conference there was an unspoken acknowledgment, a bond and an excitement between the conference participants. Tens of thousands of women from around the world together for one purpose--to accelerate the movement of governments toward equal human rights for women and girls. While we were strangers and did not all speak the same language or have the same customs, we all shared a unique understanding about our status as women. As women, we know what it means to be denied human rights because of our gender status. As women, we know what is means to be afraid of violence because we are not safe in our streets or in our homes. We know what is means to be denied equal access to reproductive and medical care. We know what is means to be denied a seat at the table when policy decisions are being made about our lives and rights. And we know that in over a dozen counties, through infanticide and dowry deaths, women and girls are killed because of their gender. The bond between women at the conference was also a reflection of the commitment that these thousands of women had to make to realize the changes that are necessary at the local, national and international level to assure that women have equal human rights. At the opening ceremony to the NGO conference NGO participants sang ``I'm going to fight for women's freedom, never turning back, never turning back.'' I think of these words and the conference and I am recommitted and energized to help my own community move forward more quickly toward equal human rights for women and girls.",
  "speaker_party":"D",
  "bills":"",
  "pages":"E336",
  "speaker_raw":"mr. abercrombie",
  "speaker_first":"Neil",
  "speaker_last":"Abercrombie",
  "title":"INTERNATIONAL WOMEN'S DAY",
  "number":34,
  "volume":142,
  "session":2,
  "capitolwords_url":"http:\/\/capitolwords.org\/date\/1996\/03\/13\/E336_international-womens-day\/",
  "date":"1996-03-13",
  "bioguide_id":"A000014",
  "origin_id":"CREC-1996-03-13-pt1-PgE336.chunk0"
}

Read (multiple)

If you want to read multiple objects you can use:

GET http://congressionalspeech.lib.uiowa.edu/api.php/speeches/1,2

Output:

[  
  {  
     "id":1,
     "speaker_state":"HI",
     "congress":104,
     "origin_url":"http:\/\/origin.www.gpo.gov\/fdsys\/pkg\/CREC-1996-03-13\/html\/CREC-1996-03-13-pt1-PgE336.htm",
     "the_order":"0",
     "chamber":"Extensions",
     "speaking":"Mr. Speaker, I rise today to share the experiences of Pamela Ferguson-Brey. She is the Honolulu League of Women Voters Human Resource chair and she atteded the U.N. Fourth World Conference on Women in Beijing, China.In September, 1995, I joined women from around the world at the United Nations Fourth World Conference in China. The Non- Governmental Organization (NGO) conference provided a platform for community organizations from around the world to influence their governments to move more quickly toward equal rights and human rights for women and girls. The NGO forum also provided women from around the world with a forum to highlight issues from their neighborhood, town, city, region, and country and brought participants together to discuss local, national, international solutions to these issues. The NGO conference was an overwhelming experience. From the moment that I first boarded the plane to China and during the conference there was an unspoken acknowledgment, a bond and an excitement between the conference participants. Tens of thousands of women from around the world together for one purpose--to accelerate the movement of governments toward equal human rights for women and girls. While we were strangers and did not all speak the same language or have the same customs, we all shared a unique understanding about our status as women. As women, we know what it means to be denied human rights because of our gender status. As women, we know what is means to be afraid of violence because we are not safe in our streets or in our homes. We know what is means to be denied equal access to reproductive and medical care. We know what is means to be denied a seat at the table when policy decisions are being made about our lives and rights. And we know that in over a dozen counties, through infanticide and dowry deaths, women and girls are killed because of their gender. The bond between women at the conference was also a reflection of the commitment that these thousands of women had to make to realize the changes that are necessary at the local, national and international level to assure that women have equal human rights. At the opening ceremony to the NGO conference NGO participants sang ``I'm going to fight for women's freedom, never turning back, never turning back.'' I think of these words and the conference and I am recommitted and energized to help my own community move forward more quickly toward equal human rights for women and girls.",
     "speaker_party":"D",
     "bills":"",
     "pages":"E336",
     "speaker_raw":"mr. abercrombie",
     "speaker_first":"Neil",
     "speaker_last":"Abercrombie",
     "title":"INTERNATIONAL WOMEN'S DAY",
     "number":34,
     "volume":142,
     "session":2,
     "capitolwords_url":"http:\/\/capitolwords.org\/date\/1996\/03\/13\/E336_international-womens-day\/",
     "date":"1996-03-13",
     "bioguide_id":"A000014",
     "origin_id":"CREC-1996-03-13-pt1-PgE336.chunk0"
  },
  {  
     "id":2,
     "speaker_state":"HI",
     "congress":104,
     "origin_url":"http:\/\/origin.www.gpo.gov\/fdsys\/pkg\/CREC-1996-03-27\/html\/CREC-1996-03-27-pt1-PgH2932-2.htm",
     "the_order":"1",
     "chamber":"House",
     "speaking":"Mr. Speaker, I yield to the gentlewoman from Connecticut [Ms. DeLauro].",
     "speaker_party":"D",
     "bills":"",
     "pages":"H2932-H2934",
     "speaker_raw":"mr. abercrombie",
     "speaker_first":"Neil",
     "speaker_last":"Abercrombie",
     "title":"REINTRODUCTION OF THE NATIONAL INFRASTRUCTURE DEVELOPMENT ACT OF 1996",
     "number":44,
     "volume":142,
     "session":2,
     "capitolwords_url":"http:\/\/capitolwords.org\/date\/1996\/03\/27\/H2932-2_reintroduction-of-the-national-infrastructure-deve\/",
     "date":"1996-03-27",
     "bioguide_id":"A000014",
     "origin_id":"CREC-1996-03-27-pt1-PgH2932-2.chunk1"
  }
]

List + Filter

Search is implemented with the "filter" parameter. You need to specify the column name, a comma, the match type, another commma and the value you want to filter on. These are supported match types:

Example: list all speeches after January 1, 2002

GET http://congressionalspeech.lib.uiowa.edu/api.php/speeches?filter=date,gt,2002-01-01

Example: list all speeches by John Doolittle

GET http://congressionalspeech.lib.uiowa.edu/api.php/speeches?filter=speaker_last,cs,Doolittle&speaker_first,cs,John

You can negate all filters by prepending a 'n' character, so that 'eq' becomes 'neq'.

GET http://congressionalspeech.lib.uiowa.edu/api.php/speeches?filter=speaking,eq,Voters
GET http://congressionalspeech.lib.uiowa.edu/api.php/speeches?filter=speaking,sw,Vote
GET http://congressionalspeech.lib.uiowa.edu/api.php/speeches?filter=id,le,1
GET http://congressionalspeech.lib.uiowa.edu/api.php/speeches?filter=id,ngt,2
GET http://congressionalspeech.lib.uiowa.edu/api.php/speeches?filter=id,bt,1,1
GET http://congressionalspeech.lib.uiowa.edu/api.php/speeches?filter=speeches.id,eq,1

note: You may specify table name before the field name, seperated with a dot.

List + Filter + Satisfy

Multiple filters can be applied by using "filter[]" instead of "filter" as a parameter name. Then the parameter "satisfy" is used to indicate whether "all" (default) or "any" filter should be satisfied to lead to a match:

GET http://congressionalspeech.lib.uiowa.edu/api.php/speeches?filter[]=id,eq,1&filter[]=id,eq,3&satisfy=any
GET http://congressionalspeech.lib.uiowa.edu/api.php/speeches?filter[]=id,ge,1&filter[]=id,le,3&satisfy=all
GET http://congressionalspeech.lib.uiowa.edu/api.php/speeches?filter[]=id,ge,1&filter[]=id,le,3&satisfy=speeches.all
GET http://congressionalspeech.lib.uiowa.edu/api.php/speeches?filter[]=id,ge,1&filter[]=id,le,3

List + Column selection

By default all columns are selected. With the "columns" parameter you can select specific columns. Multiple columns should be comma separated. An asterisk ("*") may be used as a wildcard to indicate "all columns". Similar to "columns" you may use the "exclude" parameter to remove certain columns:

GET http://congressionalspeech.lib.uiowa.edu/api.php/speeches?columns=speaking
GET http://congressionalspeech.lib.uiowa.edu/api.php/speeches?columns=speeches.speaking
GET http://congressionalspeech.lib.uiowa.edu/api.php/speeches?exclude=speeches.id

note: Columns that are used to include related entities are automatically added and cannot be left out of the output.

List + Order

With the "order" parameter you can sort. By default the sort is in ascending order, but by specifying "desc" this can be reversed:

GET http://congressionalspeech.lib.uiowa.edu/api.php/speeches?order=speaker_state,desc
GET http://congressionalspeech.lib.uiowa.edu/api.php/speaking?order[]=speaker_state,desc&order[]=id

note: You may sort on multiple fields by using "order[]" instead of "order" as a parameter name.

List + Order + Pagination

The "page" parameter holds the requested page. The default page size is 20, but can be adjusted (e.g. to 50):

GET http://congressionalspeech.lib.uiowa.edu/api.php/speeches?order=id&page=1
GET http://congressionalspeech.lib.uiowa.edu/api.php/speeches?order=id&page=1,50

note: Pages that are not ordered cannot be paginated.