Git Product home page Git Product logo

nysenate / openlegislation Goto Github PK

View Code? Open in Web Editor NEW
447.0 56.0 96.0 127.01 MB

OpenLegislation 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 internally to serve up legislative data for nysenate.gov and the Bluebird-CRM.

Home Page: http://legislation.nysenate.gov/

License: Other

Shell 0.48% Java 73.96% JavaScript 9.39% CSS 0.49% HTML 10.87% PLpgSQL 4.62% Python 0.19%

openlegislation's Introduction

OpenLegislation

From the New York State Senate

Dual BSD/GPL License. See the NYSenate licensing page http://www.nysenate.gov/Open-Source-Software-Licenses.

Open Legislation is an open source web service developed in-house by the New York State Senate to provide access to NYS legislative data including bills, resolutions, and laws. Developers can request a free key for the JSON API at http://legislation.nysenate.gov/. The JSON API is documented at http://legislation.nysenate.gov/static/docs/html/.

Updates to legislative data are distributed by the Legislative Bill drafting Commission (LBDC) in a raw, plain text format. Open Legislation parses the updates in real time and redistributes the data through the JSON API for integration with various web applications. It is developed and run using several open-source technologies and frameworks including:

  • Java 17
  • Spring 5 Framework
  • PostgreSQL
  • Elasticsearch 7
  • React
  • Tomcat 8.5

Bill page demo

Current Senate Developers

Past Developers

openlegislation's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openlegislation's Issues

Blank Bill: A9270-2015

Our technologies stumbled across a "blank" bill.

GET http://legislation.nysenate.gov/api/3/bills/2015/A9270

{
  "success" : true,
  "message" : "Data for bill A9270-2015",
  "responseType" : "bill",
  "result" : {
    "basePrintNo" : "A9270",
    "session" : 2015,
    "printNo" : "A9270",
    "billType" : {
      "chamber" : "ASSEMBLY",
      "desc" : "Assembly",
      "resolution" : false
    },
    "title" : "",
    "activeVersion" : "",
    "year" : 2016,
    "publishedDateTime" : "2016-02-10T12:31:30",
    "substitutedBy" : null,
    "sponsor" : null,
    "summary" : "",
    "signed" : false,
    "adopted" : false,
    "vetoed" : false,
    "status" : {
      "statusType" : null,
      "statusDesc" : null,
      "actionDate" : null,
      "committeeName" : null,
      "billCalNo" : null
    },
    "milestones" : {
      "items" : [ ],
      "size" : 0
    },
    "programInfo" : null,
    "amendmentVersions" : {
      "items" : [ ],
      "size" : 0
    },
    "amendments" : {
      "items" : { },
      "size" : 0
    },
    "votes" : {
      "items" : [ ],
      "size" : 0
    },
    "vetoMessages" : {
      "items" : [ ],
      "size" : 0
    },
    "approvalMessage" : null,
    "additionalSponsors" : {
      "items" : [ ],
      "size" : 0
    },
    "pastCommittees" : {
      "items" : [ ],
      "size" : 0
    },
    "actions" : {
      "items" : [ ],
      "size" : 0
    },
    "previousVersions" : {
      "items" : [ ],
      "size" : 0
    },
    "committeeAgendas" : {
      "items" : [ ],
      "size" : 0
    },
    "calendars" : {
      "items" : [ ],
      "size" : 0
    }
  }
}

Compare this to an actual missing bill...

GET http://legislation.nysenate.gov/api/3/bills/2015/A9999

{
  "success" : false,
  "message" : "The requested bill was not found",
  "responseType" : "error",
  "errorCode" : 11,
  "errorData" : {
    "basePrintNo" : "A9999",
    "session" : 2015,
    "printNo" : "A9999",
    "version" : ""
  },
  "errorDataType" : "bill-id"
}

https support question

Thank you for the open legislation project.

This request is to add HTTPS support.

One question involves the support for HTTPS

HTTPS support is needed because in order to use the HTML5 service workers and have efficient caching of these large responses, HTTPS is the only supported connection.

Also HTTPS support is probably needed for the government api / sites to lessen the probability of man in the middle attacks.

https://www.nysenate.gov/ and
https://www.nysenate.gov/opendata seems to use a certificate from
http://acquia-sites.com/

message from browser says:

