Proximitii Book a Demo

Crime Stats API Documentation

Request crime statistics and supporting context for a location. Read the installation details, parameters and examples.

The Proximitii Crime Stats API returns crime statistics for a location, radius, and date range. Results include incident counts, a breakdown by incident type, and the CrimeoMeter Safety Index (CSI) when available. A higher CSI indicates higher crime risk; it is not a score where higher means safer.

Displaying this API's data on a public page? Show the Powered by Proximitii logo directly below it. See API Attribution.

Example Calls

node.js (server-side)

const params = new URLSearchParams({
  lat: '40.7788',
  lon: '-73.9810',
  radius: '1000',
  munit: 'm',
  datetime_ini: '2025-10-01',
  datetime_end: '2026-09-30'
});

const response = await fetch(
  `https://api.proximitii.com/v1/crime-stats/?${params}`,
  {
    headers: {
      'Public-Key': process.env.PROXIMITII_PUBLIC_KEY,
      'Private-Key': process.env.PROXIMITII_PRIVATE_KEY
    }
  }
);

const body = await response.json();
if (!response.ok) throw new Error(body.status?.message || 'Crime stats request failed');
console.log(body.data);

PHP (server-side)

<?php
$params = http_build_query([
    'lat' => 40.7788,
    'lon' => -73.9810,
    'radius' => 1000,
    'munit' => 'm',
    'datetime_ini' => '2025-10-01',
    'datetime_end' => '2026-09-30'
]);
$ch = curl_init('https://api.proximitii.com/v1/crime-stats/?' . $params);
curl_setopt_array($ch, [
    CURLOPT_HTTPHEADER => [
        'Public-Key: ' . getenv('PROXIMITII_PUBLIC_KEY'),
        'Private-Key: ' . getenv('PROXIMITII_PRIVATE_KEY')
    ],
    CURLOPT_RETURNTRANSFER => true
]);
$body = json_decode(curl_exec($ch), true);
$httpStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($httpStatus !== 200) throw new RuntimeException('Crime stats request failed');
print_r($body['data']);

Keys

Use your existing active Proximitii public and private API keys. Send them as Public-Key and Private-Key request headers. Make this request from your server; never expose the private key in browser JavaScript or a URL. You do not need a separate CrimeoMeter key.

Values

NameDescriptionDefault ValueAccepted ValuesVariable
LatitudeCenter of the search area.RequiredDecimal between -90 and 90lat
LongitudeCenter of the search area.RequiredDecimal between -180 and 180lon
RadiusDistance from the center. The converted distance must be 100 to 6400 meters.RequiredPositive numberradius
Radius UnitUnit for radius.mm (meters) or mi (miles)munit
Start DateFirst day of the reporting period, inclusive.RequiredYYYY-MM-DDdatetime_ini
End DateLast day of the reporting period, inclusive. Must be on or after the start date; maximum span is 366 days.RequiredYYYY-MM-DDdatetime_end

Sample Output

Illustrative response; counts and available incident types depend on the location and period. CrimeoMeter's stats fields are returned inside data.

{
  "data": {
    "population_count": 38484,
    "incidents_count": 49,
    "incidents_types": [
      {
        "incident_type": "Theft From Motor Vehicle",
        "incident_type_count": 18,
        "incident_type_ratio": 24.39
      }
    ],
    "incidents_types_ratio": 66.39,
    "csi": 51.07
  },
  "status": { "code": "200", "message": "OK" }
}

Successful responses may include X-Cache: HIT or X-Cache: MISS. A higher csi means higher crime risk.