API Documentation

Welcome to the DoorProfit API! Get comprehensive location intelligence data for any US address with our simple REST API.

We provide three focused endpoints so you can query exactly the data you need.

Available Endpoints

  • /v1/crime - Crime statistics, safety scores, crime breakdowns, and recent incidents
  • /v1/neighborhood - Demographics, income, housing, education, cost of living, rent, weather & disaster risk
  • /v1/offenders - Registered registered offenders with photos, addresses, and distances
  • /v1/usage - Check your API usage and remaining quota (free, doesn't count against quota)

The crime, neighborhood, and offenders endpoints accept either a street address or latitude/longitude coordinates.

Base URL

https://api.doorprofit.com/v1/

Authentication

All API requests require authentication using your API key. You can pass your key as a query parameter.

💡

Don't have an API key yet? Sign up for free to get your key instantly.

Using Your API Key

Include your API key as the key parameter in every request:

https://api.doorprofit.com/v1/crime?address=500+Main+St+Dallas+TX+75202&key=YOUR_API_KEY
⚠️

Keep your API key secure! Don't expose it in client-side code or public repositories. Use environment variables or server-side requests.

Quick Start

Get up and running in under 5 minutes. Here's how to make your first API call:

Get Your API Key

Sign up for a free account to get your API key. You'll receive 10 free API calls per month to test the integration.

Choose Your Endpoint

Call the endpoint for the data you need:

# Get crime statistics & safety scores
curl "https://api.doorprofit.com/v1/crime?address=500+Main+St+Dallas+TX+75202&key=YOUR_API_KEY"

# Get neighborhood demographics
curl "https://api.doorprofit.com/v1/neighborhood?address=500+Main+St+Dallas+TX+75202&key=YOUR_API_KEY"

# Get registered offenders in the area
curl "https://api.doorprofit.com/v1/offenders?address=500+Main+St+Dallas+TX+75202&key=YOUR_API_KEY"

Parse the Response

You'll receive a JSON response with the requested data. That's it - you're ready to build!

Crime Endpoint

Get crime statistics, safety scores, crime breakdowns, and recent incident data for any location. Accepts either a street address or coordinates.

GET /v1/crime

Parameters

Parameter Type Description
key Required string Your API key

Location (provide one of the following):

Option Parameters Description
Address address Full street address (URL encoded). Example: 500+Main+St+Dallas+TX+75202
Coordinates lat + lng Latitude and longitude. Example: lat=32.778635&lng=-96.807295

Example Requests

# Query by address
curl "https://api.doorprofit.com/v1/crime?address=500+Main+St+Dallas+TX+75202&key=YOUR_API_KEY"

# Query by coordinates
curl "https://api.doorprofit.com/v1/crime?lat=32.778635&lng=-96.807295&key=YOUR_API_KEY"
// Query by address
const response = await fetch(
  'https://api.doorprofit.com/v1/crime?address=500+Main+St+Dallas+TX+75202&key=YOUR_API_KEY'
);
const data = await response.json();

console.log(data.crime_score);      // "C+"
console.log(data.crime_breakdown);  // Crime by type
console.log(data.incidents.count);  // Recent incident count

// Or query by coordinates
const coordsResponse = await fetch(
  'https://api.doorprofit.com/v1/crime?lat=32.778635&lng=-96.807295&key=YOUR_API_KEY'
);
import requests

# Query by address
response = requests.get(
    'https://api.doorprofit.com/v1/crime',
    params={
        'address': '500 Main St Dallas TX 75202',
        'key': 'YOUR_API_KEY'
    }
)
data = response.json()

print(data['crime_score'])        # "C+"
print(data['crime_breakdown'])    # Crime by type

# Or query by coordinates
response = requests.get(
    'https://api.doorprofit.com/v1/crime',
    params={'lat': 32.778635, 'lng': -96.807295, 'key': 'YOUR_API_KEY'}
)
<?php
// Query by address
$address = urlencode('500 Main St Dallas TX 75202');
$apiKey = 'YOUR_API_KEY';
$url = "https://api.doorprofit.com/v1/crime?address={$address}&key={$apiKey}";

$response = file_get_contents($url);
$data = json_decode($response, true);

echo $data['crime_score'];        // "C+"
echo $data['crime_breakdown'];    // Crime by type

// Or query by coordinates
$url = "https://api.doorprofit.com/v1/crime?lat=32.778635&lng=-96.807295&key={$apiKey}";

Neighborhood Endpoint

Get comprehensive neighborhood data including demographics, income, housing, education, cost of living, rent estimates, weather, and natural disaster risk. Accepts either a street address or coordinates.

GET /v1/neighborhood

Parameters

Parameter Type Description
key Required string Your API key

Location (provide one of the following):

Option Parameters Description
Address address Full street address (URL encoded). Example: 500+Main+St+Dallas+TX+75202
Coordinates lat + lng Latitude and longitude. Example: lat=32.778635&lng=-96.807295

Example Requests

# Query by address
curl "https://api.doorprofit.com/v1/neighborhood?address=500+Main+St+Dallas+TX+75202&key=YOUR_API_KEY"

# Query by coordinates
curl "https://api.doorprofit.com/v1/neighborhood?lat=32.778635&lng=-96.807295&key=YOUR_API_KEY"
// Query by address
const response = await fetch(
  'https://api.doorprofit.com/v1/neighborhood?address=500+Main+St+Dallas+TX+75202&key=YOUR_API_KEY'
);
const data = await response.json();

console.log(data.neighborhood.name);                        // "West End Historic District"
console.log(data.neighborhood.demographics.population);     // 4280
console.log(data.neighborhood.income.median);               // 52400
console.log(data.neighborhood.housing.median_home_value);   // 285000
console.log(data.neighborhood.rent.median);                 // 1150
console.log(data.neighborhood.cost_of_living.overall_index); // 95.2
import requests

# Query by address
response = requests.get(
    'https://api.doorprofit.com/v1/neighborhood',
    params={
        'address': '500 Main St Dallas TX 75202',
        'key': 'YOUR_API_KEY'
    }
)
data = response.json()

print(data['neighborhood']['name'])                          # "West End Historic District"
print(data['neighborhood']['demographics']['population'])    # 4280
print(data['neighborhood']['income']['median'])              # 52400
print(data['neighborhood']['housing']['median_home_value'])  # 285000
print(data['neighborhood']['rent']['median'])                # 1150
<?php
$address = urlencode('500 Main St Dallas TX 75202');
$apiKey = 'YOUR_API_KEY';
$url = "https://api.doorprofit.com/v1/neighborhood?address={$address}&key={$apiKey}";

$response = file_get_contents($url);
$data = json_decode($response, true);

echo $data['neighborhood']['name'];                          // "West End Historic District"
echo $data['neighborhood']['demographics']['population'];    // 4280
echo $data['neighborhood']['income']['median'];              // 52400
echo $data['neighborhood']['housing']['median_home_value'];  // 285000
echo $data['neighborhood']['rent']['median'];                // 1150

Registered Offenders Endpoint

Search for registered registered offenders by location or by name. Returns offender details including photos, addresses, offenses, and distances.

GET /v1/offenders

Parameters

Parameter Type Description
key Required string Your API key

Search by Location

Find offenders near a specific address or coordinates.

Parameter Type Description
address string Full street address (URL encoded). Example: 500+Main+St+Dallas+TX+75202
lat + lng number Latitude and longitude coordinates. Example: lat=32.778635&lng=-96.807295
radius number Search radius in miles. Default: 1, Max: 5

Search by Name

Search for offenders by name and/or location details. Use any combination of the parameters below - at least one is required.

Parameter Type Description
first_name string Offender's first name
last_name string Offender's last name
city string City name
state string Two-letter state code. Example: OK, TX
zipcode string 5-digit ZIP code

Example Requests

# Search by address (default 1 mile radius)
curl "https://api.doorprofit.com/v1/offenders?address=500+Main+St+Dallas+TX+75202&key=YOUR_API_KEY"

# Search by coordinates with 2 mile radius
curl "https://api.doorprofit.com/v1/offenders?lat=32.778635&lng=-96.807295&radius=2&key=YOUR_API_KEY"

# Search by name
curl "https://api.doorprofit.com/v1/offenders?last_name=Smith&state=TX&key=YOUR_API_KEY"

# Search by name and city
curl "https://api.doorprofit.com/v1/offenders?first_name=John&city=Dallas&state=TX&key=YOUR_API_KEY"
// Search by address
const response = await fetch(
  'https://api.doorprofit.com/v1/offenders?address=500+Main+St+Dallas+TX+75202&key=YOUR_API_KEY'
);
const data = await response.json();

console.log(data.offenders);        // Array of offenders
console.log(data.offenders_count);  // Total count

// Search by name
const nameSearch = await fetch(
  'https://api.doorprofit.com/v1/offenders?last_name=Smith&state=TX&key=YOUR_API_KEY'
);
const nameResults = await nameSearch.json();

// Search with multiple criteria
const params = new URLSearchParams({
  first_name: 'John',
  city: 'Dallas',
  state: 'TX',
  key: 'YOUR_API_KEY'
});
const multiSearch = await fetch(`https://api.doorprofit.com/v1/offenders?${params}`);
import requests

# Search by address
response = requests.get(
    'https://api.doorprofit.com/v1/offenders',
    params={
        'address': '500 Main St Dallas TX 75202',
        'key': 'YOUR_API_KEY'
    }
)
data = response.json()
print(f"Found {data['offenders_count']} offenders nearby")

# Search by name
response = requests.get(
    'https://api.doorprofit.com/v1/offenders',
    params={
        'last_name': 'Smith',
        'state': 'TX',
        'key': 'YOUR_API_KEY'
    }
)

# Search with multiple criteria
response = requests.get(
    'https://api.doorprofit.com/v1/offenders',
    params={
        'first_name': 'John',
        'city': 'Dallas',
        'state': 'TX',
        'key': 'YOUR_API_KEY'
    }
)
<?php
$apiKey = 'YOUR_API_KEY';

// Search by address
$address = urlencode('500 Main St Dallas TX 75202');
$url = "https://api.doorprofit.com/v1/offenders?address={$address}&key={$apiKey}";
$data = json_decode(file_get_contents($url), true);
echo "Found " . $data['offenders_count'] . " offenders nearby\n";

// Search by name
$url = "https://api.doorprofit.com/v1/offenders?last_name=Smith&state=TX&key={$apiKey}";
$data = json_decode(file_get_contents($url), true);

// Search with multiple criteria
$params = http_build_query([
    'first_name' => 'John',
    'city' => 'Dallas',
    'state' => 'TX',
    'key' => $apiKey
]);
$url = "https://api.doorprofit.com/v1/offenders?{$params}";

Usage Statistics Endpoint

Check your current API usage, remaining quota, and subscription details. This endpoint is free and does not count against your API quota.

GET /v1/usage

Parameters

Parameter Type Description
key Required string Your API key

Example Request

curl "https://api.doorprofit.com/v1/usage?key=YOUR_API_KEY"

Example Response

{
  "success": true,
  "data": {
    "plan": {
      "type": "growth",
      "name": "Growth",
      "price_monthly": 50
    },
    "monthly": {
      "limit": 600,
      "used": 127,
      "remaining": 473,
      "percentage_used": 21.2,
      "resets_at": "2026-03-01T00:00:00+00:00"
    },
    "daily": {
      "limit": 3000,
      "used": 45,
      "remaining": 2955,
      "percentage_used": 1.5,
      "resets_at": "2026-02-03T00:00:00+00:00"
    },
    "rate_limit": {
      "requests_per_second": 10
    },
    "overage": {
      "enabled": true,
      "calls": 0,
      "amount_due": "0.00",
      "rate_per_call": "0.10"
    },
    "account": {
      "status": "active",
      "subscription_status": "active",
      "blocked": false
    }
  },
  "meta": {
    "note": "This endpoint does not count against your API quota.",
    "timestamp": "2026-02-02T15:30:00+00:00"
  }
}

Crime Response

The /v1/crime endpoint returns crime statistics, safety scores, and recent incidents.

Response Fields

crime_scorestring
Letter grade from A+ (safest) to F (least safe). Example: "C+"
crime_numericnumber
Numeric crime score from 0 to 1. Lower is safer. Example: 0.21
crime_descriptionstring
Human-readable description of the crime level. Example: "Higher than average"
crime_breakdownobject
Breakdown by crime type (assault, theft, robbery, burglary, murder, vehicle theft) compared to national average
incidentsobject
Recent crime incidents with total count, date range, and individual incident data with coordinates

Example Response

{
  "success": true,
  "location": {
    "address": "500 Main St, Dallas, TX 75202, USA",
    "city": "Dallas",
    "state": "TX",
    "zipcode": "75202",
    "county": "Dallas County",
    "lat": 32.78014,
    "lng": -96.800454
  },
  "crime_score": "C+",
  "crime_numeric": 0.21,
  "crime_description": "Higher than average",
  "crime_breakdown": {
    "overall": "38% above national average",
    "assault": "38% above national average",
    "theft": "35% above national average",
    "robbery": "47% above national average",
    "burglary": "56% above national average"
  },
  "incidents": {
    "radius_feet": 1000,
    "date_from": "2025-10-04",
    "date_to": "2026-01-06",
    "count": 72,
    "data": [
      {
        "type": "Theft",
        "date": "2025-12-15",
        "address": "501 Main St",
        "distance_feet": 250,
        "lat": 32.7802,
        "lng": -96.8005
      }
    ]
  }
}

Neighborhood Response

The /v1/neighborhood endpoint returns comprehensive demographic, economic, housing, education, cost of living, rent, and weather data for the neighborhood at the given location.

Top-Level Fields

neighborhood.namestring
Name of the neighborhood
neighborhood.typestring
"neighborhood" or "block_group" (fallback when no named neighborhood)

Demographics

demographics.populationnumber
Current population
demographics.population_densitynumber
People per square mile
demographics.population_growth_pctnumber
Population growth over last 10 years (%)
demographics.median_agenumber
Median age of residents
demographics.genderobject
Gender split: male_pct, female_pct
demographics.raceobject
Racial demographics: white_pct, black_pct, asian_pct, hispanic_pct, native_pct
demographics.age_distributionobject
Age brackets: 0_5, 6_11, 12_17, 18_24, 25_34, 35_44, 45_54, 55_64, 65_74, 75_84, 85_plus (all %)

Income & Housing

income.mediannumber
Median household income (USD)
income.averagenumber
Average household income (USD)
income.distributionobject
Income brackets: under_15k through 200k_plus (all %)
housingobject
median_home_value, total_households, avg_year_built, plus occupancy (owner/renter/vacant %) and household_types (families/married/children %)

Education, Cost of Living & Rent

educationobject
Attainment rates: high_school_pct, associates_pct, bachelors_pct, graduate_pct
cost_of_livingobject
Index values (100 = national avg): overall_index, housing, food, healthcare, transportation, utilities, apparel, education, entertainment
rentobject
median, average, and by_bedroom (1br, 2br, 3br, 4br)

Weather

weather.temperaturesobject
Seasonal highs/lows in °F: annual_high, annual_low, january_high, july_high, etc.
weather.precipitationobject
rain_inches, rain_days_per_year, snow_inches, snow_days_per_year
weather.natural_disaster_riskobject
Risk indices (100 = national avg): overall_index, earthquake, hail, hurricane, tornado, wind

Example Response

{
  "success": true,
  "location": {
    "address": "500 Main St, Dallas, TX 75202, USA",
    "city": "Dallas",
    "state": "TX",
    "zipcode": "75202",
    "county": "Dallas County",
    "lat": 32.78014,
    "lng": -96.800454
  },
  "neighborhood": {
    "name": "West End Historic District",
    "type": "neighborhood",
    "demographics": {
      "population": 4280,
      "population_density": 1200.5,
      "population_growth_pct": 3.5,
      "median_age": 34.2,
      "gender": { "male_pct": 51.2, "female_pct": 48.8 },
      "race": {
        "white_pct": 45.2,
        "black_pct": 28.3,
        "asian_pct": 5.1,
        "hispanic_pct": 18.7,
        "native_pct": 0.8
      },
      "age_distribution": {
        "0_5": 6.2, "6_11": 5.8, "12_17": 4.9,
        "18_24": 12.1, "25_34": 22.5, "35_44": 18.3,
        "45_54": 12.8, "55_64": 9.1, "65_74": 5.2,
        "75_84": 2.1, "85_plus": 1.0
      }
    },
    "income": {
      "median": 52400,
      "average": 68200,
      "distribution": {
        "under_15k": 12.5, "15k_25k": 8.3, "25k_35k": 9.1,
        "35k_50k": 14.2, "50k_75k": 18.7, "75k_100k": 15.1,
        "100k_125k": 8.9, "125k_150k": 5.2, "150k_200k": 4.8,
        "200k_plus": 3.2
      }
    },
    "housing": {
      "median_home_value": 285000,
      "total_households": 2100,
      "avg_year_built": 1978,
      "occupancy": {
        "owner_pct": 42.1,
        "renter_pct": 48.2,
        "vacant_pct": 9.7
      },
      "household_types": {
        "families_pct": 35.2,
        "married_pct": 28.1,
        "with_children_pct": 22.5
      }
    },
    "education": {
      "high_school_pct": 87.5,
      "associates_pct": 5.8,
      "bachelors_pct": 32.1,
      "graduate_pct": 12.4
    },
    "cost_of_living": {
      "overall_index": 95.2,
      "housing": 85.3,
      "food": 98.1,
      "healthcare": 102.5,
      "transportation": 97.8,
      "utilities": 93.2,
      "apparel": 96.5,
      "education": 90.1,
      "entertainment": 94.3
    },
    "rent": {
      "median": 1150,
      "average": 1280,
      "by_bedroom": {
        "1br": 950,
        "2br": 1200,
        "3br": 1550,
        "4br": 1900
      }
    },
    "weather": {
      "temperatures": {
        "annual_high": 76.8, "annual_low": 55.2,
        "january_high": 56.3, "january_low": 36.1,
        "april_high": 76.2, "april_low": 55.8,
        "july_high": 96.5, "july_low": 76.3,
        "october_high": 78.1, "october_low": 56.9
      },
      "precipitation": {
        "rain_inches": 37.6, "rain_days_per_year": 81,
        "snow_inches": 1.5, "snow_days_per_year": 2
      },
      "natural_disaster_risk": {
        "overall_index": 195.3,
        "earthquake": 2.1,
        "hail": 152.8,
        "hurricane": 18.5,
        "tornado": 280.1,
        "wind": 95.4
      }
    }
  }
}

Registered Offenders Response

The /v1/offenders endpoint returns a list of registered registered offenders within the specified radius.

Response Fields

successboolean
Whether the request was successful
offendersarray
Array of registered offenders near the location
offenders_countnumber
Total number of offenders found
radiusnumber
Search radius used (in miles)

Offender Object Fields

namestring
Offender's full name
addressstring
Registered address of the offender
lat / lngnumber
Coordinates of the offender's address
distancenumber
Distance in miles from the queried location
photostring|null
URL to offender photo (when available)
offensestring
Description of the offense
offense_datestring
Date of the offense (YYYY-MM-DD format)
risk_levelstring
Risk classification level

Example Response

{
  "success": true,
  "offenders": [
    {
      "name": "John Doe",
      "address": "512 S Houston St, Dallas, TX",
      "lat": 32.7780,
      "lng": -96.8070,
      "distance": 0.3,
      "photo": "https://api.doorprofit.com/offenders/photos/12345.jpg",
      "offense": "Sexual Assault",
      "offense_date": "2019-06-15",
      "risk_level": "Level 2"
    },
    {
      "name": "Jane Smith",
      "address": "789 Commerce St, Dallas, TX",
      "lat": 32.7795,
      "lng": -96.8055,
      "distance": 0.8,
      "photo": null,
      "offense": "Indecent Exposure",
      "offense_date": "2021-03-22",
      "risk_level": "Level 1"
    }
  ],
  "offenders_count": 2,
  "radius": 1
}

Complete Code Examples

Full working examples showing how to use both API endpoints in popular programming languages.

JavaScript / Node.js

JavaScript
// DoorProfit API - JavaScript Example
const API_KEY = 'YOUR_API_KEY';
const BASE_URL = 'https://api.doorprofit.com/v1';

// Get crime data
async function getCrimeData(address) {
  const url = `${BASE_URL}/crime?address=${encodeURIComponent(address)}&key=${API_KEY}`;
  const response = await fetch(url);
  if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);
  return response.json();
}