This is probably not the site you are looking for! You attempted to reach www.nysenate.gov , but
instead you actually reached a server identifying itself as acquia-sites.com. This may be caused by a
misconfiguration on the server or by something more serious. An attacker on your network could be
trying to get you to visit a fake (and potentially harmful) version of www.nysenate.gov. You should not
proceed

At https://www.nysenate.gov/opendata
we see

screen shot 2015-04-26 at 12 31 48 am

And at open.nysenate.gov there seems to be no SSL support at all.
At https://open.nysenate.gov/
we see

screen shot 2015-04-26 at 12 38 35 am

search?term=publishedDateTime:[2014-01-01%20TO%202014-01-02] throws HTTP 400

Not sure if this is actually just a malformed or erroneous example in the docs, but the very last example under Search for Bills is

(GET) /api/3/bills/2013/search?term=publishedDateTime:[2014-01-01 TO 2014-01-02]&sort=publishedDateTime:ASC

Which throws HTTP Status 400 โ€“ Bad Request when run. Tried with and without the key= field, no change.

Edit to add test link: https://legislation.nysenate.gov/api/3/bills/2013/search?term=publishedDateTime:[2014-01-01%20TO%202014-01-02]&sort=publishedDateTime:ASC

Idea: checksums or digital signatures for statute text

I'm kicking around ideas for enabling the end user to verify a website's text against the official API content. E.g., I pull from the API to create this page:

https://newyork.public.law/laws/n.y._insurance_law_section_3217-d

Now, how can I help site visitors verify that the text is unchanged and up to date? Currently I do two things:

  1. I link to the equivalent page at nysenate.gov:
Screenshot 2023-09-22 at 11 01 28 PM
  1. I wrote this explainer-style page:

https://newyork.public.law/laws/information-about-updates

I'd like to take this further

Somehow - maybe a browser plugin - that'd check the text after loading the page. My current best idea is to reduce the two texts to a normalized whitespace and then do a diff. It'd reflect the result to the user, and on demand show how it arrived at that result.

Now, if the API included e.g. a SHA checksum or public key-based signature, that could enable more scenarios.

Question re: Data Quality

Hello,

I have been using the Open Legislation REST API for a couple weeks now to easily load Laws metadata and statutory text into my iPhone app. One question, is the development team open to feedback regarding data quality? For example, with Rule 305 of the Civil Practice Law an Rules (CVP), the title of the Rule also includes some of the text of the Rule itself:

           "lawId" : "CVP",
          "lawName" : "Civil Practice Law & Rules",
          "locationId" : "305",
          "title" : "Rule 305. Summons; supplemental summons, amendment. (a) Summons; supplemental summons. A summons shall specify the basis of the venue d...",
          "docType" : "SECTION",
          "docLevelId" : "305",
          "activeDate" : "2014-09-22",
          "sequenceNo" : 44,
          "repealedDate" : null,
          "fromSection" : "305",
          "toSection" : "305",

As I encounter what I believe to be data quality issues, can I compile them into emails and submit them for review? If so, can you let me know which address to use?

Thank you,

Jon Stroble
Asst. Public Defender
Oneida County

Simple Question: how can we create a visualization that shows % of bills that become law?

It would be nice to know of the 60,000 bill actions and ~ 20,000 bills each year, how many actually become law?

Also how many bills actually have public hearings and public input?

Is this information available in the API?

This type of information would be very helpful.

It would be nice if the API site included charts and visualizations to help people understand the data.

Thanks for the API!

Member party affiliation

Hi! Thanks for this excellent and well-documented API.

Is there any way to get the party affiliation of a senate member? It doesn't seem to be a field available from the Members endpoint.

LAW API question

Thank you very much for the LAW API.

I have a question about the usage.

I did the following:

  • download the full ENV law for 2014-10-01
  • also downloaded full ENV law for 2015-05-23

I see at http://nygovernorstg.prod.acquia-sites.com/sites/governor.ny.gov/files/atoms/files/GPB1IVORYCHAPTERAMENDMENTBILL.pdf that shows the ENV 11-0535-A was modified recently to read

  • d. the ivory article or rhinoceros horn is part of a musical

INSTEAD OF

  • d. the ivory article or rhinoceros horn is less than twenty percent by volume

I expected to see the old text in the 2014-10-01 version but I see the new text in both the 2014-10-01 text and the 2015-05-23 text

