{
    "api": "BrandShyp San Antonio Crime Data API",
    "version": "v1",
    "status": "stable",
    "description": "A read-only, versioned public API over 42+ months of SAPD NIBRS Group A offences, cleaned and aggregated to ZIP code. This is the same reconciled cube that powers https://brandshyp.org/san-antonio-crime-map/.",
    "generated": "2026-07-13",
    "coverage": {
        "first_month": "2023-01",
        "last_month": "2026-06",
        "n_months": 42,
        "n_zips": 62,
        "n_cells": 50084,
        "geography": "ZIP code, the finest geography the open data publishes. The source has no latitude/longitude and no street address.",
        "measure": "Reported offences (NIBRS Group A). Reports, not convictions; some are later unfounded. Excludes crimes never reported and non-Group-A offences (DUI, disorderly conduct, trespass, and others)."
    },
    "integrity": {
        "method": "reconcile-or-refuse",
        "note": "The aggregate is checked against an independent COUNT(*) of the source table at build time; the dataset is not published if the two disagree, because the source datastore silently truncates large responses.",
        "rows_source": 516255,
        "rows_mapped": 511059,
        "rows_excluded": 5196,
        "note_excluded": "Excluded rows carry a blank or unmappable ZIP code and are dropped rather than assigned somewhere false."
    },
    "source": {
        "name": "City of San Antonio open data — SAPD Offenses",
        "url": "https://data.sanantonio.gov/dataset/sapd-offenses",
        "license": "CC-BY (City of San Antonio)",
        "scope": "NIBRS Group A offenses only",
        "population": "U.S. Census ACS 5-year (2023), table B01003",
        "min_pop_for_rate": 5000,
        "rows_source": 516255,
        "rows_mapped": 511059,
        "rows_excluded": 5196,
        "incidents": 472301
    },
    "license": {
        "name": "Creative Commons Attribution 4.0 International (CC BY 4.0)",
        "url": "https://creativecommons.org/licenses/by/4.0/",
        "attribution": "Contains information from the City of San Antonio, licensed under CC BY 4.0. Cleaning, ZIP aggregation, and analysis by BrandShyp."
    },
    "endpoints": [
        {
            "method": "GET",
            "path": "/api/v1/crime",
            "summary": "This discovery document."
        },
        {
            "method": "GET",
            "path": "/api/v1/crime/offenses",
            "summary": "The full offences cube (JSON): counts by ZIP x month x offence type, category trees, and the analysis series."
        },
        {
            "method": "GET",
            "path": "/api/v1/crime/offenses.csv",
            "summary": "The same cube as tidy CSV."
        },
        {
            "method": "GET",
            "path": "/api/v1/crime/geo",
            "summary": "Pre-projected ZIP boundary SVG paths and area in square miles."
        },
        {
            "method": "GET",
            "path": "/api/v1/crime/zips",
            "summary": "ZIP directory: code, area name, population, area in square miles."
        },
        {
            "method": "GET",
            "path": "/api/v1/openapi.json",
            "summary": "OpenAPI 3.1 description of this API."
        }
    ],
    "documentation": "https://brandshyp.org/crime-data-api/",
    "openapi": "https://brandshyp.org/api/v1/openapi.json",
    "methodology": "https://brandshyp.org/san-antonio-crime-map/",
    "contact": {
        "name": "BrandShyp",
        "url": "https://brandshyp.org/contact-us/"
    },
    "versioning": "Breaking changes ship under a new path prefix (/api/v2/). The v1 response shape is additive-only."
}