// Get neighborhood demographics
async function getNeighborhood(address) {
  const url = `${BASE_URL}/neighborhood?address=${encodeURIComponent(address)}&key=${API_KEY}`;
  const response = await fetch(url);
  if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);
  return response.json();
}

// Get registered offenders
async function getOffenders(address, radius = 1) {
  const url = `${BASE_URL}/offenders?address=${encodeURIComponent(address)}&radius=${radius}&key=${API_KEY}`;
  const response = await fetch(url);
  if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);
  return response.json();
}

// Example usage
async function main() {
  try {
    const address = '500 Main St, Dallas, TX 75202';
    
    // Get crime data
    const crimeData = await getCrimeData(address);
    console.log('Crime Score:', crimeData.crime_score);
    
    // Get neighborhood demographics (separate endpoint)
    const neighborhoodData = await getNeighborhood(address);
    console.log('Median Income:', neighborhoodData.neighborhood.income.median);
    console.log('Population:', neighborhoodData.neighborhood.demographics.population);
    console.log('Median Rent:', neighborhoodData.neighborhood.rent?.median);
    
    // Get registered offenders
    const offenderData = await getOffenders(address, 2);
    console.log('Offenders found:', offenderData.offenders_count);
    offenderData.offenders.forEach(o => {
      console.log(`  ${o.name} - ${o.distance} mi away`);
    });
  } catch (error) {
    console.error('Error:', error.message);
  }
}

