This repository contains data pulled from the FBI's URC database.
It includes:
- python code (for you to modify it according to your needs)
- "List of ALL U.S. Agencies.csv" - List of ALL Law Enforcement Agencies in the U.S.
- This file last updated w/ real data on 06/27/23
- "My Agencies.csv" - A subset of List of ALL U.S. Agencies.csv. The file List of Crimes per Agency.csv gathers crime statistics on these agencies.
- "List of Crimes per Agency.csv" - Statistics on all offenses documented per each agency, for any given year.
- This file last updated w/ real data (for New Mexico) on 09/05/23
Examples of these files can be seen in this repository
- Download the "FBI Database Puller.py" python file
- Get an API key to run this code (see section "How do I get an API key" below)
- Copy/Paste your API key into the "FBI Database Puller.py" python file (where it says "INSERT_YOUR_API_KEY_HERE")
- Make sure you have all the necessary CSV files
- Run the program 👍
You have a list of crimes per agency on all departments in NM, but I want to see the crime statistics from another state, how do I do this?
- See section "How do I run your code" and make sure this works before moving on with this section.
- Open a file called "List of ALL U.S. Agencies.csv" and COPY whatever agencies you want (i.e. all agencies that belong to Utah, Texas, Maine, etc.)
- Open a file called "My Agencies.csv" and PASTE the agencies you just copied. (Make sure to include the header)
- run the code with the function "getSummarizedData(startYear=2000, endYear=2006)" uncommented.
- Feel free to change the years
- Run the code (may take a few minutes)
- Open a file called "List of Crimes per Agency.csv" and see your results 🙂
- Go to the FBI developer's page and sign up for an API key: https://api.data.gov/signup/
- Enter your name, email, etc.
- Check your inbox for an email containing your personal API key (do not share with anyone!)