You need to display crime grades and a breakdown by offense for a given US ZIP code, wire it into your app this week, and move on. By the end of this guide you’ll fetch an overall crime grade plus violent/property/other components for any ZIP, and drop it into a dashboard, listing page, or risk model with a single GET request.
What you can build with a single ZIP
The Crime Data By ZipCode API returns a compact JSON report for the ZIP you pass in. You’ll get:
- Overall Crime Grade (letter grade)
- Breakdowns for violent, property, and other crimes with totals and per-category rates
- Nearby ZIP comparisons and similar-population ZIP comparisons
Teams plug this into real estate listings, relocation tools, underwriting prototypes, and city data dashboards. You pass a ZIP, you get a score and breakdown that you can render immediately.
Getting started on Zyla API Hub
Open the listing for the API on Zyla API Hub and subscribe to get an API key. Zyla uses a subscription + quota model (not pay-per-call). For your first API, you can start a 7-day trial or 50 requests depending on availability—check the API page for current access options and pricing.
- Go to the API page: Start 7-day trial on Crime Data By ZipCode API
- Click Subscribe or Start Free Trial when available.
- Copy your API key from your account. Authentication is an HTTP header: Authorization: Bearer YOUR_API_KEY.
Zyla API Hub hosts more than 10,000 public APIs across finance, enrichment, AI, geolocation, e‑commerce, and utilities. Browse the catalog at zylalabs.com and reuse your same key across listings.
Endpoint you’ll use
This API has one job: return crime grades and rates for a given ZIP code.
- Endpoint: Get Crime Rates by ZIP
- Method: GET
- URL: https://zylalabs.com/api/824/crime-data-by-zipcode-api/583/get-crime-rates-by-zip
- Required query parameter: zip (number). Example: 01370
cURL example (copy/paste)
curl -s -X GET "https://zylalabs.com/api/824/crime-data-by-zipcode-api/583/get-crime-rates-by-zip?zip=01370" \
-H "Authorization: Bearer YOUR_API_KEY"
Official sample response
{"Overall":{"Zipcode":"01370","Overall Crime Grade":"B","Violent Crime Grade":"C-","Property Crime Grade":"B","Other Crime Grade":"B"},"Crime BreakDown":[{"Violent Crime Rates":{"Assault":"2.759","Robbery":"0.4627","Rape":"0.5506","Murder":"0.0218"},"0":{"Total Violent Crime":"3.795","Total Violent Crime Score":"(C-)"}} ,{"Property Crime Rates":{"Theft":"8.498","Vehicle Theft":"0.6988","Burglary":"1.563","Arson":"0.0619"},"0":{"Total Property Crime":"10.82","Total Property Crime Score":"(B)"}} ,{"Other Crime Rates":{"Kidnapping":"0.1303","Drug Crimes":"1.553","Vandalism":"3.749","Identity Theft":"0.4203","Animal Cruelty":"0.0490"},"0":{"Total \"Other\" Rate":"5.902","Total \"Other\" Score":"(B)"}}],"Crime Rates Nearby":[{"Nearby Zip":"01338, MA","Overall Crime Grade":"B-","Violent Crime Grade":"D","Property Crime Grade":"B-"},{"Nearby Zip":"01340, MA","Overall Crime Grade":"A-","Violent Crime Grade":"A-","Property Crime Grade":"B"},{"Nearby Zip":"01341, MA","Overall Crime Grade":"A","Violent Crime Grade":"C-","Property Crime Grade":"A"},{"Nearby Zip":"01301, MA","Overall Crime Grade":"C+","Violent Crime Grade":"C-","Property Crime Grade":"C"},{"Nearby Zip":"01330, MA","Overall Crime Grade":"A","Violent Crime Grade":"A-","Property Crime Grade":"A"},{"Nearby Zip":"01346, MA","Overall Crime Grade":"A","Violent Crime Grade":"C","Property Crime Grade":"A"},{"Nearby Zip":"01339, MA","Overall Crime Grade":"A-","Violent Crime Grade":"C","Property Crime Grade":"A"},{"Nearby Zip":"01342, MA","Overall Crime Grade":"A","Violent Crime Grade":"B+","Property Crime Grade":"A+"},{"Nearby Zip":"01376, MA","Overall Crime Grade":"B-","Violent Crime Grade":"C+","Property Crime Grade":"B-"},{"Nearby Zip":"01337, MA","Overall Crime Grade":"A","Violent Crime Grade":"B-","Property Crime Grade":"A"}],"Similar Population Crime Rates":[{"Similar Zip":"34217, FL","Overall Crime Grade":"A-","Violent Crime Grade":"C+","Property Crime Grade":"C+"},{"Similar Zip":"72046, AR","Overall Crime Grade":"F","Violent Crime Grade":"D-","Property Crime Grade":"D-"},{"Similar Zip":"52778, IA","Overall Crime Grade":"B","Violent Crime Grade":"A-","Property Crime Grade":"A-"},{"Similar Zip":"54126, WI","Overall Crime Grade":"A","Violent Crime Grade":"A+","Property Crime Grade":"A+"},{"Similar Zip":"02715, MA","Overall Crime Grade":"A+","Violent Crime Grade":"A-","Property Crime Grade":"A-"},{"Similar Zip":"67025, KS","Overall Crime Grade":"B-","Violent Crime Grade":"B+","Property Crime Grade":"B+"},{"Sim…
What developers usually extract:
Overall.Overall Crime Gradefor a single-letter badge (A+ to F).Overall.Violent Crime Grade,Overall.Property Crime Grade,Overall.Other Crime Gradefor sub-scores.- Totals from the
Crime BreakDownarray (e.g.,Total Violent Crime,Total Property Crime,Total "Other" Rate). - Nearby ZIP list from
Crime Rates Nearbyfor context comparisons.
Python example: fetch and normalize the grades
This minimal script calls the same endpoint, parses the grades, and flattens totals for rendering. Store YOUR_API_KEY in an environment variable before running.
import os
import requests
API_KEY = os.environ.get("ZYLALABS_API_KEY", "YOUR_API_KEY") # replace in local testing
ZIP = "01370"
url = "https://zylalabs.com/api/824/crime-data-by-zipcode-api/583/get-crime-rates-by-zip"
params = {"zip": ZIP}
headers = {"Authorization": f"Bearer {API_KEY}"}
resp = requests.get(url, params=params, headers=headers, timeout=20)
resp.raise_for_status()
data = resp.json()
overall = data.get("Overall", {})
grades = {
"zip": overall.get("Zipcode"),
"overall": overall.get("Overall Crime Grade"),
"violent": overall.get("Violent Crime Grade"),
"property": overall.get("Property Crime Grade"),
"other": overall.get("Other Crime Grade"),
}
# Extract totals from Crime BreakDown
totals = {}
for section in data.get("Crime BreakDown", []):
# Each section has a key "0" with totals; keep what's available
totals.update(section.get("0", {}))
nearby = [
{
"zip": item.get("Nearby Zip"),
"overall": item.get("Overall Crime Grade"),
"violent": item.get("Violent Crime Grade"),
"property": item.get("Property Crime Grade"),
}
for item in data.get("Crime Rates Nearby", [])
]
print("Grades:", grades)
print("Totals:", totals)
print("Nearby (first 3):", nearby[:3])
Implementation notes that save time
- Authentication: every request must include Authorization: Bearer YOUR_API_KEY.
- Parameter type: the
zipparameter is numeric in the listing. If you accept user input with leading zeros, normalize to a numeric or pass the exact digits the user entered. - Caching: crime grades don’t change minute-by-minute. Cache by ZIP to cut repeated calls on high-traffic pages.
- Rendering: grades are letter strings like A, A-, B, …, F. Keep the original string; don’t coerce to numbers unless your model needs it.
- Breakdowns: the response includes totals under a key named
"0"inside each breakdown object. Pull those out for quick summaries. - Comparisons: the
Crime Rates Nearbyarray is ideal for a sidebar list of neighboring ZIPs with simple badges. Same for similar-population comparisons.
Real-world use cases
- Property listing pages: show “Overall Crime Grade” and expand a details drawer with violent/property/other totals.
- Relocation calculators: input a ZIP and show nearby ZIPs with better or worse grades from
Crime Rates Nearby. - Routing and delivery planning: flag depots or service areas with lower grades and direct mitigation steps.
- Underwriting prototypes: map a prospect’s ZIP to a risk bucket using the overall grade and violent total.
- Civic dashboards: aggregate multiple ZIP results into a municipality panel and highlight outliers.
Calling the API from AI agents via MCP
If you automate tasks with MCP-compatible clients (e.g., Claude Code, Cursor, Windsurf), you can expose this same endpoint to your agent. Configure your client to use Zyla’s MCP endpoint and include your Zyla API key. The agent will perform the same GET request, with the Authorization header, and return the JSON you’ve seen above.
- MCP endpoint: MCP
- Key handling: reuse your Zyla API key; scope it to your agent’s environment variables.
- Tooling: have your agent accept a ZIP argument and map it to the query parameter
zipon the hub URL.
This keeps your prompts clean and lets your agent retrieve crime grades on demand during a coding or data-enrichment session.
Quick reference
- Base hub endpoint: https://zylalabs.com/api/824/crime-data-by-zipcode-api/583/get-crime-rates-by-zip
- Method: GET
- Required param: zip (number)
- Auth header: Authorization: Bearer YOUR_API_KEY
- Response fields you’ll likely use: Overall grades, totals from Crime BreakDown, nearby ZIPs
Browse more categories or pair this with mapping, geocoding, or demographics on Zyla API Hub using the same key and subscription model.
FAQ
What ZIP formats are accepted?
Pass the numeric ZIP code as the zip query parameter (e.g., 01370). If your app collects ZIP+4, strip the extension and send the 5-digit ZIP.
How do I authenticate?
Include the header Authorization: Bearer YOUR_API_KEY on every request.
Can I make batch requests?
The listed endpoint accepts one ZIP per call. For bulk processing, loop over ZIPs with basic concurrency and cache results.
What do the grades represent?
Letter grades summarize crime levels by category. Use the “Overall Crime Grade” for a single badge and the category grades for detail. The response also includes numeric strings for various rates and totals.
Is there a free plan?
Zyla uses subscription + quota. For your first API, you can start a 7-day trial or 50 requests when available. Check the API page for current access options and pricing.
Ready to ship this? Subscribe and get your key on the listing: Start 7-day trial on Crime Data By ZipCode API. Use the same account and key across thousands of other APIs on Zyla.
Official API response
{"Overall":{"Zipcode":"01370","Overall Crime Grade":"B","Violent Crime Grade":"C-","Property Crime Grade":"B","Other Crime Grade":"B"},"Crime BreakDown":[{"Violent Crime Rates":{"Assault":"2.759","Robbery":"0.4627","Rape":"0.5506","Murder":"0.0218"},"0":{"Total Violent Crime":"3.795","Total Violent Crime Score":"(C-)"}},{"Property Crime Rates":{"Theft":"8.498","Vehicle Theft":"0.6988","Burglary":"1.563","Arson":"0.0619"},"0":{"Total Property Crime":"10.82","Total Property Crime Score":"(B)"}},{"Other Crime Rates":{"Kidnapping":"0.1303","Drug Crimes":"1.553","Vandalism":"3.749","Identity Theft":"0.4203","Animal Cruelty":"0.0490"},"0":{"Total \"Other\" Rate":"5.902","Total \"Other\" Score":"(B)"}}],"Crime Rates Nearby":[{"Nearby Zip":"01338, MA","Overall Crime Grade":"B-","Violent Crime Grade":"D","Property Crime Grade":"B-"},{"Nearby Zip":"01340, MA","Overall Crime Grade":"A-","Violent Crime Grade":"A-","Property Crime Grade":"B"},{"Nearby Zip":"01341, MA","Overall Crime Grade":"A","Violent Crime Grade":"C-","Property Crime Grade":"A"},{"Nearby Zip":"01301, MA","Overall Crime Grade":"C+","Violent Crime Grade":"C-","Property Crime Grade":"C"},{"Nearby Zip":"01330, MA","Overall Crime Grade":"A","Violent Crime Grade":"A-","Property Crime Grade":"A"},{"Nearby Zip":"01346, MA","Overall Crime Grade":"A","Violent Crime Grade":"C","Property Crime Grade":"A"},{"Nearby Zip":"01339, MA","Overall Crime Grade":"A-","Violent Crime Grade":"C","Property Crime Grade":"A"},{"Nearby Zip":"01342, MA","Overall Crime Grade":"A","Violent Crime Grade":"B+","Property Crime Grade":"A+"},{"Nearby Zip":"01376, MA","Overall Crime Grade":"B-","Violent Crime Grade":"C+","Property Crime Grade":"B-"},{"Nearby Zip":"01337, MA","Overall Crime Grade":"A","Violent Crime Grade":"B-","Property Crime Grade":"A"}],"Similar Population Crime Rates":[{"Similar Zip":"34217, FL","Overall Crime Grade":"A-","Violent Crime Grade":"C+","Property Crime Grade":"C+"},{"Similar Zip":"72046, AR","Overall Crime Grade":"F","Violent Crime Grade":"D-","Property Crime Grade":"D-"},{"Similar Zip":"52778, IA","Overall Crime Grade":"B","Violent Crime Grade":"A-","Property Crime Grade":"A-"},{"Similar Zip":"54126, WI","Overall Crime Grade":"A","Violent Crime Grade":"A+","Property Crime Grade":"A+"},{"Similar Zip":"02715, MA","Overall Crime Grade":"A+","Violent Crime Grade":"A-","Property Crime Grade":"A-"},{"Similar Zip":"67025, KS","Overall Crime Grade":"B-","Violent Crime Grade":"B+","Property Crime Grade":"B+"},{"Sim…
Official API response
{"Overall":{"Zipcode":"01370","Overall Crime Grade":"B","Violent Crime Grade":"C-","Property Crime Grade":"B","Other Crime Grade":"B"},"Crime BreakDown":[{"Violent Crime Rates":{"Assault":"2.759","Robbery":"0.4627","Rape":"0.5506","Murder":"0.0218"},"0":{"Total Violent Crime":"3.795","Total Violent Crime Score":"(C-)"}},{"Property Crime Rates":{"Theft":"8.498","Vehicle Theft":"0.6988","Burglary":"1.563","Arson":"0.0619"},"0":{"Total Property Crime":"10.82","Total Property Crime Score":"(B)"}},{"Other Crime Rates":{"Kidnapping":"0.1303","Drug Crimes":"1.553","Vandalism":"3.749","Identity Theft":"0.4203","Animal Cruelty":"0.0490"},"0":{"Total \"Other\" Rate":"5.902","Total \"Other\" Score":"(B)"}}],"Crime Rates Nearby":[{"Nearby Zip":"01338, MA","Overall Crime Grade":"B-","Violent Crime Grade":"D","Property Crime Grade":"B-"},{"Nearby Zip":"01340, MA","Overall Crime Grade":"A-","Violent Crime Grade":"A-","Property Crime Grade":"B"},{"Nearby Zip":"01341, MA","Overall Crime Grade":"A","Violent Crime Grade":"C-","Property Crime Grade":"A"},{"Nearby Zip":"01301, MA","Overall Crime Grade":"C+","Violent Crime Grade":"C-","Property Crime Grade":"C"},{"Nearby Zip":"01330, MA","Overall Crime Grade":"A","Violent Crime Grade":"A-","Property Crime Grade":"A"},{"Nearby Zip":"01346, MA","Overall Crime Grade":"A","Violent Crime Grade":"C","Property Crime Grade":"A"},{"Nearby Zip":"01339, MA","Overall Crime Grade":"A-","Violent Crime Grade":"C","Property Crime Grade":"A"},{"Nearby Zip":"01342, MA","Overall Crime Grade":"A","Violent Crime Grade":"B+","Property Crime Grade":"A+"},{"Nearby Zip":"01376, MA","Overall Crime Grade":"B-","Violent Crime Grade":"C+","Property Crime Grade":"B-"},{"Nearby Zip":"01337, MA","Overall Crime Grade":"A","Violent Crime Grade":"B-","Property Crime Grade":"A"}],"Similar Population Crime Rates":[{"Similar Zip":"34217, FL","Overall Crime Grade":"A-","Violent Crime Grade":"C+","Property Crime Grade":"C+"},{"Similar Zip":"72046, AR","Overall Crime Grade":"F","Violent Crime Grade":"D-","Property Crime Grade":"D-"},{"Similar Zip":"52778, IA","Overall Crime Grade":"B","Violent Crime Grade":"A-","Property Crime Grade":"A-"},{"Similar Zip":"54126, WI","Overall Crime Grade":"A","Violent Crime Grade":"A+","Property Crime Grade":"A+"},{"Similar Zip":"02715, MA","Overall Crime Grade":"A+","Violent Crime Grade":"A-","Property Crime Grade":"A-"},{"Similar Zip":"67025, KS","Overall Crime Grade":"B-","Violent Crime Grade":"B+","Property Crime Grade":"B+"},{"Sim…