Free Data from New York

William Lin
3 min readDec 3, 2020

NYC Open Data basics

Looking for an api/dataset to build an awesome project around? Look no more! New York City provides New Yorkers with free data that are both produced and used by the city government. The data is collected and sent to the Mayor’s Office of data analytics and the Department of Information Technology and Telecommunications. They use a SAAS(Software as a service) company called Socrata to serve the data.

I have provided a step-by-step guide to get you to the free resource below.

How to use NYC Open Data

1) Go to the website shown below: opendata.cityofnewyork.us

2) Search the keywords that you want for the site

3) Pick out the one you want to use

4) Keep in mind the criteria you want for the dataset, for example, if you want up-to-date information you might not want to use the ARCHIVED information.

It also shows the date of the last update and the number of views. That shows its popularity.

5) The following shows the details of the API which you’ve chosen.

5.1) Note, the following shows the schema of the relational data.

6) The data is currently not in JSON format so by using the SODA API you can use the data in your code.

7) Sign up for an app token using the following button

8) Log in with your credentials

9) This is my account so I’ve blurred out my key. Make sure to .env ignore your key when pushing to Github! Also, make sure to hide your key from others.

10) This is a get request that’s used by SODA API. I didn’t use JQuery but it’s what is shown first. I was using ruby so I clicked on the soda-ruby tab.

11) I seeded my database with the data as long as attitude was present. You can seed it with other criteria or no criteria at all.

This is an example of how I’m using the data:

--

--