Check the setup
- Python 3.10 or newer
- A notebook environment such as Jupyter or Google Colab
- A free api.data.gov key saved in the FBI_CDE_API_KEY environment variable
Uniform Crime Reporting summaries and NIBRS extracts for building U.S. crime trend and agency-comparison tools.
From source to product signal
The FBI Crime Data API returns Uniform Crime Reporting summaries. Start with national participation or one state series after requesting a free api.data.gov key. Agency coverage is voluntary, SRS and NIBRS are not interchangeable, and recent years can be incomplete.
Install the packages, then run the notebook cell.
python -m pip install pandas requests
import os
import pandas as pd
import requests
response = requests.get(
"https://api.usa.gov/crime/fbi/sapi/api/estimates/states/CA/2020/2022",
params={"api_key": os.environ["FBI_CDE_API_KEY"]},
timeout=30,
)
response.raise_for_status()
estimates = pd.DataFrame(response.json().get("results", response.json()))
print(estimates.head())Test a useful signal
Test whether CDE estimates can power a bounded state crime trend.
Federal Bureau of Investigation is a government source. Last verified 2026-08-18. Temporal coverage: 1985-present summarized UCR series.