# Table of Contents - [Senate Committee API — Open Legislation 2.0-alpha documentation](#senate-committee-api-open-legislation-2-0-alpha-documentation) - [Unknown](#unknown) - [Senate Floor Transcripts API — Open Legislation 2.0-alpha documentation](#senate-floor-transcripts-api-open-legislation-2-0-alpha-documentation) - [NYS Laws API — Open Legislation 2.0-alpha documentation](#nys-laws-api-open-legislation-2-0-alpha-documentation) - [Hearing Transcripts API — Open Legislation 2.0-alpha documentation](#hearing-transcripts-api-open-legislation-2-0-alpha-documentation) - [Senate Members API — Open Legislation 2.0-alpha documentation](#senate-members-api-open-legislation-2-0-alpha-documentation) - [Search APIs — Open Legislation 2.0-alpha documentation](#search-apis-open-legislation-2-0-alpha-documentation) - [Aggregate Updates API — Open Legislation 2.0-alpha documentation](#aggregate-updates-api-open-legislation-2-0-alpha-documentation) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) --- # Senate Committee API — Open Legislation 2.0-alpha documentation * [](https://legislation.nysenate.gov/static/docs/html/reference.html) » * **Senate Committee API** * [View page source](https://legislation.nysenate.gov/static/docs/html/_sources/committees.rst.txt) * * * **Senate Committee API**[¶](https://legislation.nysenate.gov/static/docs/html/committees.html#senate-committee-api "Permalink to this headline") ================================================================================================================================================= In OpenLegislation, committee data is processed in a way that tracks the membership of each committee over time. Committees are stored as committee versions, each of which represent a time period where there were no changes in committee membership for a specific committee. Committee versions contain a list of members in the committee, information on where and when the committee meets, and the dates when the committee version began and was reformed. Get a current committee version[¶](https://legislation.nysenate.gov/static/docs/html/committees.html#get-a-current-committee-version "Permalink to this headline") ------------------------------------------------------------------------------------------------------------------------------------------------------------------- Note Assembly committee data is currently not sent to us at this time. chamber must be ‘senate’. **Usage** /api/3/committees/{session}/{chamber}/{committeeName} **Example** /api/3/committees/2013/senate/Cultural%20Affairs,%20Tourism,%20Parks%20and%20Recreation (Get the current version of the Cultural Affairs, Tourism, Parks and Recreation committee) **Sample Response** See [committee version response](https://legislation.nysenate.gov/static/docs/html/committees.html#committee-version-response) Get a committee version at specific time[¶](https://legislation.nysenate.gov/static/docs/html/committees.html#get-a-committee-version-at-specific-time "Permalink to this headline") ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- This request will return a committee version (if one exists) corresponding to the given committee that was created before or on the given time and reformed after the given time. **Usage** /api/3/committees/{session}/{chamber}/{committeeName}/{ISODateTime} **Example** /api/3/committees/2013/senate/Finance/2014\-03\-01T09:30:00 (Get the codes committee at 9:30 AM on March 1st, 2014) **Sample Response** { "success" : true, "message" : "", "responseType" : "committee", "result" : { "chamber" : "SENATE", // The chamber of this committee (SENATE or ASSEMBLY) "name" : "Finance", // The name of this committee "sessionYear" : 2013, // The session year of this committee version "referenceDate" : "2014-02-28T11:25:44", // The date and time that this configuration // of committee members was reported "reformed" : "2014-03-03T17:09:09", // The date and time that this configuration // of committee members was replaced // If null, then this is the current committee version "location" : "Room 124 CAP", // The location where this committee meets "meetDay" : "TUESDAY", // The day of the week that this committee meets "meetTime" : "11:00", // The time of day that this committee meets "meetAltWeek" : false, // True if this committee meets on alternate weeks "meetAltWeekText" : "", // Describes the committee's alternate schedule if applicable "committeeMembers" : { // A listing of members in this committee "items" : \[\ {\ "memberId" : 376, // An arbitrary unique id used to identify members\ // in our database\ "shortName" : "DEFRANCISCO", // The committee member's lbdc shortname\ "sessionYear" : 2013, // The session year this member was active in\ "fullName" : "John A. DeFrancisco", // The member's full name\ "districtCode" : 50, // A code designating the member's home district\ "sequenceNo" : 1, // The member's position in the list of committee members\ "title" : "CHAIR\_PERSON" // The member's role in the committee\ // Valid roles include:\ // "CHAIR\_PERSON", "VICE\_CHAIR", and "MEMBER"\ },\ ...\ \], "size" : 24 } } } Get committee history[¶](https://legislation.nysenate.gov/static/docs/html/committees.html#get-committee-history "Permalink to this headline") ----------------------------------------------------------------------------------------------------------------------------------------------- **Usage** /api/3/committees/{session}/{chamber}/{committeeName}/history **Optional Params** | Parameter | Values | Description | | --- | --- | --- | | full | boolean | (default false) Set to true to see the full committee responses instead of the summaries. | | limit | string | (default 50) Limit the number of results | | offset | number | (default 1) Start results from offset | | order | string | (default ‘DESC’) Determines the order the committee responses. Sorted by created date. | **Example** /api/3/committees/2013/senate/Aging/history (Get 2013 history for the aging committee) /api/3/committees/2013/senate/Aging/history?limit=1&order=ASC&full=true (Get the first version of the Aging committee from 2013) Get all current committees[¶](https://legislation.nysenate.gov/static/docs/html/committees.html#get-all-current-committees "Permalink to this headline") --------------------------------------------------------------------------------------------------------------------------------------------------------- **Usage** /api/3/committees/{session}/{chamber} **Optional Params** | Parameter | Values | Description | | --- | --- | --- | | full | boolean | (default false) Set to true to get full committee responses instead of summaries. | **Example** /api/3/committees/2013/senate?&full=true (Get full responses for all current senate committees for session 2013) Search for committees[¶](https://legislation.nysenate.gov/static/docs/html/committees.html#search-for-committees "Permalink to this headline") ----------------------------------------------------------------------------------------------------------------------------------------------- Read our [search API docs](https://legislation.nysenate.gov/static/docs/html/search_api.html) for info on how to construct search terms. The committee search index is comprised of full committee responses (i.e. the json response returned when requesting a single committee) so query and sort strings will be based on that response structure. **Usage** Search across all session years: (GET) /api/3/committees/search?term=YOUR\_TERM Search within a session year: (GET) /api/3/committees/{sessionYear}/search?term=YOUR\_TERM **Required Params** | Parameter | Values | Description | | --- | --- | --- | | term | string | [ElasticSearch query string](https://legislation.nysenate.gov/static/docs/html/search_api.html#search-term) | **Optional Params** | Parameter | Values | Description | | --- | --- | --- | | sort | string | [ElasticSearch sort string](https://legislation.nysenate.gov/static/docs/html/search_api.html#search-sort) | | current | boolean | (default true) Searches only current committee versions if true | Also takes all [committee history optional params](https://legislation.nysenate.gov/static/docs/html/committees.html#comm-history-params) with the exception of order --- # Unknown \*\*Open Legislation v2.0 API Docs\*\* ================================== What is this? ------------- \`Open Legislation\`\_ is a web service that delivers legislative information from the New York State Senate and Assembly to the public in near-real time. It is used to serve legislative data for \`nysenate.gov\`\_ and other various services. Legislative data is sent via the Legislative Bill Drafting Commission (LBDC) in a raw file format. The data is ingested and cleaned up internally by Open Leg and made available for consumption through a REST API. This documentation explains how to utilize the REST API to retrieve bills, resolutions, laws, committee agendas, and more. You will need to sign up for a free API key from the Open Legislation homepage in order to use this service. The code is open source and available on \`Github\`\_. .. \_Open Legislation: http://legislation.nysenate.gov .. \_nysenate.gov: http://www.nysenate.gov .. \_Github: http://github.com/nysenate/OpenLegislation API Usage --------- \*\*Obtaining a key\*\* To register and obtain an API key, visit our main page \`here \`\_. \*\*Making requests\*\* All URIs listed in these docs are relative to the Open Legislation subdomain:: legislation.nysenate.gov To make an API request using your key, set the key string as the value of the 'key' request parameter in the request URL. For example, if you wanted to get data for bill S1 of the 2015 session, your request would look something like this:: legislation.nysenate.gov/api/3/bills/2015/S1?key=\*your key goes here\* Legislative Content Types ------------------------- We currently offer the following types of data: - Bills and Resolutions - Committee Agendas - Senate Calendars - NYS Laws - Senate Floor and Hearing Transcripts - Committees - Members Terminology ----------- First let's define some common legislative terminology :Session Year: A legislative session year in New York State comprises of two years, with the first year being an odd numbered year. :Bill: A bill is passed with the intention of amending or creating a specific portion of NYS Law. :Resolution: A resolution does not necessarily impact law and are often introduced to provide honorable mentions. :Calendar: A legislative calendar is a snapshot of the status of bills that are under discussion at a particular time. A calendar will typically contain a floor calendar and an active list, along with supplemental floor calendars and active lists. :Floor Calendar: The floor calendar is a listing of all bills that are under discussion (on the floor). A bill must be read on the senate floor a minimum of three times to be eligible for a vote, and the floor calendar will indicate the number of readings for each bill at its time of publication. :Active List: An active list is a listing of bills that are scheduled for discussion during a single senate session. :Committee: Committees are groups of senators that are focused on particular areas of law. Bills must be approved by a committee in order to be reported to the senate floor. :Uni-Bill: A uni bill is a bill that is sent through both chambers concurrently --- # Senate Floor Transcripts API — Open Legislation 2.0-alpha documentation * [](https://legislation.nysenate.gov/static/docs/html/reference.html) » * **Senate Floor Transcripts API** * [View page source](https://legislation.nysenate.gov/static/docs/html/_sources/transcripts_floor.rst.txt) * * * **Senate Floor Transcripts API**[¶](https://legislation.nysenate.gov/static/docs/html/transcripts_floor.html#senate-floor-transcripts-api "Permalink to this headline") ======================================================================================================================================================================== Note Assembly transcripts are not available at this time. Get a single Transcript[¶](https://legislation.nysenate.gov/static/docs/html/transcripts_floor.html#get-a-single-transcript "Permalink to this headline") ---------------------------------------------------------------------------------------------------------------------------------------------------------- **Usage** Retrieve transcript by dateTime and sessionType. The sessionType is only required if two transcripts have the same dateTime: (GET) /api/3/transcripts/{dateTime} (GET) /api/3/transcripts/{dateTime}/{sessionType} **Examples** Request transcript 2014-09-03T09:00: /api/3/transcripts/2014\-09\-03T09:00 **Response** Full Transcript Response { "success" : true, // Indicates if a transcript was found. "message" : "Data for transcript 2014-09-03T09:00:00", // Response description. "responseType" : "transcript", // Response data type. "result" : { "dateTime" : "2014-09-03T09:00", // The date and time of the session. "sessionType" : "REGULAR SESSION", // Session type "location" : "ALBANY, NEW YORK", // Location of senate session. "text" : "5100\\n\\n 1 NEW YORK STATE SE.." // The text of the transcript. } } Request the extraordinary session 3 transcript on 2010-12-31T10:00: /api/3/transcripts/2010\-12\-31T10:00/EXTRAORDINARY SESSION III **Response** Full Transcript Response { "success" : true, "message" : "Data for transcript 2010-12-31T10:00", "responseType" : "transcript", "result" : { "dateTime" : "2010-12-31T10:00", "sessionType" : "EXTRAORDINARY SESSION III", "location" : "ALBANY, NEW YORK", "text" : "..." } } Get a transcript pdf[¶](https://legislation.nysenate.gov/static/docs/html/transcripts_floor.html#get-a-transcript-pdf "Permalink to this headline") ---------------------------------------------------------------------------------------------------------------------------------------------------- **Usage** Retrieve transcript pdf by dateTime. The sessionType is only required if two transcripts have the same dateTime: (GET) /api/3/transcripts/{dateTime}.pdf (GET) /api/3/transcripts/{dateTime}/{sessionType}.pdf **Examples** Request transcript 2014-09-03T09:00: /api/3/transcripts/2014\-09\-03T09:00 Get a list of transcripts[¶](https://legislation.nysenate.gov/static/docs/html/transcripts_floor.html#get-a-list-of-transcripts "Permalink to this headline") -------------------------------------------------------------------------------------------------------------------------------------------------------------- **Usage** List transcripts within a year: (GET) /api/3/transcripts/{year} **Optional Params** | Parameter | Values | Description | | --- | --- | --- | | limit | 1 - 1000 | Number of results to return | | offset | \> 1 | Result number to start from | | full | boolean | Set to true to see the full transcript responses. | | sort | string | Sort by any field from the response. | **Examples** List 50 transcripts from 2014: /api/3/transcripts/2014?limit=50 List 50 complete transcripts starting from 51: /api/3/transcripts/2014?limit=50%offset=51&full=true List 10 complete transcripts sorted by increasing date: /api/3/transcripts/2014?limit=10&full=true **Response** { "success" : true, // True if request was fine. "message" : "", "responseType" : "transcript list", "total" : 167, // Total transcripts in the listing "offsetStart" : 1, // Offset value "offsetEnd" : 0, // To paginate, set query param offset = {offsetEnd + 1} "limit" : 10, // Max number of results to show "result" : { "items": \[{ ... }\], // Array of transcript responses "size": 10 } } --- # NYS Laws API — Open Legislation 2.0-alpha documentation * [](https://legislation.nysenate.gov/static/docs/html/reference.html) » * **NYS Laws API** * [View page source](https://legislation.nysenate.gov/static/docs/html/_sources/laws.rst.txt) * * * **NYS Laws API**[¶](https://legislation.nysenate.gov/static/docs/html/laws.html#nys-laws-api "Permalink to this headline") =========================================================================================================================== In order to utilize the Laws API we’ll go over some quick terminology: Law Id A three letter code that identifies the law, e.g. EDN for Education Law. Document Id A string that identifies a particular document within a body of law. Contains the three letter law id so it can uniquely identify a document. Location Id This is simply the document id without the three letter law id prefix. Published Date Since the nature of laws are fairly temporal we keep track of changes to the laws using the published date. It’s possible to retrieve law documents roughly as they were represented during any week since October 2014. * * * Get a list of law ids[¶](https://legislation.nysenate.gov/static/docs/html/laws.html#get-a-list-of-law-ids "Permalink to this headline") ----------------------------------------------------------------------------------------------------------------------------------------- **Usage** (GET) /api/3/laws **Optional Params** | Parameter | Values | Description | | --- | --- | --- | | limit | 1 - 1000 | Number of results to return | | offset | \>= 1 | Result number to start from | **Response** { "success": true, "message": "Listing of consolidated and unconsolidated NYS Laws", "responseType": "law-info list", "total": 134, "offsetStart": 1, "offsetEnd": 134, "limit": 0, "result": { "items": \[\ {\ "lawId": "ABC",\ "name": "Alcoholic Beverage Control",\ "lawType": "CONSOLIDATED",\ "chapter": "3-B"\ },\ {\ "lawId": "ABP",\ "name": "Abandoned Property",\ "lawType": "CONSOLIDATED",\ "chapter": "1"\ },\ (truncated)\ \ The _lawId_ in the response is the three letter id for the law.\ \ Get the law structure[¶](https://legislation.nysenate.gov/static/docs/html/laws.html#get-the-law-structure "Permalink to this headline")\ \ -----------------------------------------------------------------------------------------------------------------------------------------\ \ Laws are represented as a collection of sub documents, each of which is structured within a hierarchy. The following call will provide the structure of the law.\ \ **Usage**\ \ (GET) /api/3/laws/{lawId}\ \ **Optional Params**\ \ \ | Parameter | Values | Description |\ | --- | --- | --- |\ | date | ISO date | Fetch law structure as it appeared prior to or on this date. |\ | full | boolean | If set to true, all the law text will also be returned. |\ \ **Examples**\ \ /api/3/laws/ABC // Get latest law structure for ABC law\ /api/3/laws/TAX?date=2015-01-01 // Get law structure for TAX law as it appeared on or before 01/01/2015\ /api/3/laws/EDN?full=true // Get latest law structure for EDN law as well as the text body of the law\ \ **Response**\ \ // /api/3/laws/RPT\ {\ "success": true,\ "message": "The document structure for RPT law",\ "responseType": "law-tree",\ "result": {\ "lawVersion": {\ "lawId": "RPT", // Three letter law id\ "activeDate": "2015-01-02" // Date on which this law content was up to date\ },\ "info": {\ "lawId": "RPT",\ "name": "Real Property Tax", // Name of the law\ "lawType": "CONSOLIDATED", // One of CONSOLIDATED, UNCONSOLIDATED, COURT\_ACTS, RULES, MISC\ "chapter": "50-A" // Chapter of law\ },\ "documents": { // This is a repeating document structure\ "lawId": "RPT",\ "locationId": "-CH50-A", // The location id identifes this sub document within this law\ "title": "Real Property Tax", // Title of this sub document if available.\ "docType": "CHAPTER",\ "docLevelId": "50-A", // The doc level id identifies the sub document within the current\ // level in the hierarchy. For example if 'docType' is ARTICLE\ // and docLevelId is 1, it means this is Article 1.\ \ "activeDate": "2014-09-22", // Date this particular document was updated\ "sequenceNo": 1, // Preserves ordering of sub documents\ "repealedDate": null, // Date this document was repealed (if applicable)\ "repealed": false, // This will be true if the document was repealed,\ // 'repealedDate' will be set with the date.\ "text": null, // Text of this document (only set when ?full=true)\ "documents": { // Contains the sub documents of this document\ "items": \[ // It's a recursive structure\ {\ "lawId": "RPT",\ "locationId": "A1",\ "title": "SHORT TITLE; DEFINITIONS",\ "docType": "ARTICLE",\ "docLevelId": "1",\ "activeDate": "2014-09-22",\ "sequenceNo": 2,\ "repealedDate": null,\ "text": null,\ "documents": {\ "items": \[\ {\ "lawId": "RPT",\ "locationId": "100",\ "title": "Short title",\ "docType": "SECTION",\ "docLevelId": "100",\ "activeDate": "2014-09-22",\ "sequenceNo": 3,\ "repealedDate": null,\ "text": null,\ "documents": { // Note there are no sub documents for this doc\ "items": \[\],\ "size": 0\ },\ "repealed": false\ },\ (truncated)\ \ When the request parameter **full** is set to true the ‘text’ fields within all the sub-documents will contain the text body. Note that response can be rather large (several MB) for certain laws so keep that in mind.\ \ If you want to retrieve a specific law document use the following API call:\ \ Get a law sub document[¶](https://legislation.nysenate.gov/static/docs/html/laws.html#get-a-law-sub-document "Permalink to this headline")\ \ -------------------------------------------------------------------------------------------------------------------------------------------\ \ **Usage**\ \ (GET) /api/3/laws/{lawId}/{locationId}\ \ The lawId once again is the three letter code (e.g. EDN, TAX) and locationId is the identifier for the sub document. You can discover the locationId when you make an API request for the law structure (see above section). See the ‘locationId’ field for that response.\ \ **Examples**\ \ /api/3/laws/TAX/8/ // Get section 8 of Tax law\ /api/3/laws/EDN/A2/ // Get article 2 of Education law\ \ Note\ \ A trailing slash is important for this API call because the locationId may have periods which would otherwise be interpreted as an extension of sorts. When in doubt, try adding the trailing slash.\ \ **Response**\ \ The response here is straight-forward.\ \ {\ "success" : true,\ "message" : "Law document for location A2 in EDN law ",\ "responseType" : "law-doc-info-detail",\ "result" : {\ "lawId" : "EDN",\ "lawName" : "Education",\ "locationId" : "A2",\ "title" : "Dignity For All Students",\ "docType" : "ARTICLE",\ "docLevelId" : "2",\ "activeDate" : "2019-05-03",\ "text" : "ARTICLE 2 (text truncated for brevity)" // The text body of the law will be here,\ "parentLocationIds" : \[ "-CH16", "T1" \],\ "parents" : \[ {\ "lawId" : "EDN",\ "lawName" : "Education",\ "locationId" : "-CH16",\ "title" : "Education",\ "docType" : "CHAPTER",\ "docLevelId" : "16",\ "activeDate" : "2019-11-01"\ }, {\ "lawId" : "EDN",\ "lawName" : "Education",\ "locationId" : "T1",\ "title" : "General Provisions Article 1 Short Title and Definitions (§§",\ "docType" : "TITLE",\ "docLevelId" : "1",\ "activeDate" : "2019-04-19"\ } \],\ "prevSibling" : {\ "lawId" : "EDN",\ "lawName" : "Education",\ "locationId" : "A1",\ "title" : "Short Title and Definitions",\ "docType" : "ARTICLE",\ "docLevelId" : "1",\ "activeDate" : "2014-09-22"\ },\ "nextSibling" : {\ "lawId" : "EDN",\ "lawName" : "Education",\ "locationId" : "A3",\ "title" : "Education Department",\ "docType" : "ARTICLE",\ "docLevelId" : "3",\ "activeDate" : "2014-09-22"\ }\ }\ }\ \ If the law document was not found you will receive an error response\ \ {\ "success": false,\ "message": "The requested law document was not found",\ "responseType": "error",\ "errorCode": 21,\ "errorData": {\ "lawDocId": "EDNA22",\ "endDate": "2015-01-09"\ },\ "errorDataType": "law-doc-query"\ }\ \ Search for law documents[¶](https://legislation.nysenate.gov/static/docs/html/laws.html#search-for-law-documents "Permalink to this headline")\ \ -----------------------------------------------------------------------------------------------------------------------------------------------\ \ **Usage**\ \ (GET) /api/3/laws/search?term= // Search across all law volumes\ (GET) /api/3/laws/{lawId}/search?term= // Search within a specific law volume\ \ **Required Params**\ \ \ | Parameter | Values | Description |\ | --- | --- | --- |\ | term | string | The full text search term. |\ \ **Optional Params**\ \ \ | Parameter | Values | Description |\ | --- | --- | --- |\ | sort | string | Sort using any field from the result object, e.g. lawId:ASC |\ | limit | 1 - 1000 | Number of results to return (high limits take longer) |\ | offset | \>= 1 | Result number to start from |\ \ **Examples**\ \ /api/3/laws/search?term=chickens // Search all law volumes for the word 'chickens'\ \ Get law document updates[¶](https://legislation.nysenate.gov/static/docs/html/laws.html#get-law-document-updates "Permalink to this headline")\ \ -----------------------------------------------------------------------------------------------------------------------------------------------\ \ To identify which documents have been modified or added to a body of law, use the law updates API.\ \ To detect updates to the structure of the law document tree, see [Get law tree updates](https://legislation.nysenate.gov/static/docs/html/laws.html#get-law-tree-updates)\ .\ \ Note\ \ Law updates are received in a batch update on a weekly basis, so updates that occur during the week will only be visible at the end of that week.\ \ **Usage**\ \ List of laws updated during the given date/time range:\ \ /api/3/laws/updates/{fromDateTime}/{toDateTime}\ \ Note\ \ The fromDateTime and toDateTime should be formatted as the ISO Date Time format. For example December 10, 2014, 1:30:02 PM should be inputted as 2014-12-10T13:30:02. The fromDateTime and toDateTime range is exclusive.\ \ All updates made on a specific body of law:\ \ /api/3/laws/{lawId}/updates/\ \ e.g. /api/3/laws/ABC/updates/\ /api/3/laws/VAT/updates/\ \ All updates made on a specific body of law during a date/time range:\ \ /api/3/laws/{lawId}/updates/{fromDateTime}/{toDateTime}\ \ **Optional Params**\ \ \ | Parameter | Values | Description |\ | --- | --- | --- |\ | type | (processed\|published) | The type of law update |\ | detail | boolean | Set to true for updates to individual law documents. |\ | order | string (asc\|desc) | Order the results by update date/time |\ | limit | 1 - 1000 | Number of results to return (high limits take longer) |\ | offset | \>= 1 | Result number to start from |\ \ **Response**\ \ Global law updates:\ \ e.g. /api/3/laws/updates/2015-09-01T00:00:00/2015-10-01T00:00:00?type=published\ \ {\ success: true,\ message: "",\ responseType: "update-token list",\ total: 33,\ offsetStart: 1,\ offsetEnd: 33,\ limit: 50,\ result: {\ items: \[\ {\ id: {\ lawId: "RSS", // Which body of law was updated\ activeDate: "2015-08-07" // The active published date\ },\ contentType: "LAW",\ sourceId: "20150807.UPDATE",\ sourceDateTime: "2015-08-07T00:00", // Date of the source data\ processedDateTime: "2015-09-10T15:00:14.551822" // Date we processed this update\ }, (truncated..)\ \ Detailed law doc updates:\ \ e.g. /api/3/laws/updates/2015-09-01T00:00:00/2015-10-01T00:00:00?detail=true&type=published\ /api/3/laws/ABC/updates/\ \ {\ success: true,\ message: "",\ responseType: "update-digest list",\ total: 431,\ offsetStart: 1,\ offsetEnd: 50,\ limit: 50,\ result: {\ items: \[\ {\ id: {\ lawId: "ABC",\ locationId: "120", // Location id of doc that was updated\ publishedDate: "2014-09-22" // Published date of this doc\ },\ contentType: "LAW",\ sourceId: "DATABASE.LAW3",\ sourceDateTime: "2014-09-22T00:00",\ processedDateTime: "2015-06-04T14:36:01.426676",\ action: "Insert",\ scope: "Law Document",\ fields: { },\ fieldCount: 0\ },\ \ Get law tree updates[¶](https://legislation.nysenate.gov/static/docs/html/laws.html#get-law-tree-updates "Permalink to this headline")\ \ ---------------------------------------------------------------------------------------------------------------------------------------\ \ Gets a list of laws which have had structural changes over a specified date/time range.\ \ To see updates to the content of law documents, see [Get law document updates](https://legislation.nysenate.gov/static/docs/html/laws.html#get-law-document-updates)\ .\ \ **Usage**\ \ List of laws with tree updates during the given date/time range\ \ /api/3/laws/tree/updates\ /api/3/laws/tree/updates/{fromDateTime}?type=published\ /api/3/laws/tree/updates/{fromDateTime}/{toDateTime}?type=published\ \ The fromDateTime and toDateTime should be formatted as the ISO Date Time format. For example December 10, 2014, 1:30:02 PM should be inputted as 2014-12-10T13:30:02. The fromDateTime and toDateTime range is exclusive. If excluded, fromDateTime defaults to Jan 1 1970 and toDateTime defaults to the current datetime\ \ **Optional Params**\ \ \ | Parameter | Values | Description |\ | --- | --- | --- |\ | type | (processed\|published) | The type of law update |\ | order | string (asc\|desc) | Order the results by update date/time |\ | limit | 1 - 1000 | Number of results to return (high limits take longer) |\ | offset | \>= 1 | Result number to start from |\ \ **Response**\ \ Get law tree updates by published date:\ \ e.g. /api/3/laws/tree/updates/2016-10-06/2016-10-08?type=published\ \ {\ success: true,\ message: "",\ responseType: "update-token list",\ total: 23,\ offsetStart: 1,\ offsetEnd: 23,\ limit: 50,\ result: {\ items: \[\ {\ id: {\ lawId: "PAR", // Location id of doc that was updated\ activeDate: "2016-10-07" // Published date of this doc\ },\ contentType: "LAW",\ sourceId: "20161007.UPDATE",\ sourceDateTime: "2016-10-07T00:00",\ processedDateTime: "2017-08-15T12:40:02.271155"\ },\ (truncated)\ \ Get repealed laws[¶](https://legislation.nysenate.gov/static/docs/html/laws.html#get-repealed-laws "Permalink to this headline")\ \ ---------------------------------------------------------------------------------------------------------------------------------\ \ Gets a list of law documents that have been repealed with the option of restricting to a specified date/time range. The date/time range applies to the processed date of the law document, not the official repeal date.\ \ **Usage**\ \ List of laws repealed during the given date/time range:\ \ /api/3/laws/repealed\ \ **Optional Params**\ \ \ | Parameter | Values | Description |\ | --- | --- | --- |\ | fromDateTime | ISO 8601 datetime | default 1970-01-01 - The inclusive start time of the specified time range |\ | toDateTime | ISO 8601 datetime | default now - The inclusive end time of the specified time period |\ \ Get a law pdf[¶](https://legislation.nysenate.gov/static/docs/html/laws.html#get-a-law-pdf "Permalink to this headline")\ \ -------------------------------------------------------------------------------------------------------------------------\ \ **Usage**\ \ Retrieve law pdf by document id. Inputting only the law ID will get you the root node for that chapter:\ \ (GET) /pdf/laws/{docId}\ \ **Optional Params**\ \ \ | Parameter | Values | Description |\ | --- | --- | --- |\ | full | (true\|false) | Whether to get all the children of this document. |\ \ **Examples**\ \ Request law document CC0A1 and its children:\ \ /api/3/laws/CCOA1?full=true --- # Hearing Transcripts API — Open Legislation 2.0-alpha documentation * [](https://legislation.nysenate.gov/static/docs/html/reference.html) » * **Hearing Transcripts API** * [View page source](https://legislation.nysenate.gov/static/docs/html/_sources/transcripts_ph.rst.txt) * * * **Hearing Transcripts API**[¶](https://legislation.nysenate.gov/static/docs/html/transcripts_ph.html#hearing-transcripts-api "Permalink to this headline") =========================================================================================================================================================== Note Most Assembly hearings are not available at this time. Get a single Hearing[¶](https://legislation.nysenate.gov/static/docs/html/transcripts_ph.html#get-a-single-hearing "Permalink to this headline") ------------------------------------------------------------------------------------------------------------------------------------------------- **Usage** Retrieve hearing by id or filename: (GET) /api/3/hearings/{id} (GET) /api/3/hearings/{filename} **Examples** Request hearing 5: /api/3/hearings/5 Request hearing “10-29-13 NYsenate\_Flanagan\_Education\_FINAL.txt”: /api/3/hearings/10\-29\-13 NYsenate\_Flanagan\_Education\_FINAL.txt **Response** Full Hearing Response { "success" : true, // Indicates if a hearing was found. "message" : "Data for hearing 10-29..", // Response description "responseType" : "hearing", // Response data type "result" : { "id": 179 "filename" : "10-29-13 NYsenate\_Flanagan..", // Filename of hearing transcript "title" : "PUBLIC HEARING THE REGENTS RE..", // Title of hearing "date" : "2013-10-29", // Date of hearing "address" : "Senate Hearing Room\\n250 Br..", // Address of hearing "committees" : \[ { // List of committees/task forces/other groups holding the hearing\ "name" : "EDUCATION", // Name of committee/task force/other group\ "type" : "COMMITTEE" // Type of group, committee/task force/legislative commission/etc\ "chamber" : "SENATE" // Chamber of committee\ } \], "startTime" : "10:00", // Time the hearing started "endTime" : "14:00", // Time the hearing ended "text" : "\\n\\n\\n 1 BEFORE THE NE.." // The text of the hearing } } Get a hearing pdf[¶](https://legislation.nysenate.gov/static/docs/html/transcripts_ph.html#get-a-hearing-pdf "Permalink to this headline") ------------------------------------------------------------------------------------------------------------------------------------------- **Usage** Retrieve hearing pdf by id or filename: (GET) /api/3/hearings/{id}.pdf (GET) /api/3/hearings/{filename}.pdf **Examples** Request hearing 09-12-13 NYSsenate\_DeFrancisco\_Buffalo\_FINAL.txt: /api/3/hearings/09\-12\-13 NYSsenate\_DeFrancisco\_Buffalo\_FINAL.txt.pdf * * * Get a list of hearings[¶](https://legislation.nysenate.gov/static/docs/html/transcripts_ph.html#get-a-list-of-hearings "Permalink to this headline") ----------------------------------------------------------------------------------------------------------------------------------------------------- **Usage** List hearings within a year: (GET) /api/3/hearings/{year} **Optional Params** | Parameter | Values | Description | | --- | --- | --- | | limit | 1 - 1000 | Number of results to return | | offset | \> 1 | Result number to start from | | full | boolean | Set to true to see the full hearing responses. | | sort | string | Sort by any field from the response. | **Examples** List 50 hearings from 2014: /api/3/hearings/2014?limit=50 List 50 complete hearings starting from 51: /api/3/hearings/2014?limit=50%offset=51&full=true List 10 complete hearings sorted by increasing date: /api/3/hearings/2014?limit=10&full=true&sort=dateTime:ASC **Response** { "success" : true, // True if request was fine. "message" : "", "responseType" : "hearing-id list", "total" : 451, // Total hearings in the listing "offsetStart" : 1, // Offset value "offsetEnd" : 0, // To paginate, set query param offset = {offsetEnd + 1} "limit" : 10, // Max number of results to show "result" : { "items": \[{ ... }\], // Array of hearing responses "size": 10 } } --- # Senate Members API — Open Legislation 2.0-alpha documentation * [](https://legislation.nysenate.gov/static/docs/html/reference.html) » * **Senate Members API** * [View page source](https://legislation.nysenate.gov/static/docs/html/_sources/members.rst.txt) * * * **Senate Members API**[¶](https://legislation.nysenate.gov/static/docs/html/members.html#senate-members-api "Permalink to this headline") ========================================================================================================================================== Get a single Member[¶](https://legislation.nysenate.gov/static/docs/html/members.html#get-a-single-member "Permalink to this headline") ---------------------------------------------------------------------------------------------------------------------------------------- **Usage** Retrieve member by session year and member id (GET) /api/3/members/{sessionYear}/{id} **Optional Params** | Parameter | Values | Description | | --- | --- | --- | | full | boolean | (default true) Set to true to get a full member response instead of a summary. | **Examples** Get member with id 371 during 2013 session year. /api/3/members/2013/371 **Sample Response** { "success" : true, "message" : "", "responseType" : "member-sessions", "result" : { "memberId" : 371, "chamber" : "SENATE", "incumbent" : true, "fullName" : "James L. Seward", "shortName" : "SEWARD", "sessionShortNameMap" : { "2013" : \[ {\ "sessionMemberId" : 127,\ "shortName" : "SEWARD",\ "sessionYear" : 2013,\ "districtCode" : 51,\ "alternate" : false,\ "memberId" : 371\ } \] }, "person" : { "personId" : 190, "fullName" : "James L. Seward", "firstName" : "James", "middleName" : "L.", "lastName" : "Seward", "email" : "seward@senate.state.ny.us", "prefix" : "Senator", "suffix" : null, "verified" : true, "imgName" : "371\_james\_l.\_seward.jpg" } } } Get a list of members[¶](https://legislation.nysenate.gov/static/docs/html/members.html#get-a-list-of-members "Permalink to this headline") -------------------------------------------------------------------------------------------------------------------------------------------- **Usage** List members for a session year. (GET) /api/3/members/{sessionYear} List members in a chamber for a session year (GET) /api/3/members/{sessionYear}/{chamber} **Optional Params** | Parameter | Values | Description | | --- | --- | --- | | limit | 1 - 1000 | (default = 50) Number of results to return | | offset | \> 1 | (default = 1) Result number to start from | | full | boolean | (default = false) Set to true to see the full member responses. | | sort | string | (default = shortName:asc) Sort by any field from the response. | **Examples** List all members from session year 2013 /api/3/members/2013 List full member info for session members during session year 2011. Limit to 5 results. /api/3/members/2011/senate?full=true&limit=5 Search for members[¶](https://legislation.nysenate.gov/static/docs/html/members.html#search-for-members "Permalink to this headline") -------------------------------------------------------------------------------------------------------------------------------------- Read our [search API docs](https://legislation.nysenate.gov/static/docs/html/search_api.html) for info on how to construct search terms. **Usage** Search across all session years (GET) /api/3/members/search?term=YOUR\_TERM Search within a session year (GET) /api/3/members/{sessionYear}/search?term=YOUR\_TERM Note: given a sessionMemberId = #### in a session year yyyy, you can get the member that sessionMemberId is used by with: (GET) /api/3/members/search?term=sessionShortNameMap.yyyy.sessionMemberId=#### **Required Params** | Parameter | Values | Description | | --- | --- | --- | | term | string | [ElasticSearch query string](https://legislation.nysenate.gov/static/docs/html/search_api.html#search-term) | **Optional Params** | Parameter | Values | Description | | --- | --- | --- | | limit | 1 - 1000 | (default = 50) Number of results to return | | offset | \> 1 | (default = 1) Result number to start from | | full | boolean | (default = false) Set to true to see the full member responses. | | sort | string | (default = “”) Sort by any field from the response. | **Examples** List all members who have served district code 20 /api/3/members/search?term=districtCode:20 --- # Search APIs — Open Legislation 2.0-alpha documentation * [](https://legislation.nysenate.gov/static/docs/html/reference.html) » * **Search APIs** * [View page source](https://legislation.nysenate.gov/static/docs/html/_sources/search_api.rst.txt) * * * **Search APIs**[¶](https://legislation.nysenate.gov/static/docs/html/search_api.html#search-apis "Permalink to this headline") =============================================================================================================================== Most of the Open Legislation data APIs include search functionality. We built our search layer using elasticsearch and we aim to provide as much elasticsearch functionality as possible through the APIs. Every search layer API will have a required request parameter “term” and an optional request param “sort”. term[¶](https://legislation.nysenate.gov/static/docs/html/search_api.html#term "Permalink to this headline") ------------------------------------------------------------------------------------------------------------- The term parameter takes in an [elasticsearch query string](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#_field_names) . The simplest way to search is to send a general search term. For example, to search for legislation pertaining to apples, the following query will do the job: /api/3/bills/search?term=apples In addition to a simple search term, there are a number of advanced features available. Our search index is generated with data in the same JSON format as the API responses, so any response field that is nested under “result” is fair game for search. Going back to the previous example, a number of resolutions appear in the results for the apples search query. Looking back at the [bill response](https://legislation.nysenate.gov/static/docs/html/bills.html#bill-response) , we see that resolutions are designated by the “resolution” boolean under “billType”. In order to filter resolutions out of the search results, a field query can be chained to the original query using “AND”: /api/3/bills/search?term=apples%20AND%20billType.resolution:false For a full enumeration of query features see the [elasticsearch query string](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#_field_names) syntax. sort[¶](https://legislation.nysenate.gov/static/docs/html/search_api.html#sort "Permalink to this headline") ------------------------------------------------------------------------------------------------------------- Searches can be sorted by any number valid response fields. This is accomplished using the sort request parameter, which takes a comma separated string of response fields, each designated with a sort order (“ASC” or “DESC”) separated from the field with a colon. Note When sorting using a text field, you must suffix the field name with `.keyword` e.g. `...&sort=printNo.keyword:ASC...` This does not apply to date and time fields, which are indexed in a different manner. For example, to get the 2013 governor’s program bills in canonical order: /api/3/bills/2013/search?term=programInfo.name:Governor%20AND%20NOT%20\_exists\_:substitutedBy &sort=programInfo.sequenceNo:ASC Or, you may want to order them by their status and action date: /api/3/bills/2013/search?term=programInfo.name:Governor%20AND%20NOT%20\_exists\_:substitutedBy &sort=status.statusType.keyword:ASC,status.actionDate:DESC Search Response[¶](https://legislation.nysenate.gov/static/docs/html/search_api.html#search-response "Permalink to this headline") ----------------------------------------------------------------------------------------------------------------------------------- { "success": true, "message": "", "responseType": "search-results list", "total": 7, "offsetStart": 1, "offsetEnd": 7, "limit": 10, "result": { "items": \[\ {\ "result": { ... }, // A search result\ "rank": 0.3587615191936493 // The ranking of the search result\ },\ ... // More search results\ \], "size": 7 } } --- # Aggregate Updates API — Open Legislation 2.0-alpha documentation * [](https://legislation.nysenate.gov/static/docs/html/reference.html) » * **Aggregate Updates API** * [View page source](https://legislation.nysenate.gov/static/docs/html/_sources/agg_updates.rst.txt) * * * **Aggregate Updates API**[¶](https://legislation.nysenate.gov/static/docs/html/agg_updates.html#aggregate-updates-api "Permalink to this headline") ==================================================================================================================================================== Get aggregate updates[¶](https://legislation.nysenate.gov/static/docs/html/agg_updates.html#get-aggregate-updates "Permalink to this headline") ------------------------------------------------------------------------------------------------------------------------------------------------ **Usage** List of content that was updated during the given date/time range: /api/3/updates/{fromDateTime} /api/3/updates/{fromDateTime}/{toDateTime} Note The fromDateTime and toDateTime should be formatted as the ISO Date Time format. For example December 10, 2014, 1:30:02 PM should be inputted as 2014-12-10T13:30:02 **Optional Params** | Parameter | Values | Description | | --- | --- | --- | | type | (processed\|published) | The type of bill update (see below for explanation) | | detail | boolean | Set to true to see detailed update digests | | fields | boolean | Set to true to get updated fields with detailed digests | | content-type | string\[\] | Filter by content type (AGENDA, BILL, CALENDAR, LAW) | | order | string (asc\|desc) | Order the results by update date/time | | limit | integer | Number of results to return | | offset | integer | Result number to start from | There are two types of updates, ‘processed’ and ‘published’. Processed refers to the date that OpenLeg processed the data which is useful if you are trying to stay synchronized with OpenLeg. Published refers to the date during which data was intended to be published. This can differ from the processed date because OpenLeg can periodically reprocess it’s data to fix issues. By default the type is set to published. **Example** Get a detailed view of the first 50 agenda, bill, and calendar updates processed on March 17 2015: /api/3/updates/2019-01-17T00:00:00/2019-01-18T00:00:00?type=processed &content-type=AGENDA&content-type=BILL&content-type=CALENDAR &detail=true&fields=true&limit=50 **Response** { "success" : true, "message" : "", "responseType" : "update-token list", "total" : 11836, "offsetStart" : 1, "offsetEnd" : 50, "limit" : 50, "result" : { "items" : \[\ {\ "id" : { // Content identifier\ "basePrintNo": "S1948", // See content-specific updates pages\ "session": 2019,\ "basePrintNoStr": "S1948-2019"\ },\ "contentType" : "BILL",\ "sourceId": "2019-01-17-20.22.35.839069\_SENMEMO\_S01948.XML-1-SENMEMO",, // Id of the source that triggered the update\ "sourceDateTime" : "2019-01-17T20:22:35.839069", // Published date of the source document\ "processedDateTime" : "2019-01-17T20:26:24.673778", // Time when the update occurred\ \ // --- The following fields are returned only for update digests -------------------\ "action" : "Update", // Update action (Insert|Update|Delete)\ "scope" : "Bill Amendment", // Designates which part of the content was updated\ "fields" : { } // The updated fields, returned only if fields parameter is true\ "fieldCount": 1\ // ---------------------------------------------------------------------------------\ },\ ...\ \], "size" : 50 }, "fromDateTime" : "2014-01-10T00:00", "toDateTime" : "2015-03-18T13:16:17.383999999" } See the following pages for info on the unique update responses for each content type: * agenda update token response * agenda update digest response * [bill update token response](https://legislation.nysenate.gov/static/docs/html/bills.html#bill-update-token-response) * [bill update digest response](https://legislation.nysenate.gov/static/docs/html/bills.html#bill-update-digest-response) * [calendar update token response](https://legislation.nysenate.gov/static/docs/html/calendars.html#calendar-update-token-response) * [calendar update digest response](https://legislation.nysenate.gov/static/docs/html/calendars.html#calendar-update-digest-response) * [law update token response](https://legislation.nysenate.gov/static/docs/html/laws.html#law-update-token-response) * [law update digest response](https://legislation.nysenate.gov/static/docs/html/laws.html#law-update-digest-response) Warning This example uses processed date time. As we reprocess our data periodically, it’s possible this specific api call may not produce the result shown. However, the response you receive will follow the format in the example --- # Unknown \*\*Senate Committee API\*\* ======================== In OpenLegislation, committee data is processed in a way that tracks the membership of each committee over time. Committees are stored as committee versions, each of which represent a time period where there were no changes in committee membership for a specific committee. Committee versions contain a list of members in the committee, information on where and when the committee meets, and the dates when the committee version began and was reformed. Get a current committee version ------------------------------- .. note:: Assembly committee data is currently not sent to us at this time. chamber must be 'senate'. \*\*Usage\*\* :: /api/3/committees/{session}/{chamber}/{committeeName} \*\*Example\*\* :: /api/3/committees/2013/senate/Cultural%20Affairs,%20Tourism,%20Parks%20and%20Recreation (Get the current version of the Cultural Affairs, Tourism, Parks and Recreation committee) \*\*Sample Response\*\* See \`committee version response\`\_ Get a committee version at specific time ---------------------------------------- This request will return a committee version (if one exists) corresponding to the given committee that was created before or on the given time and reformed after the given time. \*\*Usage\*\* :: /api/3/committees/{session}/{chamber}/{committeeName}/{ISODateTime} \*\*Example\*\* :: /api/3/committees/2013/senate/Finance/2014-03-01T09:30:00 (Get the codes committee at 9:30 AM on March 1st, 2014) .. \_\`committee version response\`: \*\*Sample Response\*\* .. code-block:: javascript { "success" : true, "message" : "", "responseType" : "committee", "result" : { "chamber" : "SENATE", // The chamber of this committee (SENATE or ASSEMBLY) "name" : "Finance", // The name of this committee "sessionYear" : 2013, // The session year of this committee version "referenceDate" : "2014-02-28T11:25:44", // The date and time that this configuration // of committee members was reported "reformed" : "2014-03-03T17:09:09", // The date and time that this configuration // of committee members was replaced // If null, then this is the current committee version "location" : "Room 124 CAP", // The location where this committee meets "meetDay" : "TUESDAY", // The day of the week that this committee meets "meetTime" : "11:00", // The time of day that this committee meets "meetAltWeek" : false, // True if this committee meets on alternate weeks "meetAltWeekText" : "", // Describes the committee's alternate schedule if applicable "committeeMembers" : { // A listing of members in this committee "items" : \[\ {\ "memberId" : 376, // An arbitrary unique id used to identify members\ // in our database\ "shortName" : "DEFRANCISCO", // The committee member's lbdc shortname\ "sessionYear" : 2013, // The session year this member was active in\ "fullName" : "John A. DeFrancisco", // The member's full name\ "districtCode" : 50, // A code designating the member's home district\ "sequenceNo" : 1, // The member's position in the list of committee members\ "title" : "CHAIR\_PERSON" // The member's role in the committee\ // Valid roles include:\ // "CHAIR\_PERSON", "VICE\_CHAIR", and "MEMBER"\ },\ ...\ \], "size" : 24 } } } Get committee history --------------------- \*\*Usage\*\* :: /api/3/committees/{session}/{chamber}/{committeeName}/history .. \_comm-history-params: \*\*Optional Params\*\* +-----------+---------+---------------------------------------------------------------------------------------------+ | Parameter | Values | Description | +===========+=========+=============================================================================================+ | full | boolean | (default false) Set to true to see the full committee responses instead of the summaries. | +-----------+---------+---------------------------------------------------------------------------------------------+ | limit | string | (default 50) Limit the number of results | +-----------+---------+---------------------------------------------------------------------------------------------+ | offset | number | (default 1) Start results from offset | +-----------+---------+---------------------------------------------------------------------------------------------+ | order | string | (default 'DESC') Determines the order the committee responses. Sorted by created date. | +-----------+---------+---------------------------------------------------------------------------------------------+ \*\*Example\*\* :: /api/3/committees/2013/senate/Aging/history (Get 2013 history for the aging committee) /api/3/committees/2013/senate/Aging/history?limit=1&order=ASC&full=true (Get the first version of the Aging committee from 2013) Get all current committees -------------------------- \*\*Usage\*\* :: /api/3/committees/{session}/{chamber} \*\*Optional Params\*\* +-----------+---------+---------------------------------------------------------------------------------------------+ | Parameter | Values | Description | +===========+=========+=============================================================================================+ | full | boolean | (default false) Set to true to get full committee responses instead of summaries. | +-----------+---------+---------------------------------------------------------------------------------------------+ \*\*Example\*\* :: /api/3/committees/2013/senate?&full=true (Get full responses for all current senate committees for session 2013) Search for committees --------------------- Read our :doc:\`search API docs\` for info on how to construct search terms. The committee search index is comprised of full committee responses (i.e. the json response returned when requesting a single committee) so query and sort strings will be based on that response structure. \*\*Usage\*\* Search across all session years:: (GET) /api/3/committees/search?term=YOUR\_TERM Search within a session year:: (GET) /api/3/committees/{sessionYear}/search?term=YOUR\_TERM \*\*Required Params\*\* +-----------+--------------------+--------------------------------------------------------+ | Parameter | Values | Description | +===========+====================+========================================================+ | term | string | :ref:\`ElasticSearch query string\` | +-----------+--------------------+--------------------------------------------------------+ \*\*Optional Params\*\* +--------------+--------------------+---------------------------------------------------------------------------------+ | Parameter | Values | Description | +==============+====================+=================================================================================+ | sort | string | :ref:\`ElasticSearch sort string\` | +--------------+--------------------+---------------------------------------------------------------------------------+ | current | boolean | (default true) Searches only current committee versions if true | +--------------+--------------------+---------------------------------------------------------------------------------+ Also takes all :ref:\`committee history optional params\` with the exception of order --- # Unknown \*\*Senate Floor Transcripts API\*\* ================================ .. note:: Assembly transcripts are not available at this time. Get a single Transcript ----------------------- \*\*Usage\*\* Retrieve transcript by dateTime and sessionType. The sessionType is only required if two transcripts have the same dateTime:: (GET) /api/3/transcripts/{dateTime} (GET) /api/3/transcripts/{dateTime}/{sessionType} \*\*Examples\*\* Request transcript 2014-09-03T09:00:: /api/3/transcripts/2014-09-03T09:00 \*\*Response\*\* Full Transcript Response .. code-block:: javascript { "success" : true, // Indicates if a transcript was found. "message" : "Data for transcript 2014-09-03T09:00:00", // Response description. "responseType" : "transcript", // Response data type. "result" : { "dateTime" : "2014-09-03T09:00", // The date and time of the session. "sessionType" : "REGULAR SESSION", // Session type "location" : "ALBANY, NEW YORK", // Location of senate session. "text" : "5100\\n\\n 1 NEW YORK STATE SE.." // The text of the transcript. } } Request the extraordinary session 3 transcript on 2010-12-31T10:00:: /api/3/transcripts/2010-12-31T10:00/EXTRAORDINARY SESSION III \*\*Response\*\* Full Transcript Response .. code-block:: javascript { "success" : true, "message" : "Data for transcript 2010-12-31T10:00", "responseType" : "transcript", "result" : { "dateTime" : "2010-12-31T10:00", "sessionType" : "EXTRAORDINARY SESSION III", "location" : "ALBANY, NEW YORK", "text" : "..." } } Get a transcript pdf -------------------- \*\*Usage\*\* Retrieve transcript pdf by dateTime. The sessionType is only required if two transcripts have the same dateTime:: (GET) /api/3/transcripts/{dateTime}.pdf (GET) /api/3/transcripts/{dateTime}/{sessionType}.pdf \*\*Examples\*\* Request transcript 2014-09-03T09:00:: /api/3/transcripts/2014-09-03T09:00 Get a list of transcripts ------------------------- \*\*Usage\*\* List transcripts within a year:: (GET) /api/3/transcripts/{year} \*\*Optional Params\*\* +-----------+--------------------+--------------------------------------------------------+ | Parameter | Values | Description | +===========+====================+========================================================+ | limit | 1 - 1000 | Number of results to return | +-----------+--------------------+--------------------------------------------------------+ | offset | > 1 | Result number to start from | +-----------+--------------------+--------------------------------------------------------+ | full | boolean | Set to true to see the full transcript responses. | +-----------+--------------------+--------------------------------------------------------+ | sort | string | Sort by any field from the response. | +-----------+--------------------+--------------------------------------------------------+ \*\*Examples\*\* List 50 transcripts from 2014:: /api/3/transcripts/2014?limit=50 List 50 complete transcripts starting from 51:: /api/3/transcripts/2014?limit=50%offset=51&full=true List 10 complete transcripts sorted by increasing date:: /api/3/transcripts/2014?limit=10&full=true \*\*Response\*\* .. code-block:: javascript { "success" : true, // True if request was fine. "message" : "", "responseType" : "transcript list", "total" : 167, // Total transcripts in the listing "offsetStart" : 1, // Offset value "offsetEnd" : 0, // To paginate, set query param offset = {offsetEnd + 1} "limit" : 10, // Max number of results to show "result" : { "items": \[{ ... }\], // Array of transcript responses "size": 10 } } --- # Unknown \*\*NYS Laws API\*\* ================ In order to utilize the Laws API we'll go over some quick terminology: :Law Id: A three letter code that identifies the law, e.g. EDN for Education Law. :Document Id: A string that identifies a particular document within a body of law. Contains the three letter law id so it can uniquely identify a document. :Location Id: This is simply the document id without the three letter law id prefix. :Published Date: Since the nature of laws are fairly temporal we keep track of changes to the laws using the published date. It's possible to retrieve law documents roughly as they were represented during any week since October 2014. ---------- Get a list of law ids --------------------- \*\*Usage\*\* :: (GET) /api/3/laws \*\*Optional Params\*\* +-----------+--------------------+--------------------------------------------------------+ | Parameter | Values | Description | +===========+====================+========================================================+ | limit | 1 - 1000 | Number of results to return | +-----------+--------------------+--------------------------------------------------------+ | offset | >= 1 | Result number to start from | +-----------+--------------------+--------------------------------------------------------+ \*\*Response\*\* .. code-block:: javascript { "success": true, "message": "Listing of consolidated and unconsolidated NYS Laws", "responseType": "law-info list", "total": 134, "offsetStart": 1, "offsetEnd": 134, "limit": 0, "result": { "items": \[\ {\ "lawId": "ABC",\ "name": "Alcoholic Beverage Control",\ "lawType": "CONSOLIDATED",\ "chapter": "3-B"\ },\ {\ "lawId": "ABP",\ "name": "Abandoned Property",\ "lawType": "CONSOLIDATED",\ "chapter": "1"\ },\ (truncated)\ \ The \*lawId\* in the response is the three letter id for the law.\ \ Get the law structure\ ---------------------\ \ Laws are represented as a collection of sub documents, each of which is structured within a hierarchy.\ The following call will provide the structure of the law.\ \ \*\*Usage\*\*\ ::\ \ (GET) /api/3/laws/{lawId}\ \ \*\*Optional Params\*\*\ \ +-----------+--------------------+--------------------------------------------------------------+\ | Parameter | Values | Description |\ +===========+====================+==============================================================+\ | date | ISO date | Fetch law structure as it appeared prior to or on this date. |\ +-----------+--------------------+--------------------------------------------------------------+\ | full | boolean | If set to true, all the law text will also be returned. |\ +-----------+--------------------+--------------------------------------------------------------+\ \ \*\*Examples\*\*\ ::\ \ /api/3/laws/ABC // Get latest law structure for ABC law\ /api/3/laws/TAX?date=2015-01-01 // Get law structure for TAX law as it appeared on or before 01/01/2015\ /api/3/laws/EDN?full=true // Get latest law structure for EDN law as well as the text body of the law\ \ \*\*Response\*\*\ \ .. code-block:: javascript\ \ // /api/3/laws/RPT\ {\ "success": true,\ "message": "The document structure for RPT law",\ "responseType": "law-tree",\ "result": {\ "lawVersion": {\ "lawId": "RPT", // Three letter law id\ "activeDate": "2015-01-02" // Date on which this law content was up to date\ },\ "info": {\ "lawId": "RPT",\ "name": "Real Property Tax", // Name of the law\ "lawType": "CONSOLIDATED", // One of CONSOLIDATED, UNCONSOLIDATED, COURT\_ACTS, RULES, MISC\ "chapter": "50-A" // Chapter of law\ },\ "documents": { // This is a repeating document structure\ "lawId": "RPT",\ "locationId": "-CH50-A", // The location id identifes this sub document within this law\ "title": "Real Property Tax", // Title of this sub document if available.\ "docType": "CHAPTER",\ "docLevelId": "50-A", // The doc level id identifies the sub document within the current\ // level in the hierarchy. For example if 'docType' is ARTICLE\ // and docLevelId is 1, it means this is Article 1.\ \ "activeDate": "2014-09-22", // Date this particular document was updated\ "sequenceNo": 1, // Preserves ordering of sub documents\ "repealedDate": null, // Date this document was repealed (if applicable)\ "repealed": false, // This will be true if the document was repealed,\ // 'repealedDate' will be set with the date.\ "text": null, // Text of this document (only set when ?full=true)\ "documents": { // Contains the sub documents of this document\ "items": \[ // It's a recursive structure\ {\ "lawId": "RPT",\ "locationId": "A1",\ "title": "SHORT TITLE; DEFINITIONS",\ "docType": "ARTICLE",\ "docLevelId": "1",\ "activeDate": "2014-09-22",\ "sequenceNo": 2,\ "repealedDate": null,\ "text": null,\ "documents": {\ "items": \[\ {\ "lawId": "RPT",\ "locationId": "100",\ "title": "Short title",\ "docType": "SECTION",\ "docLevelId": "100",\ "activeDate": "2014-09-22",\ "sequenceNo": 3,\ "repealedDate": null,\ "text": null,\ "documents": { // Note there are no sub documents for this doc\ "items": \[\],\ "size": 0\ },\ "repealed": false\ },\ (truncated)\ \ When the request parameter \*\*full\*\* is set to true the 'text' fields within all the sub-documents will contain\ the text body. Note that response can be rather large (several MB) for certain laws so keep that in mind.\ \ If you want to retrieve a specific law document use the following API call:\ \ Get a law sub document\ ----------------------\ \ \*\*Usage\*\*\ ::\ \ (GET) /api/3/laws/{lawId}/{locationId}\ \ The lawId once again is the three letter code (e.g. EDN, TAX) and locationId is the identifier for the sub document.\ You can discover the locationId when you make an API request for the law structure (see above section). See the\ 'locationId' field for that response.\ \ \*\*Examples\*\*\ ::\ \ /api/3/laws/TAX/8/ // Get section 8 of Tax law\ /api/3/laws/EDN/A2/ // Get article 2 of Education law\ \ .. note:: A trailing slash is important for this API call because the locationId may have periods which would otherwise be interpreted as an extension of sorts. When in doubt, try adding the trailing slash.\ \ \*\*Response\*\*\ \ The response here is straight-forward.\ \ .. code-block:: javascript\ \ {\ "success" : true,\ "message" : "Law document for location A2 in EDN law ",\ "responseType" : "law-doc-info-detail",\ "result" : {\ "lawId" : "EDN",\ "lawName" : "Education",\ "locationId" : "A2",\ "title" : "Dignity For All Students",\ "docType" : "ARTICLE",\ "docLevelId" : "2",\ "activeDate" : "2019-05-03",\ "text" : "ARTICLE 2 (text truncated for brevity)" // The text body of the law will be here,\ "parentLocationIds" : \[ "-CH16", "T1" \],\ "parents" : \[ {\ "lawId" : "EDN",\ "lawName" : "Education",\ "locationId" : "-CH16",\ "title" : "Education",\ "docType" : "CHAPTER",\ "docLevelId" : "16",\ "activeDate" : "2019-11-01"\ }, {\ "lawId" : "EDN",\ "lawName" : "Education",\ "locationId" : "T1",\ "title" : "General Provisions Article 1 Short Title and Definitions (§§",\ "docType" : "TITLE",\ "docLevelId" : "1",\ "activeDate" : "2019-04-19"\ } \],\ "prevSibling" : {\ "lawId" : "EDN",\ "lawName" : "Education",\ "locationId" : "A1",\ "title" : "Short Title and Definitions",\ "docType" : "ARTICLE",\ "docLevelId" : "1",\ "activeDate" : "2014-09-22"\ },\ "nextSibling" : {\ "lawId" : "EDN",\ "lawName" : "Education",\ "locationId" : "A3",\ "title" : "Education Department",\ "docType" : "ARTICLE",\ "docLevelId" : "3",\ "activeDate" : "2014-09-22"\ }\ }\ }\ \ If the law document was not found you will receive an error response\ \ .. code-block:: javascript\ \ {\ "success": false,\ "message": "The requested law document was not found",\ "responseType": "error",\ "errorCode": 21,\ "errorData": {\ "lawDocId": "EDNA22",\ "endDate": "2015-01-09"\ },\ "errorDataType": "law-doc-query"\ }\ \ Search for law documents\ ------------------------\ \ \*\*Usage\*\*\ ::\ \ (GET) /api/3/laws/search?term= // Search across all law volumes\ (GET) /api/3/laws/{lawId}/search?term= // Search within a specific law volume\ \ \*\*Required Params\*\*\ \ +-----------+--------------------+--------------------------------------------------------------+\ | Parameter | Values | Description |\ +===========+====================+==============================================================+\ | term | string | The full text search term. |\ +-----------+--------------------+--------------------------------------------------------------+\ \ \*\*Optional Params\*\*\ \ +-----------+--------------------+--------------------------------------------------------------+\ | Parameter | Values | Description |\ +===========+====================+==============================================================+\ | sort | string | Sort using any field from the result object, e.g. lawId:ASC |\ +-----------+--------------------+--------------------------------------------------------------+\ | limit | 1 - 1000 | Number of results to return (high limits take longer) |\ +-----------+--------------------+--------------------------------------------------------------+\ | offset | >= 1 | Result number to start from |\ +-----------+--------------------+--------------------------------------------------------------+\ \ \*\*Examples\*\*\ ::\ \ /api/3/laws/search?term=chickens // Search all law volumes for the word 'chickens'\ \ Get law document updates\ ------------------------\ \ To identify which documents have been modified or added to a body of law, use the law updates API.\ \ To detect updates to the structure of the law document tree, see \`Get law tree updates\`\_.\ \ .. note:: Law updates are received in a batch update on a weekly basis, so updates that occur during the week will only be visible at the end of that week.\ \ \*\*Usage\*\*\ \ List of laws updated during the given date/time range::\ \ /api/3/laws/updates/{fromDateTime}/{toDateTime}\ \ .. note:: The fromDateTime and toDateTime should be formatted as the ISO Date Time format. For example December 10, 2014, 1:30:02 PM should be inputted as 2014-12-10T13:30:02. The fromDateTime and toDateTime range is exclusive.\ \ All updates made on a specific body of law::\ \ /api/3/laws/{lawId}/updates/\ \ e.g. /api/3/laws/ABC/updates/\ /api/3/laws/VAT/updates/\ \ All updates made on a specific body of law during a date/time range::\ \ /api/3/laws/{lawId}/updates/{fromDateTime}/{toDateTime}\ \ \ \*\*Optional Params\*\*\ \ +-----------+----------------------+--------------------------------------------------------+\ | Parameter | Values | Description |\ +===========+======================+========================================================+\ | type | (processed|published)| The type of law update |\ +-----------+----------------------+--------------------------------------------------------+\ | detail | boolean | Set to true for updates to individual law documents. |\ +-----------+----------------------+--------------------------------------------------------+\ | order | string (asc|desc) | Order the results by update date/time |\ +-----------+----------------------+--------------------------------------------------------+\ | limit | 1 - 1000 | Number of results to return (high limits take longer) |\ +-----------+----------------------+--------------------------------------------------------+\ | offset | >= 1 | Result number to start from |\ +-----------+----------------------+--------------------------------------------------------+\ \ \*\*Response\*\*\ \ Global law updates::\ \ e.g. /api/3/laws/updates/2015-09-01T00:00:00/2015-10-01T00:00:00?type=published\ \ .. \_law-update-token-response:\ \ .. code-block:: javascript\ \ {\ success: true,\ message: "",\ responseType: "update-token list",\ total: 33,\ offsetStart: 1,\ offsetEnd: 33,\ limit: 50,\ result: {\ items: \[\ {\ id: {\ lawId: "RSS", // Which body of law was updated\ activeDate: "2015-08-07" // The active published date\ },\ contentType: "LAW",\ sourceId: "20150807.UPDATE",\ sourceDateTime: "2015-08-07T00:00", // Date of the source data\ processedDateTime: "2015-09-10T15:00:14.551822" // Date we processed this update\ }, (truncated..)\ \ Detailed law doc updates::\ \ e.g. /api/3/laws/updates/2015-09-01T00:00:00/2015-10-01T00:00:00?detail=true&type=published\ /api/3/laws/ABC/updates/\ \ .. \_law-update-digest-response:\ \ .. code-block:: javascript\ \ {\ success: true,\ message: "",\ responseType: "update-digest list",\ total: 431,\ offsetStart: 1,\ offsetEnd: 50,\ limit: 50,\ result: {\ items: \[\ {\ id: {\ lawId: "ABC",\ locationId: "120", // Location id of doc that was updated\ publishedDate: "2014-09-22" // Published date of this doc\ },\ contentType: "LAW",\ sourceId: "DATABASE.LAW3",\ sourceDateTime: "2014-09-22T00:00",\ processedDateTime: "2015-06-04T14:36:01.426676",\ action: "Insert",\ scope: "Law Document",\ fields: { },\ fieldCount: 0\ },\ \ Get law tree updates\ --------------------\ \ Gets a list of laws which have had structural changes over a specified date/time range.\ \ To see updates to the content of law documents, see \`Get law document updates\`\_.\ \ \*\*Usage\*\*\ \ List of laws with tree updates during the given date/time range\ ::\ \ /api/3/laws/tree/updates\ /api/3/laws/tree/updates/{fromDateTime}?type=published\ /api/3/laws/tree/updates/{fromDateTime}/{toDateTime}?type=published\ \ The fromDateTime and toDateTime should be formatted as the ISO Date Time format.\ For example December 10, 2014, 1:30:02 PM should be inputted as 2014-12-10T13:30:02.\ The fromDateTime and toDateTime range is exclusive.\ If excluded, fromDateTime defaults to Jan 1 1970 and toDateTime defaults to the current datetime\ \ \ \*\*Optional Params\*\*\ \ +-----------+----------------------+--------------------------------------------------------+\ | Parameter | Values | Description |\ +===========+======================+========================================================+\ | type | (processed|published)| The type of law update |\ +-----------+----------------------+--------------------------------------------------------+\ | order | string (asc|desc) | Order the results by update date/time |\ +-----------+----------------------+--------------------------------------------------------+\ | limit | 1 - 1000 | Number of results to return (high limits take longer) |\ +-----------+----------------------+--------------------------------------------------------+\ | offset | >= 1 | Result number to start from |\ +-----------+----------------------+--------------------------------------------------------+\ \ \*\*Response\*\*\ \ Get law tree updates by published date::\ \ e.g. /api/3/laws/tree/updates/2016-10-06/2016-10-08?type=published\ \ .. code-block:: javascript\ \ {\ success: true,\ message: "",\ responseType: "update-token list",\ total: 23,\ offsetStart: 1,\ offsetEnd: 23,\ limit: 50,\ result: {\ items: \[\ {\ id: {\ lawId: "PAR", // Location id of doc that was updated\ activeDate: "2016-10-07" // Published date of this doc\ },\ contentType: "LAW",\ sourceId: "20161007.UPDATE",\ sourceDateTime: "2016-10-07T00:00",\ processedDateTime: "2017-08-15T12:40:02.271155"\ },\ (truncated)\ \ Get repealed laws\ -----------------\ \ Gets a list of law documents that have been repealed with the option of restricting to a specified date/time range.\ The date/time range applies to the processed date of the law document, not the official repeal date.\ \ \*\*Usage\*\*\ \ List of laws repealed during the given date/time range::\ \ /api/3/laws/repealed\ \ \*\*Optional Params\*\*\ \ +--------------+----------------------+---------------------------------------------------------------------------+\ | Parameter | Values | Description |\ +==============+======================+===========================================================================+\ | fromDateTime | ISO 8601 datetime | default 1970-01-01 - The inclusive start time of the specified time range |\ +--------------+----------------------+---------------------------------------------------------------------------+\ | toDateTime | ISO 8601 datetime | default now - The inclusive end time of the specified time period |\ +--------------+----------------------+---------------------------------------------------------------------------+\ \ Get a law pdf\ ------------------------\ \ \*\*Usage\*\*\ \ Retrieve law pdf by document id.\ Inputting only the law ID will get you the root node for that chapter::\ \ (GET) /pdf/laws/{docId}\ \ \*\*Optional Params\*\*\ \ +-----------+----------------------+--------------------------------------------------------+\ | Parameter | Values | Description |\ +===========+======================+========================================================+\ | full | (true|false) | Whether to get all the children of this document. |\ +-----------+----------------------+--------------------------------------------------------+\ \ \*\*Examples\*\*\ \ Request law document CC0A1 and its children::\ \ /api/3/laws/CCOA1?full=true --- # Unknown \*\*Hearing Transcripts API\*\* ================================== .. note:: Most Assembly hearings are not available at this time. Get a single Hearing --------------------------- \*\*Usage\*\* Retrieve hearing by id or filename:: (GET) /api/3/hearings/{id} (GET) /api/3/hearings/{filename} \*\*Examples\*\* Request hearing 5:: /api/3/hearings/5 Request hearing "10-29-13 NYsenate\_Flanagan\_Education\_FINAL.txt":: /api/3/hearings/10-29-13 NYsenate\_Flanagan\_Education\_FINAL.txt \*\*Response\*\* Full Hearing Response .. code-block:: javascript { "success" : true, // Indicates if a hearing was found. "message" : "Data for hearing 10-29..", // Response description "responseType" : "hearing", // Response data type "result" : { "id": 179 "filename" : "10-29-13 NYsenate\_Flanagan..", // Filename of hearing transcript "title" : "PUBLIC HEARING THE REGENTS RE..", // Title of hearing "date" : "2013-10-29", // Date of hearing "address" : "Senate Hearing Room\\n250 Br..", // Address of hearing "committees" : \[ { // List of committees/task forces/other groups holding the hearing\ "name" : "EDUCATION", // Name of committee/task force/other group\ "type" : "COMMITTEE" // Type of group, committee/task force/legislative commission/etc\ "chamber" : "SENATE" // Chamber of committee\ } \], "startTime" : "10:00", // Time the hearing started "endTime" : "14:00", // Time the hearing ended "text" : "\\n\\n\\n 1 BEFORE THE NE.." // The text of the hearing } } Get a hearing pdf ------------------------ \*\*Usage\*\* Retrieve hearing pdf by id or filename:: (GET) /api/3/hearings/{id}.pdf (GET) /api/3/hearings/{filename}.pdf \*\*Examples\*\* Request hearing 09-12-13 NYSsenate\_DeFrancisco\_Buffalo\_FINAL.txt:: /api/3/hearings/09-12-13 NYSsenate\_DeFrancisco\_Buffalo\_FINAL.txt.pdf ----- Get a list of hearings ----------------------------- \*\*Usage\*\* List hearings within a year:: (GET) /api/3/hearings/{year} \*\*Optional Params\*\* +-----------+--------------------+--------------------------------------------------------+ | Parameter | Values | Description | +===========+====================+========================================================+ | limit | 1 - 1000 | Number of results to return | +-----------+--------------------+--------------------------------------------------------+ | offset | > 1 | Result number to start from | +-----------+--------------------+--------------------------------------------------------+ | full | boolean | Set to true to see the full hearing responses. | +-----------+--------------------+--------------------------------------------------------+ | sort | string | Sort by any field from the response. | +-----------+--------------------+--------------------------------------------------------+ \*\*Examples\*\* List 50 hearings from 2014:: /api/3/hearings/2014?limit=50 List 50 complete hearings starting from 51:: /api/3/hearings/2014?limit=50%offset=51&full=true List 10 complete hearings sorted by increasing date:: /api/3/hearings/2014?limit=10&full=true&sort=dateTime:ASC \*\*Response\*\* .. code-block:: javascript { "success" : true, // True if request was fine. "message" : "", "responseType" : "hearing-id list", "total" : 451, // Total hearings in the listing "offsetStart" : 1, // Offset value "offsetEnd" : 0, // To paginate, set query param offset = {offsetEnd + 1} "limit" : 10, // Max number of results to show "result" : { "items": \[{ ... }\], // Array of hearing responses "size": 10 } } --- # Unknown \*\*Senate Members API\*\* ====================== Get a single Member ------------------- \*\*Usage\*\* Retrieve member by session year and member id :: (GET) /api/3/members/{sessionYear}/{id} \*\*Optional Params\*\* +-----------+---------+---------------------------------------------------------------------------------------------+ | Parameter | Values | Description | +===========+=========+=============================================================================================+ | full | boolean | (default true) Set to true to get a full member response instead of a summary. | +-----------+---------+---------------------------------------------------------------------------------------------+ \*\*Examples\*\* Get member with id 371 during 2013 session year. :: /api/3/members/2013/371 \*\*Sample Response\*\* .. code-block:: javascript { "success" : true, "message" : "", "responseType" : "member-sessions", "result" : { "memberId" : 371, "chamber" : "SENATE", "incumbent" : true, "fullName" : "James L. Seward", "shortName" : "SEWARD", "sessionShortNameMap" : { "2013" : \[ {\ "sessionMemberId" : 127,\ "shortName" : "SEWARD",\ "sessionYear" : 2013,\ "districtCode" : 51,\ "alternate" : false,\ "memberId" : 371\ } \] }, "person" : { "personId" : 190, "fullName" : "James L. Seward", "firstName" : "James", "middleName" : "L.", "lastName" : "Seward", "email" : "seward@senate.state.ny.us", "prefix" : "Senator", "suffix" : null, "verified" : true, "imgName" : "371\_james\_l.\_seward.jpg" } } } Get a list of members --------------------- \*\*Usage\*\* List members for a session year. :: (GET) /api/3/members/{sessionYear} List members in a chamber for a session year :: (GET) /api/3/members/{sessionYear}/{chamber} \*\*Optional Params\*\* +-----------+--------------------+----------------------------------------------------------------------+ | Parameter | Values | Description | +===========+====================+======================================================================+ | limit | 1 - 1000 | (default = 50) Number of results to return | +-----------+--------------------+----------------------------------------------------------------------+ | offset | > 1 | (default = 1) Result number to start from | +-----------+--------------------+----------------------------------------------------------------------+ | full | boolean | (default = false) Set to true to see the full member responses. | +-----------+--------------------+----------------------------------------------------------------------+ | sort | string | (default = shortName:asc) Sort by any field from the response. | +-----------+--------------------+----------------------------------------------------------------------+ \*\*Examples\*\* List all members from session year 2013 :: /api/3/members/2013 List full member info for session members during session year 2011. Limit to 5 results. :: /api/3/members/2011/senate?full=true&limit=5 Search for members ------------------ Read our :doc:\`search API docs\` for info on how to construct search terms. \*\*Usage\*\* Search across all session years :: (GET) /api/3/members/search?term=YOUR\_TERM Search within a session year :: (GET) /api/3/members/{sessionYear}/search?term=YOUR\_TERM Note: given a sessionMemberId = #### in a session year yyyy, you can get the member that sessionMemberId is used by with: :: (GET) /api/3/members/search?term=sessionShortNameMap.yyyy.sessionMemberId=#### \*\*Required Params\*\* +-----------+--------------------+--------------------------------------------------------+ | Parameter | Values | Description | +===========+====================+========================================================+ | term | string | :ref:\`ElasticSearch query string\` | +-----------+--------------------+--------------------------------------------------------+ \*\*Optional Params\*\* +-----------+--------------------+----------------------------------------------------------------------+ | Parameter | Values | Description | +===========+====================+======================================================================+ | limit | 1 - 1000 | (default = 50) Number of results to return | +-----------+--------------------+----------------------------------------------------------------------+ | offset | > 1 | (default = 1) Result number to start from | +-----------+--------------------+----------------------------------------------------------------------+ | full | boolean | (default = false) Set to true to see the full member responses. | +-----------+--------------------+----------------------------------------------------------------------+ | sort | string | (default = "") Sort by any field from the response. | +-----------+--------------------+----------------------------------------------------------------------+ \*\*Examples\*\* List all members who have served district code 20 :: /api/3/members/search?term=districtCode:20 --- # Unknown \*\*Search APIs\*\* =============== Most of the Open Legislation data APIs include search functionality. We built our search layer using elasticsearch and we aim to provide as much elasticsearch functionality as possible through the APIs. Every search layer API will have a required request parameter "term" and an optional request param "sort". .. \_search-term: term ---- .. \_\`elasticsearch query string\`: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#\_field\_names The term parameter takes in an \`elasticsearch query string\`\_. The simplest way to search is to send a general search term. For example, to search for legislation pertaining to apples, the following query will do the job:: /api/3/bills/search?term=apples In addition to a simple search term, there are a number of advanced features available. Our search index is generated with data in the same JSON format as the API responses, so any response field that is nested under "result" is fair game for search. Going back to the previous example, a number of resolutions appear in the results for the apples search query. Looking back at the :ref:\`bill response\`, we see that resolutions are designated by the "resolution" boolean under "billType". In order to filter resolutions out of the search results, a field query can be chained to the original query using "AND":: /api/3/bills/search?term=apples%20AND%20billType.resolution:false For a full enumeration of query features see the \`elasticsearch query string\`\_ syntax. .. \_search-sort: sort ---- Searches can be sorted by any number valid response fields. This is accomplished using the sort request parameter, which takes a comma separated string of response fields, each designated with a sort order ("ASC" or "DESC") separated from the field with a colon. .. note:: When sorting using a text field, you must suffix the field name with \`\`.keyword\`\` e.g. \`\`...&sort=printNo.keyword:ASC...\`\` This does not apply to date and time fields, which are indexed in a different manner. For example, to get the 2013 governor's program bills in canonical order:: /api/3/bills/2013/search?term=programInfo.name:Governor%20AND%20NOT%20\_exists\_:substitutedBy &sort=programInfo.sequenceNo:ASC Or, you may want to order them by their status and action date:: /api/3/bills/2013/search?term=programInfo.name:Governor%20AND%20NOT%20\_exists\_:substitutedBy &sort=status.statusType.keyword:ASC,status.actionDate:DESC Search Response --------------- .. code-block:: javascript { "success": true, "message": "", "responseType": "search-results list", "total": 7, "offsetStart": 1, "offsetEnd": 7, "limit": 10, "result": { "items": \[\ {\ "result": { ... }, // A search result\ "rank": 0.3587615191936493 // The ranking of the search result\ },\ ... // More search results\ \], "size": 7 } } --- # Unknown \*\*Aggregate Updates API\*\* ========================= Get aggregate updates --------------------- \*\*Usage\*\* List of content that was updated during the given date/time range:: /api/3/updates/{fromDateTime} /api/3/updates/{fromDateTime}/{toDateTime} .. note:: The fromDateTime and toDateTime should be formatted as the ISO Date Time format. For example December 10, 2014, 1:30:02 PM should be inputted as 2014-12-10T13:30:02 \*\*Optional Params\*\* +--------------+----------------------+--------------------------------------------------------+ | Parameter | Values | Description | +==============+======================+========================================================+ | type | (processed|published)| The type of bill update (see below for explanation) | +--------------+----------------------+--------------------------------------------------------+ | detail | boolean | Set to true to see detailed update digests | +--------------+----------------------+--------------------------------------------------------+ | fields | boolean | Set to true to get updated fields with detailed digests| +--------------+----------------------+--------------------------------------------------------+ | content-type | string\[\] | Filter by content type (AGENDA, BILL, CALENDAR, LAW) | +--------------+----------------------+--------------------------------------------------------+ | order | string (asc|desc) | Order the results by update date/time | +--------------+----------------------+--------------------------------------------------------+ | limit | integer | Number of results to return | +--------------+----------------------+--------------------------------------------------------+ | offset | integer | Result number to start from | +--------------+----------------------+--------------------------------------------------------+ There are two types of updates, 'processed' and 'published'. Processed refers to the date that OpenLeg processed the data which is useful if you are trying to stay synchronized with OpenLeg. Published refers to the date during which data was intended to be published. This can differ from the processed date because OpenLeg can periodically reprocess it's data to fix issues. By default the type is set to published. \*\*Example\*\* Get a detailed view of the first 50 agenda, bill, and calendar updates processed on March 17 2015:: /api/3/updates/2019-01-17T00:00:00/2019-01-18T00:00:00?type=processed &content-type=AGENDA&content-type=BILL&content-type=CALENDAR &detail=true&fields=true&limit=50 \*\*Response\*\* .. code-block:: javascript { "success" : true, "message" : "", "responseType" : "update-token list", "total" : 11836, "offsetStart" : 1, "offsetEnd" : 50, "limit" : 50, "result" : { "items" : \[\ {\ "id" : { // Content identifier\ "basePrintNo": "S1948", // See content-specific updates pages\ "session": 2019,\ "basePrintNoStr": "S1948-2019"\ },\ "contentType" : "BILL",\ "sourceId": "2019-01-17-20.22.35.839069\_SENMEMO\_S01948.XML-1-SENMEMO",, // Id of the source that triggered the update\ "sourceDateTime" : "2019-01-17T20:22:35.839069", // Published date of the source document\ "processedDateTime" : "2019-01-17T20:26:24.673778", // Time when the update occurred\ \ // --- The following fields are returned only for update digests -------------------\ "action" : "Update", // Update action (Insert|Update|Delete)\ "scope" : "Bill Amendment", // Designates which part of the content was updated\ "fields" : { } // The updated fields, returned only if fields parameter is true\ "fieldCount": 1\ // ---------------------------------------------------------------------------------\ },\ ...\ \], "size" : 50 }, "fromDateTime" : "2014-01-10T00:00", "toDateTime" : "2015-03-18T13:16:17.383999999" } See the following pages for info on the unique update responses for each content type: \* :ref:\`agenda update token response\` \* :ref:\`agenda update digest response\` \* :ref:\`bill update token response\` \* :ref:\`bill update digest response\` \* :ref:\`calendar update token response\` \* :ref:\`calendar update digest response\` \* :ref:\`law update token response\` \* :ref:\`law update digest response\` .. warning:: This example uses processed date time. As we reprocess our data periodically, it's possible this specific api call may not produce the result shown. However, the response you receive will follow the format in the example ---