main();

Python

Python
"""
DoorProfit API - Python Example
pip install requests
"""
import requests
from typing import Optional

API_KEY = 'YOUR_API_KEY'
BASE_URL = 'https://api.doorprofit.com/v1'


class DoorProfitAPI:
    def __init__(self, api_key: str):
        self.api_key = api_key
    
    def get_crime(self, address: Optional[str] = None, 
                  lat: Optional[float] = None, lng: Optional[float] = None) -> dict:
        """Get crime statistics and safety scores."""
        params = {'key': self.api_key}
        if address:
            params['address'] = address
        else:
            params['lat'] = lat
            params['lng'] = lng
        
        response = requests.get(f'{BASE_URL}/crime', params=params)
        response.raise_for_status()
        return response.json()
    
    def get_neighborhood(self, address: Optional[str] = None, 
                         lat: Optional[float] = None, lng: Optional[float] = None) -> dict:
        """Get neighborhood demographics and economic data."""
        params = {'key': self.api_key}
        if address:
            params['address'] = address
        else:
            params['lat'] = lat
            params['lng'] = lng
        
        response = requests.get(f'{BASE_URL}/neighborhood', params=params)
        response.raise_for_status()
        return response.json()
    
    def get_offenders(self, address: Optional[str] = None,
                      lat: Optional[float] = None, lng: Optional[float] = None,
                      radius: float = 1) -> dict:
        """Get registered offenders near location."""
        params = {'key': self.api_key, 'radius': radius}
        if address:
            params['address'] = address
        else:
            params['lat'] = lat
            params['lng'] = lng
        
        response = requests.get(f'{BASE_URL}/offenders', params=params)
        response.raise_for_status()
        return response.json()


