You need crime risk signals by ZIP code and you need them in your app this week. By the end of this post, you’ll query a ZIP, get an overall crime grade plus a breakdown of violent, property, and other crime rates, and drop those numbers straight into your frontend or scoring pipeline.
What this API delivers
The Crime Data By ZipCode API returns a single JSON payload for a given U.S. ZIP code with:
- Overall Crime Grade
- Violent Crime Grade and individual violent crime rates
- Property Crime Grade and individual property crime rates
- Other Crime Grade and individual “other” crime rates
- Nearby ZIP codes with their grades
- ZIPs with similar population and their grades
Teams use this data to enrich listings, screen service areas, add risk flags to quotes, or guide users during onboarding or checkout. It’s a single GET request with a ZIP parameter, so integration is fast.
Getting started on Zyla API Hub
Open the listing for the API on Zyla API Hub, click Subscribe (or Start Free Trial if available), and copy your key. Zyla uses one account, one API key, and one subscription model across more than 10,000 public APIs. Billing is subscription + quota, not pay-per-call. For this API, you can begin with a 7-day trial from the listing page.
API page: Start 7-day trial on Crime Data By ZipCode API
You’ll use the key in the Authorization header as: Authorization: Bearer YOUR_API_KEY.
Endpoint overview
Get Crime Rates by ZIP
- Method: GET
- URL: https://zylalabs.com/api/824/crime-data-by-zipcode-api/583/get-crime-rates-by-zip
- Description: Returns an overall crime score and detailed breakdown for the ZIP.
- Query parameters:
- zip (number, required): The ZIP code to analyze. Example: 01370
Quick test with curl
Copy-paste this command, replace YOUR_API_KEY, and run it in your terminal. This hits the live Hub endpoint.
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 example 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…
Field highlights you’ll typically use:
- Overall.Zipcode: the ZIP you queried.
- Overall Crime Grade, Violent Crime Grade, Property Crime Grade, Other Crime Grade: letter grades summarizing risk levels.
- Crime BreakDown: nested objects containing individual category rates (values are numeric strings) plus totals and scores.
- Crime Rates Nearby: nearby ZIPs and their grades for comparison.
- Similar Population Crime Rates: ZIPs with similar population profiles and their grades.
Notes: The endpoint returns a single JSON object for the requested ZIP. No pagination is involved. Rates are returned as strings; convert to numbers if you’ll compute aggregates on your side.
Production-ready fetch in Python
Below is a minimal Python example using the same endpoint. It shows how to pass the Authorization header, check status, and extract the fields most apps display.
import os
import requests
API_KEY = os.getenv("ZYLALABS_API_KEY", "YOUR_API_KEY")
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=15)
resp.raise_for_status()
data = resp.json()
overall = data.get("Overall", {})
grades = {
"overall": overall.get("Overall Crime Grade"),
"violent": overall.get("Violent Crime Grade"),
"property": overall.get("Property Crime Grade"),
"other": overall.get("Other Crime Grade"),
}
# Pick out some detailed rates if present
violent_block = next((b for b in data.get("Crime BreakDown", []) if "Violent Crime Rates" in b), {})
violent_rates = violent_block.get("Violent Crime Rates", {})
print(f"ZIP: {overall.get('Zipcode')}")
print(f"Grades: {grades}")
print("Violent rates (string values):", violent_rates)
# Nearby zips for context
nearby = data.get("Crime Rates Nearby", [])
print("Nearby ZIPs and overall grades:")
for item in nearby[:5]:
print("-", item.get("Nearby Zip"), item.get("Overall Crime Grade"))
Implementation tips that save time
- Authentication: Use the Authorization header with a Bearer token. Do not append the key as a query parameter to the Hub endpoint.
- Data types: Many rate values arrive as strings (e.g., "2.759"). Cast to float only if you need math on them.
- Caching: Grades and rates for a given ZIP tend not to change minute-to-minute. Cache responses per ZIP to cut latency and cost. A 24-hour TTL is a pragmatic starting point; adjust based on your update cadence.
- Display: Letter grades are the fastest way to communicate risk at a glance; keep raw rates in a tooltip or details panel.
- Error handling: Treat non-2xx as failures and surface actionable logs with the full request URL (minus the key) and status code.
Common use cases
- Property listing pages: Show the Overall Crime Grade with an expand section for Violent/Property/Other rates.
- Insurance quoting: Add a ZIP-level modifier derived from the grades before final pricing.
- Logistics/service eligibility: Gate high-value deliveries or technician dispatch by ZIP threshold (e.g., block if Violent Crime Grade ≤ D).
- Lead routing: Rank leads by nearby ZIP comparison to prioritize lower-risk areas without persisting PII.
- Tenant screening: Snapshot neighborhood risk alongside credit/background checks for a fuller context.
How to call from an AI agent with MCP
You can call Zyla APIs from model-context clients (e.g., Claude Code, Cursor, Windsurf) using Zyla’s MCP gateway. Configure your MCP client to use:
- Gateway: https://mcp.zylalabs.com/mcp?apikey=YOUR_API_KEY
- Then instruct the agent to perform an HTTP GET to the Hub URL you’d usually call from code:
https://zylalabs.com/api/824/crime-data-by-zipcode-api/583/get-crime-rates-by-zip?zip=01370 - Include the same Authorization header: Bearer YOUR_API_KEY.
Details on the MCP gateway are here: MCP. This setup lets your agent retrieve crime grades on demand and use them in tool-driven workflows without custom backend glue.
End-to-end flow checklist
- Visit the API page on Zyla and start the 7-day trial.
- Copy your API key and store it in your secrets manager or env vars.
- Call the endpoint with your chosen ZIP and Authorization header.
- Convert any needed string rate values to floats.
- Render Overall Crime Grade prominently; keep the breakdown accessible.
- Cache per ZIP to improve UX and reduce redundant calls.
FAQ
What’s the base URL and method?
Use a GET request to: https://zylalabs.com/api/824/crime-data-by-zipcode-api/583/get-crime-rates-by-zip with the zip query parameter.
How do I authenticate?
Send Authorization: Bearer YOUR_API_KEY in the header. Get your key from the API page on Zyla after you subscribe.
Is there a free plan?
There is no free plan. This API uses a subscription + quota model. You can begin with a 7-day trial from the listing page; check the API page for current access options and pricing.
Does the response paginate?
No. The endpoint returns a single JSON object for the requested ZIP with overall grades, breakdowns, and nearby/similar ZIP sections.
Can I call it from an AI agent?
Yes. Use Zyla’s MCP gateway at https://mcp.zylalabs.com/mcp?apikey=YOUR_API_KEY and instruct the agent to perform the same GET request to the Hub URL with your Authorization header.
Next step
Create your Zyla account, start the trial, and ship your ZIP-to-crime-grade feature today. The listing page has the trial and all details you need: Start 7-day trial on Crime Data By ZipCode API. You can also browse more categories on Zyla API Hub or explore other datasets on the marketplace when you’re ready to expand your integration.
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…