Is this an issue or is it something that is misunderstood.

Thanks.

Here are the commands:

$ curl "http://openleg-dev.nysenate.gov/api/3/laws/ENV?date=2014-10-01&full=true&key=KEY-HERE"  |tee lawlog_2014-10-01.txt

$ grep -c "rhinoceros horn is part of a musical"  lawlog_2014-10-01.txt lawlog_2015-05-23.txt
lawlog_2014-10-01.txt:1
lawlog_2015-05-23.txt:1



Titles missing in VAT dataset

for the VAT JSON dataset that is returned by the API, the title is blank for all items.

Example:
{
"lawId" : "VAT",
"lawName" : "Vehicle & Traffic",
"locationId" : "241",
"title" : "", <-- THIS IS BLANK FOR ALL RECORDS OF THIS DATASET
"docType" : "SECTION",
"docLevelId" : "241",
"activeDate" : "2019-08-16",
"sequenceNo" : 179,
"repealedDate" : null,
"fromSection" : "241",
"toSection" : "241",

Can't find any contact info to let someone know this is happening..

Bulk Data Access - Caching/Reduce Server Load/Research

Hello NY Senate OpenLegislation Team!

First, I'd like to commend you, the NY Senate, and I suppose the entire State of New York for creating and hosting what is, in my experience, one of the most open and accessible systems for accessing State-level legislative information that exists in the USA today. Many kudos!

One thought/suggestion - it appears that there is not currently a bulk export/collection available for download. Having a batch generated (i.e. static) export available in say compressed JSON or Msgpack format would be advantageous:

  • A bulk export would allow for easier offline access (sadly, not everyone in our country - or even the State of New York - always has access to an internet connection)
    • On this note especially, my own experience in Manhattan of cellular data coverage is widely variable - especially in the multitude of buildings of NYC...
  • A bulk export could potentially reduce server load (I suspect that there are at least a few people out there who are already crawling the API to generate a complete dataset - providing a bulk export would obviate the need for those developers to perform a ton of API queries and would reduce load)
  • A bulk export is ideal for research purposes and can also be a great help for developers (assuming the bulk data format closely mirrors that of what the API returns)

A daily export of the data could be setup to run as a batch process (i.e. overnight during periods of low activity) and stored/delivered statically. (I've seen others attempt this as a "live generation" process - e.g. trigger the API to make a dump -- and while this does result in very up-to-date data, it does put a LOT of load on the servers... Not to mention download speeds are usually impacted.)

Additionally, if storage space is available, an archive of the exports could be very useful for researchers as well (e.g. researchers trying to track changes over time, etc.) ... If stored with deduplication, the overall amount of storage would probably be relatively low.

Thank you!

Offset not working when querying bills

I'm working on an app that utilizes the NY bill API, and I've run into an issue with querying for the entire set of bills for a session.

It seems as though the offset isn't working properly. No matter what I set as the offset, I always get the exact same list of bills.

For example, the following query returns a list of one bill, S8208:
http://legislation.nysenate.gov/api/3/bills/2015?offset=1&limit=1&full=false&key=****

But the following query returns the exact same result.
http://legislation.nysenate.gov/api/3/bills/2015?offset=5001&limit=1&full=false&key=****

Because the highest value the limit can be is 1000, I can only ever get 1000 of the NY bills. Thank you for your time.

Missing bill action from end of 2022 when compared to the Assembly website

Hi,

I noticed that there are several bills that don't have a few actions available in the API response, but when looking at the Assembly counterpart, actions do seem to be available.

IDs that I have noticed so far:

  • A 7006
  • S 4104
  • A 7063
  • S 6291

Example for A 7006, Assembly.
Screen Shot 2023-01-04 at 12 34 38 PM

Substitute Bill actions
Screen Shot 2023-01-04 at 12 39 54 PM

Is this an expected behavior of the API/data? If not, is there any timeline on when these actions might be added on the OpenLegislation API?

API maximum number of result issue

http://legislation.nysenate.gov/api/3/bills/2016?key=mykey&limit=1000&offset=10001&full=true

Hey, team. I am using your guys API and found an issue last Friday I think.
I cannot get any result when I did the query above. the following is the response JSON.
{
"success" : false,
"message" : "There was error retrieving your search results. Make sure that the query is valid.",
"responseType" : "error",
"errorCode" : 100,
"errorData" : "Unexpected Search Exception!",
"errorDataType" : "string"
}

And the same issue happened on the website version of API. Here is the snapshot.
looks like I cannot get more than 10000 records

Missing Assembly Vote Information

The API seems to be missing Vote information for all Assembly bills (vote information for the senate does appear in the API).

For example 2021-A9275 had 3 votes in the Assembly that do not appear in the API response (the votes in the senate do show).

Has Vote information:
https://nyassembly.gov/leg/?default_fld=%0D%0A&leg_video=&bn=A9275&term=2021&Summary=Y&Actions=Y&Committee%26nbspVotes=Y&Floor%26nbspVotes=Y

Missing Vote information:
https://legislation.nysenate.gov/api/3/bills/2021/A9275

p.s. thanks for your awesome work making this data available; I'm trying to build a view to score members sponsorship and voting based on select bills - and this is one limiting factor

https://legislation.support/jehiah-nyc/scorecard/ny-assembly
https://legislation.support/jehiah-nyc/scorecard/nysenate

Some members.items.fullName are invalid.

Not sure if you guys want me to continue reporting data issues on this repo, but there is an issue with some legislators' names being incomplete and in all caps. The two instances in the 2015-16 session are both in the Assembly,

{
  "success": true,
  "responseType": "member list",
  "total": 213,
  ...
  "result": {
    "items": [
      {
        "memberId": 912,
        "shortName": "RICHARDSON",
        "sessionYear": 2015,
        "chamber": "ASSEMBLY",
        "fullName": "RICHARDSON",
        "districtCode": 0,
        "imgName": null
      },
      {
        "memberId": 901,
        "shortName": "JEAN-PIERRE",
        "sessionYear": 2015,
        "chamber": "ASSEMBLY",
        "fullName": "JEAN-PIERRE",
        "districtCode": 11,
        "imgName": "901_jean-pierre.jpg"
      },
      ...
    ],
    "size": 213
  }
}

No Assembly Committees

GET /api/3/committees/2015/assembly returns:

{
  "success": true,
  "message": "",
  "responseType": "empty list",
  "total": 0,
  "offsetStart": 1,
  "offsetEnd": 0,
  "limit": 50,
  "result": {
    "items": [],
    "size": 0
  }
}

It doesn't appear to be a code issue, but a missing data issue. There aren't any Assembly committees in a wildcard search: GET /api/3/committees/2015/search?term=*. This is true for all years.

Delay between API and Assembly Website

Hello. I noticed today that there seems to be quite a few new bills located on the Assembly website that aren't yet available in the API (for ex: AB8739, AB8823, AB8832, AB8810, AB8762, AB8765, AB8772, AB8807, AB8829, AB8734), as well as some updated actions for existing bills. Will these be available in the API soon and can we expect a continual 1-day delay or so between the website and the API?

Thanks!

Timing for available data

Hello -

We are noticing a potential delay today with data from the API.

As of right now it appears the total number of bills available for session 2019 is 21938, with the latest bill number being S8224.

When spot checking on the NY Assembly website, appears the latest senate bill number at the moment is S8254.

Appears that the bills not yet available were introduced on 4/27.

Thanks!
Kenan

P.S. We love your API. It's still the best one across all the states.

It's not a issue but a question

Hey, Guys!
Thank you for keep improving the API.It's really a good tool and I appreciate it.
I have a small question about the agendas part in the API call.
So basically, I know NY Senate website has the agenda in the future.

But, correct me if I'm wrong, I didn't see the future agenda data in the API call.
If possible, could you guys put the future agenda data in the API call? like what Senate website did

A potential IP block on production server

Hey, guys!
It's me again. lol
On our production server, we send requests to the API maybe 4 or 5 times per day.
Today, I use CURL to test and get Could not resolve host: legislation.nysenate.gov error.

I use the same command and test on local. it works well. I can even open the JSON through my browser.

I assume maybe it's an IP block?
If it's not good to send request 5 times per day, we would eliminate that behavior.

Question: BaseURL for member.imgName?

What's the base URL for the imgName property of the member object returned by the API? Or is there a separate method/API call for returning the image file itself that I'm not finding in the docs?

Mechanism for identifying active members

Consider. https://legislation.nysenate.gov/api/3/members/2022/senate?limit=1000&key=REDACTED

this responds with a large list that contains

{
      "sessionMemberId" : 1864,
      "shortName" : "CLEARE",
      "sessionYear" : 2021,
      "districtCode" : 30,
      "alternate" : false,
      "memberId" : 1504
},

and

{
      "sessionMemberId" : 1798,
      "shortName" : "BENJAMIN",
      "sessionYear" : 2021,
      "districtCode" : 30,
      "alternate" : false,
      "memberId" : 1136
}, 

CLEARE is the active member having replaced BENJAMIN in a special election, but the API does not provide a way of determining that.

Observationally, the memberId and sessionMemberId are larger, which is likely to do with them being handed out in order, but this is not documented anywhere. Ideally, there would be a documented way to determine the active member in cases like this. I propose adding a boolean "active" : true which will be true for the member that is currently serving and false for a member that has been replaced.

An invalid API key issue

Hey, Guys! I am using your guys' API system for almost a year and it is an awesome project.
Just a small issue happened today.
I was able to use the API service last night. But I get a No search results were found A valid API key is needed to fulfill this request error message on the website now.

I don't think the API key is invalid since I have been using that for a long time

sessionMemberId 1312 cited but not found

Updates Queries on A5308 and A2594 cite a multisponsor with sessionMemberId 1312, but a Member Search Query for that Id returns an empty list. A full 2019 Members Query also doesn't return a member with sessionMemberId 1312.

A5308 Updates Query

{
  "id" : {
    "basePrintNo" : "A5308",
    "session" : 2019,
    "basePrintNoStr" : "A5308-2019"
  },
  "contentType" : "BILL",
  "sourceId" : "2019-02-08-15.57.33.926536_LDSPON_A05308.XML-1-LDSPON",
  "sourceDateTime" : "2019-02-08T15:57:33.926536",
  "processedDateTime" : "2019-02-08T16:01:11.206671",
  "action" : "Insert",
  "scope" : "Bill Amendment Multi Sponsor",
  "fields" : {
    "Created Date Time" : "2019-02-08 16:01:11.206671",
    "Bill Amend Version" : " ",
    "Sequence No" : "31",
    "Session Member Id" : "1312"
  },
  "fieldCount" : 4
}

A2594 Updates Query

{
  "id" : {
    "basePrintNo" : "A5308",
    "session" : 2019,
    "basePrintNoStr" : "A5308-2019"
  },
  "contentType" : "BILL",
  "sourceId" : "2019-02-08-15.57.33.926536_LDSPON_A05308.XML-1-LDSPON",
  "sourceDateTime" : "2019-02-08T15:57:33.926536",
  "processedDateTime" : "2019-02-08T16:01:11.206671",
  "action" : "Insert",
  "scope" : "Bill Amendment Multi Sponsor",
  "fields" : {
    "Created Date Time" : "2019-02-08 16:01:11.206671",
    "Bill Amend Version" : " ",
    "Sequence No" : "31",
    "Session Member Id" : "1312"
  },
  "fieldCount" : 4
}

sessionMemberId:1312

{
  "success" : true,
  "message" : "",
  "responseType" : "empty list",
  "total" : 0,
  "offsetStart" : 1,
  "offsetEnd" : 0,
  "limit" : 50,
  "result" : {
    "items" : [ ],
    "size" : 0
  }
}

Formatting issues with PDF bill texts

The PDF bill text provided by the Senate API has some formatting issues around differentiating new and old text.

For example, A 5699 has an explanation which states that matters in brackets are old text, and matters in italics or underscored are new. However, there are no underscored or italicized sections of the text.

Would it be possible to use Apache Pdfbox to properly format the bill texts? Thank you so much.

What's in a name? Some Member page URIs don't match fullName fields returned by API

The "API vs site admin" line on this one is a little blurry to me, but it affects both nysenate.gov and nyassembly.gov and is directly related to the population of the fullName field returned by API member queries, so here you go:

export const memberURI = (chamber: string, name: string): string => {
  // replace whitespace with dashes, then strip insignificant punctuation
  const nameStr = name.replace(/ /g, '-').replace(/\.|\,/g, '');
  return chamber === 'SENATE'
    ? `https://www.nysenate.gov/senators/${nameStr.toLowerCase()}`
    : chamber === 'ASSEMBLY'
    ? `https://nyassembly.gov/mem/${nameStr}`
    : '';
};

The above works pretty well for the majority of members:

A significant minority, however, don't work, either because the API call doesn't include appropriate initials/suffixes, or the target domain uses a partial name rather than the full name for the member's URI:

Would be nice if everybody got on the same page and worked together, IMHO. Cheers!

question about the completeness of the data

Hi

Thanks for open.nysenate.gov!

We are trying to understand how much of the New York State history is in this database.

It appears that the oldest documents by type are:

  • transcript - 1993 see link
  • bill - 2009 see link
  • action - 2007 see link

We definitely appreciate the data that exists.
Our questions are:

  • Are these oldest document dates correct?
  • If so, are there plans to add the older data. For example, all the bills and actions must be stored somewhere and would be helpful for analysis and for history.
  • Also, (assuming the dates are correct) why do transcripts go back to 1993 and bills only back to 2009?

Ability to analyze the open legislation data and questions

Hi,

I've extracted all the bill and actions data and placed it in a publicly available SQL database for analysis.

See https://bigquery.cloud.google.com/table/personal-real-estate:nys.bills_actions (requires an account and includes a high free daily quota)

Here are some blog entries containing analysis and questions:

From the blog entries:

Focus on New York State Legislature open data: Is 16,000 bill actions in one day correct?
See http://open.nysenate.gov/legislation/search/otype%3Aaction+AND+when%3A%5B1262736000000+TO+1262822399000%5D+AND+active%3Atrue/1/20?sort=&sortOrder=true

We have a question, it appears that there were approximately 16,000 bill actions on 1/6/2010. Is that correct?

image

This is from the NY Senate site:

Questions about the NYS Senate API
Some questions that you may have as a citizen of New York State are:

  • How many legislative bills are produced each year?
  • How many legislative bills are passed each year?
    Those questions seem to be very basic and necessary to understand our legislative process in New York State.

Here's some data from http://open.nysenate.gov/legislation/advanced/ and http://openlegislation.readthedocs.org/en/latest/

See http://demo.redash.io/queries/278#349

This is Count of New York State Legislative Bills per year. It appears to vary between 20,000 and 10,000 in alternating years. Is this possible?

image

But if we look at bill actions we see:

http://demo.redash.io/queries/287#366 (requires an account)

The bill actions seems to be consistently in the 60,000 range. That seems like a lot of actions.

image

Who are the top sponsors of these actions?

See http://demo.redash.io/queries/291#369

image

Thanks!

I'm interning for Senator Jabari Brisport this summer, and needed to help his legislative team organize a list of bills he's co-sponsoring, and your API allowed me to do in one hour what would've taken my partner and I hours by hand. Thank you so much for making all of this information available and open-source!

Feature Request: Law search support in API

Is there a way to search the actual current NYS law in the lucene search api?

For example we'd like an otype = law

See http://openlegislation.readthedocs.org/en/latest/

It would be very helpful.

The current http://public.leginfo.state.ny.us/lawssrch.cgi?NVLWO: site search is very limited.

In fact, it appears to be difficult to even link to this http://public.leginfo.state.ny.us/lawssrch.cgi?NVLWO: site for specific sections or search results.

For example, try to share a link to section 1236 of the NYS VAT law and it seems to be difficult.

The user would have to know the internals of the site.

We suggest to add a "share link" to the http://public.leginfo.state.ny.us site

For every search, show the user the equivalent share link. For example for Section 1236 of VAT the link would be:

(This is simply the POST parameters changed to GET parameters.)

http://public.leginfo.state.ny.us/lawssrch.cgi?NVLWO:?SITECHGNO=&SITEBFPAGE=&SEATYPE=AQUA&QLAWDATA=%24%24VAT1236%24%24%40TXVAT01236&LIST=SEA3&hwebpage=LAWS&haction=&ZQLAWDATA=1236&HQLAWDATA=1236&FRMT=+&HILITE=+&hsearesults=N&hseareq=Y&hcontents=N&hcontreq=N&PHREFLW=&PHREFNO=&PHREFNM=&NHREFLW=%24%24VAT375%24%24%40TXVAT0375&NHREFNO=SEA2&NHREFNM=Vehicle+and+Traffic+Law+%C2%A7+375&HTOKEN=15912673&hdlnkrows=0000&hdlinkstbl=&hsessyr=0000&CBSTATUS=&CBTEXT=&CBSUMMARY=&CBSPONMEMO=&CBUNFORMATTED=&CBBILLFILE=&CBBILLTRK=&CBBLIQ=&CBFACESHEET=&CBGOVPOSN=&CBMAYORPOSN=&CBBILLTITLE=&CBASMHR=&CBSENHR=&CBCBR=&CBSAHIST=&CBACTRULES=

There seems to be yet another government site that lists all the NYS LAWS that seems to be better designed and we can link to specific sections of law see http://www.safeny.ny.gov/bike-vt.htm#sec1236

But the safeny.ny.gov site specifically says it is not an authority.

    PLEASE READ THIS FIRST!
These excerpts are provided for information only and NOT as the basis for legal or judicial determinations.  ALWAYS verify them against the most recent available copy of the law.  The entire Vehicle and Traffic Law, sorted by section number, is available from the New York State Legislative Bill Drafting Commission. (scroll down to VAT) external link

Here's one example of the HTTP POST required to search:

curl 'http://public.leginfo.state.ny.us/lawssrch.cgi?NVLWO:' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: en-US,en;q=0.8' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36' -H 'Content-Type: application/x-www-form-urlencoded' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8' -H 'Cache-Control: max-age=0' -H 'Referer: http://public.leginfo.state.ny.us/lawssrch.cgi?NVLWO:' -H 'Connection: keep-alive' --data 'SITECHGNO=&SITEBFPAGE=&SEATYPE=AQUA&QLAWDATA=FINE+RED+SIGNAL&LIST=SEA1&hwebpage=SEARCH&haction=&ZQLAWDATA=FINE+RED+SIGNAL&HQLAWDATA=FINE+RED+SIGNAL&FRMT=+&HILITE=+&hsearesults=N&hseareq=Y&hcontents=N&hcontreq=N&PHREFLW=&PHREFNO=&PHREFNM=&NHREFLW=%40PLADC0T29C2&NHREFNO=SEA2&NHREFNM=New+York+City+Administrative+Code+%C2%A7+T29C2&HTOKEN=15912673&hdlnkrows=0000&hdlinkstbl=&hsessyr=0000&CBSTATUS=&CBTEXT=&CBSUMMARY=&CBSPONMEMO=&CBUNFORMATTED=&CBBILLFILE=&CBBILLTRK=&CBBLIQ=&CBFACESHEET=&CBGOVPOSN=&CBMAYORPOSN=&CBBILLTITLE=&CBASMHR=&CBSENHR=&CBCBR=&CBSAHIST=&CBACTRULES=' --compressed

Here is the same HTTP POST on one line:

curl 'http://public.leginfo.state.ny.us/lawssrch.cgi?NVLWO:' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: en-US,en;q=0.8' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36' -H 'Content-Type: application/x-www-form-urlencoded' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Cache-Control: max-age=0' -H 'Referer: http://public.leginfo.state.ny.us/lawssrch.cgi?NVLWO:' -H 'Connection: keep-alive' --data 'SITECHGNO=&SITEBFPAGE=&SEATYPE=AQUA&QLAWDATA=FINE+RED+SIGNAL&LIST=SEA1&hwebpage=SEARCH&haction=&ZQLAWDATA=FINE+RED+SIGNAL&HQLAWDATA=FINE+RED+SIGNAL&FRMT=+&HILITE=+&hsearesults=N&hseareq=Y&hcontents=N&hcontreq=N&PHREFLW=&PHREFNO=&PHREFNM=&NHREFLW=%40PLADC0T29C2&NHREFNO=SEA2&NHREFNM=New+York+City+Administrative+Code+%C2%A7+T29C2&HTOKEN=15912673&hdlnkrows=0000&hdlinkstbl=&hsessyr=0000&CBSTATUS=&CBTEXT=&CBSUMMARY=&CBSPONMEMO=&CBUNFORMATTED=&CBBILLFILE=&CBBILLTRK=&CBBLIQ=&CBFACESHEET=&CBGOVPOSN=&CBMAYORPOSN=&CBBILLTITLE=&CBASMHR=&CBSENHR=&CBCBR=&CBSAHIST=&CBACTRULES=' --compressed

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.