# Example usage
if __name__ == '__main__':
    api = DoorProfitAPI(API_KEY)
    address = '500 Main St, Dallas, TX 75202'
    
    # Get crime data
    crime_data = api.get_crime(address=address)
    print(f"Crime Score: {crime_data['crime_score']}")
    
    # Get neighborhood demographics (separate endpoint)
    hood_data = api.get_neighborhood(address=address)
    print(f"Neighborhood: {hood_data['neighborhood']['name']}")
    print(f"Median Income: ${hood_data['neighborhood']['income']['median']:,}")
    print(f"Population: {hood_data['neighborhood']['demographics']['population']:,}")
    print(f"Median Rent: ${hood_data['neighborhood']['rent'].get('median', 'N/A')}")
    
    # Get registered offenders
    offender_data = api.get_offenders(address=address, radius=2)
    print(f"\nOffenders within 2 miles: {offender_data['offenders_count']}")
    for offender in offender_data['offenders']:
        print(f"  {offender['name']} - {offender['distance']} mi away")

PHP

PHP
<?php
/**
 * DoorProfit API - PHP Example
 */

class DoorProfitAPI {
    private string $apiKey;
    private string $baseUrl = 'https://api.doorprofit.com/v1';
    
    public function __construct(string $apiKey) {
        $this->apiKey = $apiKey;
    }
    
