Skip to contents

Queries the FBI Crime Data Explorer NIBRS endpoint (/crime/fbi/cde/nibrs/<state>/<offense>?year=...). Requires an API key from https://api.data.gov/signup/; pass via api_key= or set the FBI_CDE_API_KEY environment variable. Returns one row per offence-event with nested sub-objects flattened using dotted keys (offense.code, victim.age, ...).

Usage

morie_ingest_forensics_nibrs(
  year,
  offense = NULL,
  state = NULL,
  api_key = NULL,
  max_features = NULL,
  page_size = 500L,
  timeout = .MORIE_FORENSICS_DEFAULT_TIMEOUT
)

Arguments

year

Reporting year (e.g. 2023). Required - CDE forces a year scope.

offense

NIBRS offence slug (e.g. "aggravated-assault", "burglary"); NULL returns all offences.

state

Two-letter US state code (e.g. "GA"). NULL returns the national feed (very large; use max_features).

api_key

FBI CDE API key; falls back to $FBI_CDE_API_KEY.

max_features

Optional hard cap on returned rows.

page_size

CDE page size; server-side cap varies by endpoint.

timeout

HTTP timeout in seconds.

Value

A base R data.frame, one row per offence-event.

Examples

if (FALSE) { # \dontrun{
df <- morie_ingest_forensics_nibrs(
  year = 2023, offense = "aggravated-assault", state = "GA",
  api_key = Sys.getenv("FBI_CDE_API_KEY"),
  max_features = 5000L
)
head(df)
} # }