DEV Community

Crime Brasil
Crime Brasil

Posted on • Originally published at crimebrasil.com.br

3 million geocoded crime records from Brazil — free API and datasets

We've been quietly building Crime Brasil — an open-data platform covering violent crime across Brazil. Here's what's in it and how to use it.

What the data covers

  • Rio Grande do Sul: 2.99 million occurrences (2022–2025), 497 municipalities, geocoded to neighborhood level
  • Minas Gerais: 965K violent-crime records (2019–2026), 853 municipalities
  • Rio de Janeiro: 37K ISP/CISP records
  • PRF DATATRAN: ~500K federal road accidents nationally (2020–2026)
  • DATASUS SINAN: interpersonal-violence records nationally (2009–2024)

All data comes from state Secretariats of Public Security (SSP-RS, SSP-MG, ISP-RJ) and federal sources. License: CC BY 4.0.

The API

Every city/state has its own endpoint:

# Crime counts by month for Porto Alegre
curl 'https://crimebrasil.com.br/api/city/rs/porto-alegre?type=monthly'

# Top 10 neighborhoods by homicide, last 12 months
curl 'https://crimebrasil.com.br/api/city/rs/porto-alegre/bairros?crime=homicidio'
Enter fullscreen mode Exit fullscreen mode

The response is plain JSON — crime counts aggregated by type, period, and neighborhood.

Downloading datasets

Full datasets are on:

  • Zenodo — DOI 10.5281/zenodo.19712036 (RS, 3M rows)
  • Zenodo — DOI 10.5281/zenodo.19711971 (MG, 965K rows)
  • Kaggle — MG dataset
  • HuggingFace — RS dataset

Quick Python example

import pandas as pd

# Load RS dataset from Zenodo
df = pd.read_csv(
    'https://zenodo.org/records/19712036/files/crime-brasil-rs-2022-2025.csv.gz',
    compression='gzip'
)

# Homicides per year in Porto Alegre
homicidios = df[
    (df['municipio_fato'] == 'PORTO ALEGRE') &
    (df['tipo_enquadramento'].str.contains('HOMICIDIO'))
].groupby(df['year_month'].str[:4]).size()

print(homicidios)
Enter fullscreen mode Exit fullscreen mode

Coverage and methodology

We cover 99.4% of the Brazilian population across the states we have data for. The geocoding pipeline assigns lat/lon using a four-pass hierarchy:

  1. Exact address match
  2. Neighborhood centroid
  3. Municipality centroid
  4. State centroid (fallback)

99.99% of RS records land at pass 1 or 2.

LAI requests in progress

We've filed Freedom of Information (LAI) requests in 14 states: AL, AM, BA, ES, MA, MG, PR, RJ, RN, RO, RR, RS, SC, TO. As responses arrive, we publish them.


The platform is at crimebrasil.com.br. Press kit and methodology at crimebrasil.com.br/imprensa.

Top comments (0)