    /**
     * Get crime statistics and safety scores
     */
    public function getCrime(?string $address = null, ?float $lat = null, ?float $lng = null): array {
        $params = ['key' => $this->apiKey];
        if ($address) {
            $params['address'] = $address;
        } else {
            $params['lat'] = $lat;
            $params['lng'] = $lng;
        }
        return $this->request('/crime', $params);
    }
    
    /**
     * Get neighborhood demographics
     */
    public function getNeighborhood(?string $address = null, ?float $lat = null, ?float $lng = null): array {
        $params = ['key' => $this->apiKey];
        if ($address) {
            $params['address'] = $address;
        } else {
            $params['lat'] = $lat;
            $params['lng'] = $lng;
        }
        return $this->request('/neighborhood', $params);
    }
    
    /**
     * Get registered offenders near location
     */
    public function getOffenders(?string $address = null, ?float $lat = null, 
                                  ?float $lng = null, float $radius = 1): array {
        $params = ['key' => $this->apiKey, 'radius' => $radius];
        if ($address) {
            $params['address'] = $address;
        } else {
            $params['lat'] = $lat;
            $params['lng'] = $lng;
        }
        return $this->request('/offenders', $params);
    }
    
    private function request(string $endpoint, array $params): array {
        $url = $this->baseUrl . $endpoint . '?' . http_build_query($params);
        
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_TIMEOUT, 30);
        
