Skip to contents

Pages transparently through $offset until either the server returns fewer rows than page_size (the last page) or max_features is reached. Works against any Socrata-shaped portal (Chicago, NYC, Seattle, etc.).

Usage

morie_ingest_chicago_socrata(
  resource_url,
  where = NULL,
  select = NULL,
  order = NULL,
  page_size = .MORIE_CHICAGO_DEFAULT_PAGE_SIZE,
  max_features = NULL,
  app_token = NULL,
  user_agent = .MORIE_CHICAGO_DEFAULT_UA,
  timeout = .MORIE_CHICAGO_DEFAULT_TIMEOUT
)

Arguments

resource_url

Full Socrata resource URL ending in .json, e.g. "https://data.cityofchicago.org/resource/ijzp-q8t2.json".

where, select, order

SoQL clauses; see https://dev.socrata.com/docs/queries/. where is the equivalent of SQL WHERE.

page_size

Rows per request (capped at 50,000 server-side).

max_features

Optional hard cap on total returned rows.

app_token

Optional Socrata application token (anonymous calls share a throttled pool; tokens give per-app quotas).

user_agent, timeout

Standard request knobs.

Value

A base R data.frame.

Examples

if (FALSE) { # \dontrun{
df <- morie_ingest_chicago_socrata(
  "https://data.cityofnewyork.us/resource/uip8-fykc.json",
  where = "arrest_year = 2023",
  max_features = 5000L
)
} # }