This data includes all New York City 311 service requests from 2010 to the present, and is updated daily. 311 is a non-emergency number that provides access to non-emergency municipal services.
You can start exploring this data in the BigQuery console:
Go to NYC 311 Service Requests Data
Sample queries
Here are some examples of SQL queries you can run on this data in BigQuery.
These samples use BigQuery’s support for standard SQL. Use the
#standardSQL tag to let BigQuery know you want to use standard SQL. For more
information about the #standardSQL prefix, see
Setting a query prefix.
What is the number of 311 requests related to ice cream trucks?
This query counts the number of requests using the term 'ice cream truck' in the descriptor.
Web UI
Open the following query in the Web UI
#standardSQL SELECT COUNT(*) AS requests FROM `bigquery-public-data.new_york.311_service_requests` WHERE LOWER(descriptor) LIKE '%ice cream truck%'
Command-line
bq query --use_legacy_sql=false '
SELECT
COUNT(*) AS requests
FROM
`bigquery-public-data.new_york.311_service_requests`
WHERE
LOWER(descriptor) LIKE "%ice cream truck%"
'
The results are shown here:
+----------+
| requests |
+----------+
| 11132 |
+----------+
Which boroughs have the most 311 requests related to parties?
This query finds the most partying boroughs in NYC by looking at requests with ‘party’ in their descriptor.
Web UI
Open the following query in the Web UI
#standardSQL SELECT borough, COUNT(descriptor) AS parties FROM `bigquery-public-data.new_york.311_service_requests` WHERE LOWER(descriptor) LIKE '%party%' GROUP BY borough ORDER BY parties DESC
Command-line
bq query --use_legacy_sql=false '
SELECT
borough,
COUNT(descriptor) AS parties
FROM
`bigquery-public-data.new_york.311_service_requests`
WHERE
LOWER(descriptor) LIKE "%party%"
GROUP BY
borough
ORDER BY
parties DESC'
The results are shown here:
+---------------+---------+
| borough | parties |
+---------------+---------+
| BROOKLYN | 325271 |
| MANHATTAN | 302359 |
| BRONX | 219290 |
| QUEENS | 193626 |
| STATEN ISLAND | 28142 |
| Unspecified | 2934 |
+---------------+---------+
What days get the most 311 requests related to parties?
This query uses the NYC 311 data to identify the day with the most parties by borough.
Web UI
Open the following query in the Web UI
#standardSQL
SELECT
extract(DAYOFWEEK
FROM
created_date) AS party_day,
borough,
COUNT(*) AS num_parties
FROM
`bigquery-public-data.new_york.311_service_requests`
WHERE
LOWER(descriptor) LIKE '%party%'
GROUP BY
party_day,
borough
ORDER BY
num_parties DESC
Command-line
bq query --use_legacy_sql=false '
SELECT
extract(DAYOFWEEK
FROM
created_date) AS party_day,
borough,
COUNT(*) AS num_parties
FROM
`bigquery-public-data.new_york.311_service_requests`
WHERE
LOWER(descriptor) LIKE "%party%"
GROUP BY
party_day,
borough
ORDER BY
num_parties DESC'
The results are shown here, with values for party_day ranging from
1 (Sunday) to 7 (Saturday):
+-----------+---------------+-------------+
| party_day | borough | num_parties |
+-----------+---------------+-------------+
| 7 | BROOKLYN | 89475 |
| 1 | BROOKLYN | 88184 |
| 7 | MANHATTAN | 80277 |
| 1 | MANHATTAN | 71420 |
| 1 | QUEENS | 63313 |
| 1 | BRONX | 59906 |
| 7 | BRONX | 57846 |
| 7 | QUEENS | 55958 |
| 6 | MANHATTAN | 45094 |
| 6 | BROOKLYN | 41084 |
...
+-----------+---------------+-------------+
About the data
Dataset Source: NYC Open Data
Category: New York City
Use: This dataset is publicly available for anyone to use under the following terms provided by the Dataset Source - https://data.cityofnewyork.us/ - and is provided "AS IS" without any warranty, express or implied, from Google. Google disclaims all liability for any damages, direct or indirect, resulting from the use of the dataset.
Update Frequency: Daily
View in BigQuery: Go to NYC 311 Service Requests data