        $response = curl_exec($ch);
        $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
        curl_close($ch);
        
        if ($httpCode !== 200) {
            throw new Exception("API Error: HTTP {$httpCode}");
        }
        
        return json_decode($response, true);
    }
}

// Example usage
$api = new DoorProfitAPI('YOUR_API_KEY');
$address = '500 Main St, Dallas, TX 75202';

try {
    // Get crime data
    $crimeData = $api->getCrime($address);
    echo "Crime Score: " . $crimeData['crime_score'] . "\n";
    
    // Get neighborhood demographics (separate endpoint)
    $hoodData = $api->getNeighborhood($address);
    echo "Median Income: $" . number_format($hoodData['neighborhood']['income']['median']) . "\n";
    echo "Population: " . number_format($hoodData['neighborhood']['demographics']['population']) . "\n";
    echo "Median Rent: $" . number_format($hoodData['neighborhood']['rent']['median'] ?? 0) . "\n";
    
    // Get registered offenders
    $offenderData = $api->getOffenders($address, radius: 2);
    echo "\nOffenders within 2 miles: " . $offenderData['offenders_count'] . "\n";
    foreach ($offenderData['offenders'] as $offender) {
        echo "  {$offender['name']} - {$offender['distance']} mi away\n";
    }
} catch (Exception $e) {
    echo "Error: " . $e->getMessage();
}

Ruby

Ruby
# DoorProfit API - Ruby Example
# gem install httparty

require 'httparty'

class DoorProfitAPI
  BASE_URL = 'https://api.doorprofit.com/v1'
  
  def initialize(api_key)
    @api_key = api_key
  end
  
  def get_crime(address: nil, lat: nil, lng: nil)
    params = { key: @api_key }
    params[:address] = address if address
    params[:lat] = lat if lat
    params[:lng] = lng if lng
    request('/crime', params)
  end
  
  def get_neighborhood(address: nil, lat: nil, lng: nil)
    params = { key: @api_key }
    params[:address] = address if address
    params[:lat] = lat if lat
    params[:lng] = lng if lng
    request('/neighborhood', params)
  end
  
  def get_offenders(address: nil, lat: nil, lng: nil, radius: 1)
    params = { key: @api_key, radius: radius }
    params[:address] = address if address
    params[:lat] = lat if lat
    params[:lng] = lng if lng
    request('/offenders', params)
  end
  
  private
  
  def request(endpoint, params)
    response = HTTParty.get("#{BASE_URL}#{endpoint}", query: params)
    raise "API Error: #{response.code}" unless response.success?
    response.parsed_response
  end
end

# Example usage
api = DoorProfitAPI.new('YOUR_API_KEY')
address = '500 Main St, Dallas, TX 75202'

# Get crime data
crime_data = api.get_crime(address: address)
puts "Crime Score: #{crime_data['crime_score']}"

# Get neighborhood demographics (separate endpoint)
hood_data = api.get_neighborhood(address: address)
puts "Median Income: $#{hood_data['neighborhood']['income']['median']}"
puts "Population: #{hood_data['neighborhood']['demographics']['population']}"

# Get registered offenders
offender_data = api.get_offenders(address: address, radius: 2)
puts "\nOffenders within 2 miles: #{offender_data['offenders_count']}"
offender_data['offenders'].each do |o|
  puts "  #{o['name']} - #{o['distance']} mi away"
end

Go

Go
// DoorProfit API - Go Example
package main

import (
    "encoding/json"
    "fmt"
    "io"
    "net/http"
    "net/url"
)

const (
    BaseURL = "https://api.doorprofit.com/v1"
    APIKey  = "YOUR_API_KEY"
)

type CrimeResponse struct {
    Success      bool    `json:"success"`
    CrimeScore   string  `json:"crime_score"`
    CrimeNumeric float64 `json:"crime_numeric"`
}

type NeighborhoodResponse struct {
    Success      bool         `json:"success"`
    Neighborhood Neighborhood `json:"neighborhood"`
}

type Neighborhood struct {
    Name         string              `json:"name"`
    Type         string              `json:"type"`
    Demographics NeighborhoodDemographics `json:"demographics"`
    Income       NeighborhoodIncome  `json:"income"`
    Rent         *NeighborhoodRent   `json:"rent"`
}

type NeighborhoodDemographics struct {
    Population int     `json:"population"`
    MedianAge  float64 `json:"median_age"`
}

type NeighborhoodIncome struct {
    Median  int `json:"median"`
    Average int `json:"average"`
}

type NeighborhoodRent struct {
    Median  int `json:"median"`
    Average int `json:"average"`
}

type OffendersResponse struct {
    Success        bool       `json:"success"`
    Offenders      []Offender `json:"offenders"`
    OffendersCount int        `json:"offenders_count"`
    Radius         float64    `json:"radius"`
}

type Offender struct {
    Name     string  `json:"name"`
    Distance float64 `json:"distance"`
}

func getCrime(address string) (*CrimeResponse, error) {
    params := url.Values{}
    params.Add("address", address)
    params.Add("key", APIKey)
    
    resp, err := http.Get(BaseURL + "/crime?" + params.Encode())
    if err != nil {
        return nil, err
    }
    defer resp.Body.Close()
    
    body, _ := io.ReadAll(resp.Body)
    var result CrimeResponse
    json.Unmarshal(body, &result)
    return &result, nil
}

func getNeighborhood(address string) (*NeighborhoodResponse, error) {
    params := url.Values{}
    params.Add("address", address)
    params.Add("key", APIKey)
    
    resp, err := http.Get(BaseURL + "/neighborhood?" + params.Encode())
    if err != nil {
        return nil, err
    }
    defer resp.Body.Close()
    
    body, _ := io.ReadAll(resp.Body)
    var result NeighborhoodResponse
    json.Unmarshal(body, &result)
    return &result, nil
}

func getOffenders(address string, radius float64) (*OffendersResponse, error) {
    params := url.Values{}
    params.Add("address", address)
    params.Add("radius", fmt.Sprintf("%.1f", radius))
    params.Add("key", APIKey)
    
    resp, err := http.Get(BaseURL + "/offenders?" + params.Encode())
    if err != nil {
        return nil, err
    }
    defer resp.Body.Close()
    
    body, _ := io.ReadAll(resp.Body)
    var result OffendersResponse
    json.Unmarshal(body, &result)
    return &result, nil
}

func main() {
    address := "500 Main St, Dallas, TX 75202"
    
    // Get crime data
    crime, _ := getCrime(address)
    fmt.Printf("Crime Score: %s\n", crime.CrimeScore)
    
    // Get neighborhood demographics
    hood, _ := getNeighborhood(address)
    fmt.Printf("Neighborhood: %s\n", hood.Neighborhood.Name)
    fmt.Printf("Median Income: $%d\n", hood.Neighborhood.Income.Median)
    fmt.Printf("Population: %d\n", hood.Neighborhood.Demographics.Population)
    if hood.Neighborhood.Rent != nil {
        fmt.Printf("Median Rent: $%d\n", hood.Neighborhood.Rent.Median)
    }
    
    // Get offenders
    offenders, _ := getOffenders(address, 2)
    fmt.Printf("\nOffenders within 2 miles: %d\n", offenders.OffendersCount)
    for _, o := range offenders.Offenders {
        fmt.Printf("  %s - %.1f mi away\n", o.Name, o.Distance)
    }
}

C# / .NET

C#
// DoorProfit API - C# Example
using System.Net.Http;
using System.Text.Json;
using System.Web;

public class DoorProfitAPI
{
    private readonly HttpClient _client = new();
    private readonly string _apiKey;
    private const string BaseUrl = "https://api.doorprofit.com/v1";

