MyNixOS website logo
Description

Convenient Access to Chicago Open Data API Endpoints.

Provides simple, reproducible access to datasets from the Chicago Open Data portal <https://data.cityofchicago.org/>. Functions return results as tidy tibbles and support optional filtering, sorting, and row limits via the Socrata API.

chiOpenData

chiOpenData provides simple, reproducible access to Chicago-related datasets from the
Chicago Open Data Portal platform — directly from R, with no API keys or manual downloads required. Working directly with Socrata APIs can be cumbersome — chiOpenData simplifies this process into a clean, reproducible workflow.

Version 0.1.0 introduces a streamlined, catalog-driven interface for Chicago Open Data, extending the open data ecosystem beyond New York to support cross-city analysis and comparative civic research.

The package provides three core functions:

  • chi_list_datasets() — Browse available datasets from the live Chicago Open Data catalog
  • chi_pull_dataset() — Pull any cataloged dataset by key, with filtering, ordering, and optional date controls
  • chi_any_dataset() — Pull any Chicago Open Data dataset directly via its Socrata JSON endpoint

Datasets pulled via chi_pull_dataset() automatically apply sensible defaults from the catalog (such as default ordering and date fields), while still allowing user control over:

  • limit
  • filters
  • date / from / to
  • where
  • order
  • clean_names
  • coerce_types

This redesign reduces maintenance burden, improves extensibility, and provides a more scalable interface for working with Chicago Open Data.

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


Installation

Development version (GitHub)

devtools::install_github("martinezc1/chiOpenData")

Example

library(chiOpenData)

crime_data <- chi_pull_dataset(
  dataset = "crimes_2001_to_present",
  limit = 1000
)

head(crime_data)
#> # A tibble: 6 × 33
#>         id case_number date                block  iucr  primary_type description
#>      <dbl> <chr>       <dttm>              <chr>  <chr> <chr>        <chr>      
#> 1 14154731 JK202681    2026-04-01 00:00:00 032XX… 1150  DECEPTIVE P… CREDIT CAR…
#> 2 14154065 JK202226    2026-04-01 00:00:00 042XX… 2027  NARCOTICS    POSSESS - …
#> 3 14153495 JK201347    2026-04-01 00:00:00 004XX… 2826  OTHER OFFEN… HARASSMENT…
#> 4 14158479 JK207388    2026-04-01 00:00:00 002XX… 2825  OTHER OFFEN… HARASSMENT…
#> 5 14156762 JK205044    2026-04-01 00:00:00 117XX… 1750  OFFENSE INV… CHILD ABUSE
#> 6 14153888 JK201795    2026-04-01 00:00:00 069XX… 0486  BATTERY      DOMESTIC B…
#> # ℹ 26 more variables: location_description <chr>, arrest <lgl>,
#> #   domestic <lgl>, beat <dbl>, district <dbl>, ward <dbl>,
#> #   community_area <dbl>, fbi_code <chr>, x_coordinate <dbl>,
#> #   y_coordinate <dbl>, year <dbl>, updated_on <dttm>, latitude <dbl>,
#> #   longitude <dbl>, computed_region_awaf_s7ux <dbl>,
#> #   computed_region_6mkv_f3dw <dbl>, computed_region_vrxf_vc4k <dbl>,
#> #   computed_region_bdys_3d7i <dbl>, computed_region_43wa_7qmu <dbl>, …

About

chiOpenData makes Chicago’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, chiOpenData is specifically tailored for Chicago Open Data Portal.

This package is part of a broader ecosystem of tools for working with open data:

  • nycOpenData — streamlined access to NYC Open Data
  • nysOpenData — streamlined access to NY State Open Data
  • mtaOpenData — streamlined access to MTA-related NY State Open Data

Together, these packages provide a consistent, user-friendly interface for working with civic data across jurisdictions.

  • Ease of Use: No need to hunt for 4x4 dataset IDs (e.g., 2ucp-7wg5); use catalog-based keys instead.
  • 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 Chicago dataset, please open an issue or submit a pull request on GitHub.


Authors & Contributors

Maintainer

Christian A. Martinez 📧 [email protected]
GitHub: @martinezc1

Metadata

Version

0.1.0

License

Unknown

Platforms (80)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arc-linux
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • sh4-linux
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows