Learn R Programming

nycOpenData

nycOpenData provides simple, reproducible access to datasets from the
NYC Open Data platform — directly from R,
with no API keys or manual downloads required. The package is available on CRAN.

Version 0.1.6 now includes wrappers for 40+ NYC Open Data APIs, covering:

  • 311 Service Requests
  • For-Hire Vehicles (FHV)
  • Juvenile Justice (rearrest rates + caseloads)
  • School Discharge Reporting
  • Violent & Disruptive School Incidents
  • Detention Admissions
  • Borough/Community District Reports
  • Street Tree Census
  • Urban Park Ranger Animal Condition Responses
  • Permitted Events (Historical)
  • and more

All functions return clean tibble outputs and support filtering via
filters = list(field = "value").


Installation

From CRAN

install.packages("nycOpenData")

Development version (GitHub)

devtools::install_github("martinezc1/nycOpenData")

Example

library(nycOpenData)

# Get 5,000 most recent 311 requests
data <- nyc_311(limit = 5000)

# Filter by agency and city
filtered <- nyc_311(
  limit = 2000,
  filters = list(agency = "NYPD", city = "BROOKLYN")
)

head(filtered)
## # A tibble: 6 × 37
##   unique_key created_date           agency agency_name complaint_type descriptor
##   <chr>      <chr>                  <chr>  <chr>       <chr>          <chr>     
## 1 67613985   2026-01-26T02:06:05.0… NYPD   New York C… Noise - Resid… Banging/P…
## 2 67609553   2026-01-26T02:02:09.0… NYPD   New York C… Noise - Resid… Banging/P…
## 3 67610990   2026-01-26T01:58:58.0… NYPD   New York C… Illegal Parki… Blocked H…
## 4 67615428   2026-01-26T01:56:49.0… NYPD   New York C… Noise - Resid… Banging/P…
## 5 67609568   2026-01-26T01:48:16.0… NYPD   New York C… Noise - Resid… Loud Musi…
## 6 67612476   2026-01-26T01:47:10.0… NYPD   New York C… Noise - Resid… Loud Musi…
## # ℹ 31 more variables: location_type <chr>, incident_zip <chr>,
## #   incident_address <chr>, street_name <chr>, cross_street_1 <chr>,
## #   cross_street_2 <chr>, intersection_street_1 <chr>,
## #   intersection_street_2 <chr>, address_type <chr>, city <chr>,
## #   landmark <chr>, status <chr>, community_board <chr>,
## #   council_district <chr>, police_precinct <chr>, bbl <chr>, borough <chr>,
## #   x_coordinate_state_plane <chr>, y_coordinate_state_plane <chr>, …

Learn by example

  • vignette("nyc-311", package = "nycOpenData") – Working with NYC 311 data end-to-end

About

nycOpenData makes New York City’s civic datasets accessible to students,
educators, analysts, and researchers through a unified and user-friendly R interface.
Developed to support reproducible research, open-data literacy, and real-world analysis.


Comparison to Other Software

While the RSocrata package provides a general interface for any Socrata-backed portal, nycOpenData is specifically tailored for the New York City ecosystem.

  • Ease of Use: No need to hunt for 4x4 dataset IDs (e.g., erm2-nwe9); functions like nyc_311() map directly to the most popular city datasets.
  • Pre-configured Logic: Wrappers include default sorting (e.g., created_date DESC) and optimized limit handling specific to NYC’s massive data volumes.
  • Open Literacy: Designed specifically for students and researchers to lower the barrier to entry for civic data analysis.

Contributing

We welcome contributions! If you find a bug or would like to request a wrapper for a specific NYC dataset, please open an issue or submit a pull request on GitHub.


Authors & Contributors

Maintainer

Christian A. Martinez

Copy Link

Version

Install

install.packages('nycOpenData')

Monthly Downloads

354

Version

0.1.6

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Christian Martinez

Last Published

February 14th, 2026

Functions in nycOpenData (0.1.6)

nyc_medallion_drivers_active

Medallion Drivers - Active
nyc_domestic_violence_annual_report

Annual Report on Domestic Violence Initiatives, Indicators and Factors
nyc_restaurant_inspection_results

DOHMH New York City Restaurant Inspection Results
nyc_medallion_drivers_authorized

Medallion Vehicles - Authorized
nyc_urban_park_animal_condition

NYC Urban Park Ranger Animal Condition Response
nyc_open_parking_camera_violations

Open Parking and Camera Violations
nyc_tree_census_2015

NYC 2015 Street Tree Census - Tree Data
nyc_nypd_hate_crimes

NYC NYPD Hate Crimes
nyc_motor_vehicle_collisions_crashes

Motor Vehicle Collisions - Crashes
nyc_violent_disruptive_school_incidents

NYC Violent and Disruptive Incidents
nyc_permit_events_historic

NYC Permitted Event Information - Historical
nyc_museum_locations

MUSEUM
nyc_period_attendance_reporting

Statistical Summary Period Attendance Reporting (PAR)
nyc_pets_in_shelters

NYC Pets in Shelter Report
nyc_tlc_new_driver_app_status

NYC TLC New Driver Application Status
nyc_street_hail_livery_active

Street Hail Livery (SHL) Drivers - Active
nyc_slash_stab

Inmate Incidents - Slashing and Stabbing
nyc_shooting_incidents

NYPD Shootings
nyc_wetlands

NYC Wetlands
nyc_homeless_drop_in_centers

NYC Homeless Drop- In Centers
nyc_school_discharge_report_2013_2015

2013-2015 School Closure Discharge Reporting
nyc_homeless_population_by_year

NYC Homeless Population By Year
nyc_locallaw18_payreport

Local Law 18 Pay and Demographics Report - Agency Report Table
nyc_school_discharge

NYC School Discharge Reporting (Local Law 42)
nyc_locallaw97_shelter_pets

Local Law 97 of 2021 - Pets in Shelter Report
nyc_runaway_and_homeless_youth_daily_census

NYC Runaway and Homeless Youth (RHY) Daily Census
nyc_school_discharge_report_2015_2018

2015-2018 School Closure Discharge Reporting
nyc_daily_attendance_2018_2019

2018-2019 Daily Attendance
nyc_city_record

City Record Online
nyc_detention_admissions

NYC Detention Admissions by Community District
nyc_311

NYC 311 Service Requests
nyc_borough_community_report

NYC Borough/Community District Report
nyc_311_2010_2019

NYC 311 Service Requests
nyc_civil_service_list

NYC Civil Service List (Active)
nyc_any_dataset

Load Any NYC Open Data Dataset
nyc_cause_of_death

New York City Leading Causes of Death
nyc_borough_population

New York City Population by Borough, 1950 - 2040
nyc_for_hire_vehicles

NYC For-Hire Vehicles (FHV) - Active
nyc_dhs_daily_report

NYC Department of Homeless Services (DHS) Daily Report
nyc_ha_violations

Housing Maintenance Code Violations NYCHA properties
nyc_dob_job_applications

NYC DOB Job Application Filings
nyc_events_sealevel

NYC Climate Projections: Extreme Events and Sea Level Rise
nyc_film_permits

Film Permits
nyc_dop_juvenile_cases

NYC DOP Juvenile Case Count By Type
nyc_dob_permit_issuance

DOB Permit Issuance
nyc_dop_juvenile_rearrest_rate

NYC DOP Juvenile Rearrest Rate (Monthly Average)