    public DoorProfitAPI(string apiKey) => _apiKey = apiKey;

    public async Task<CrimeResponse> GetCrimeAsync(string address)
    {
        var url = $"{BaseUrl}/crime?address={HttpUtility.UrlEncode(address)}&key={_apiKey}";
        var json = await _client.GetStringAsync(url);
        return JsonSerializer.Deserialize<CrimeResponse>(json);
    }

    public async Task<NeighborhoodResponse> GetNeighborhoodAsync(string address)
    {
        var url = $"{BaseUrl}/neighborhood?address={HttpUtility.UrlEncode(address)}&key={_apiKey}";
        var json = await _client.GetStringAsync(url);
        return JsonSerializer.Deserialize<NeighborhoodResponse>(json);
    }

    public async Task<OffendersResponse> GetOffendersAsync(string address, double radius = 1)
    {
        var url = $"{BaseUrl}/offenders?address={HttpUtility.UrlEncode(address)}&radius={radius}&key={_apiKey}";
        var json = await _client.GetStringAsync(url);
        return JsonSerializer.Deserialize<OffendersResponse>(json);
    }
}

// Usage
var api = new DoorProfitAPI("YOUR_API_KEY");
var address = "500 Main St, Dallas, TX 75202";

// Get crime data
var crime = await api.GetCrimeAsync(address);
Console.WriteLine($"Crime Score: {crime.CrimeScore}");

// Get neighborhood demographics
var hood = await api.GetNeighborhoodAsync(address);
Console.WriteLine($"Neighborhood: {hood.Neighborhood.Name}");
Console.WriteLine($"Median Income: ${hood.Neighborhood.Income.Median:N0}");
Console.WriteLine($"Population: {hood.Neighborhood.Demographics.Population:N0}");

// Get offenders
var offenders = await api.GetOffendersAsync(address, 2);
Console.WriteLine($"\nOffenders within 2 miles: {offenders.OffendersCount}");
foreach (var o in offenders.Offenders)
{
    Console.WriteLine($"  {o.Name} - {o.Distance} mi away");
}

Error Handling

The API uses standard HTTP status codes and returns detailed error messages in JSON format.

HTTP Status Codes

Code Description
200 Success - Request completed successfully
400 Bad Request - Missing or invalid parameters
401 Unauthorized - Invalid or missing API key
403 Forbidden - API key doesn't have access to this resource
404 Not Found - Address could not be geocoded
429 Too Many Requests - Rate limit exceeded
500 Server Error - Something went wrong on our end

Error Response Format

{
  "success": false,
  "error": {
    "code": "INVALID_API_KEY",
    "message": "The API key provided is invalid or has been revoked.",
    "documentation_url": "https://api.doorprofit.com/docs/#authentication"
  }
}

Common Error Codes

  • INVALID_API_KEY - API key is missing, invalid, or revoked
  • MISSING_PARAMETER - Required parameter is missing
  • INVALID_ADDRESS - Address could not be parsed or geocoded
  • INVALID_COORDINATES - Lat/lng values are out of range
  • RATE_LIMIT_EXCEEDED - Too many requests, slow down
  • QUOTA_EXCEEDED - Monthly API call limit reached

Rate Limits

To ensure fair usage and maintain service quality, the API enforces rate limits based on your subscription plan.

Plan Monthly Calls Daily Limit Rate Limit
Free 10 calls/month 50/day 2 req/sec
Starter ($25/mo) 300 calls/month 1,500/day 5 req/sec
Growth ($50/mo) 600 calls/month 3,000/day 10 req/sec
Pro ($100/mo) 1,200 calls/month 6,000/day 20 req/sec
Enterprise Custom Custom Custom

Checking Your Usage

Use the /v1/usage endpoint to check your current usage without consuming quota:

curl "https://api.doorprofit.com/v1/usage?key=YOUR_API_KEY"

Response Headers

Every API response includes headers to help you track usage:

  • X-Monthly-Limit - Your monthly API call limit
  • X-Monthly-Remaining - API calls remaining this month
  • X-Daily-Limit - Your daily API call limit
  • X-Daily-Remaining - API calls remaining today
  • X-RateLimit-Limit - Requests allowed per second
  • X-Plan - Your current subscription plan
💡

Pro tip: Cache API responses when possible to reduce calls and improve your app's performance.

Support

Need help? We're here for you.

Contact Us

Common Questions

Q: How often is the data updated?
Crime data is updated daily. Registered offender data is refreshed weekly. Demographic data follows US Census updates.

Q: What areas are covered?
We cover all 50 US states with data for most metropolitan and suburban areas.

Q: Can I use the API for commercial purposes?
Yes! All paid plans include commercial usage rights.

Q: What happens if I exceed my monthly limit?
API calls beyond your limit will return a 429 error. You can upgrade your plan anytime to get more calls.

🚀

Ready to get started? Sign up for free and make your first API call in minutes!