### Quick Start: cURL Examples Source: https://api.doorprofit.com/docs Make your first API calls using cURL to get crime statistics, neighborhood demographics, or offender information. ```bash # Get crime statistics & safety scores curl "https://api.doorprofit.com/v1/crime?address=500+Main+St+Dallas+TX+75202&key=YOUR_API_KEY" ``` ```bash # Get neighborhood demographics curl "https://api.doorprofit.com/v1/neighborhood?address=500+Main+St+Dallas+TX+75202&key=YOUR_API_KEY" ``` ```bash # Get registered offenders in the area curl "https://api.doorprofit.com/v1/offenders?address=500+Main+St+Dallas+TX+75202&key=YOUR_API_KEY" ``` -------------------------------- ### API Key Authentication Example Source: https://api.doorprofit.com/docs Example of how to include your API key as a query parameter in a request. ```text https://api.doorprofit.com/v1/crime?address=500+Main+St+Dallas+TX+75202&key=YOUR_API_KEY ``` -------------------------------- ### Search Offenders by Address (Python) Source: https://api.doorprofit.com/docs This Python requests example shows how to search for offenders by address. It prints the total count of offenders found. ```python 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 Offenders by Name (PHP) Source: https://api.doorprofit.com/docs This PHP example shows how to search for offenders by last name and state. The results are decoded from JSON. ```php // 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 Offenders by Address (PHP) Source: https://api.doorprofit.com/docs This PHP example demonstrates searching for offenders by address using file_get_contents and json_decode. It outputs the number of offenders found. ```php 'John', 'city' => 'Dallas', 'state' => 'TX', 'key' => $apiKey ]); $url = "https://api.doorprofit.com/v1/offenders?{$params}"; ``` -------------------------------- ### Search Offenders by Name (JavaScript) Source: https://api.doorprofit.com/docs Use this JavaScript fetch example to search for offenders by last name and state. The results contain matching offender data. ```javascript // 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 Offenders by Name (Python) Source: https://api.doorprofit.com/docs This Python requests example demonstrates searching for offenders using their last name and state. The API returns matching offender records. ```python # Search by name response = requests.get( 'https://api.doorprofit.com/v1/offenders', params={ 'last_name': 'Smith', 'state': 'TX', 'key': 'YOUR_API_KEY' } ) ``` -------------------------------- ### Search Offenders with Multiple Criteria (Python) Source: https://api.doorprofit.com/docs This Python requests example shows how to search for offenders using multiple criteria such as first name, city, and state. It utilizes the params argument for the request. ```python # 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' } ) ``` -------------------------------- ### Ruby DoorProfit API Client Source: https://api.doorprofit.com/docs A Ruby class to interact with the DoorProfit API using the 'httparty' gem. It provides methods for fetching crime, neighborhood, and offender data. Ensure you have installed the gem: `gem install httparty`. ```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']}" ``` -------------------------------- ### Example Offender Response Source: https://api.doorprofit.com/docs This JSON object represents a typical response when querying for offender data, including details about individuals and their offenses. ```json { "success": true, "offenders": [ { "name": "John Doe", "first_name": "John", "last_name": "Doe", "aliases": [], "address": "512 S Houston St, Dallas, TX", "city": "Dallas", "state": "TX", "zipcode": "75202", "lat": 32.778000, "lng": -96.807000, "distance": 0.3, "photo": "https://cdn.doorprofit.com/registered-offenders/tx_12345_a1b2c3d4.webp", "dob": "1985-03-15", "age": 41, "gender": "Male", "risk_level": "Level 2", "offense": "Sexual Assault", "offense_date": "2019-06-15", "offenses": [ { "description": "Sexual Assault", "conviction_date": "2019-06-15", "victim_gender": "Female", "victim_age": "22" } ], "source_url": "https://sor.dps.texas.gov/..." }, { "name": "Jane Smith", "first_name": "Jane", "last_name": "Smith", "aliases": [], "address": "789 Commerce St, Dallas, TX", "city": "Dallas", "state": "TX", "zipcode": "75202", "lat": 32.779500, "lng": -96.805500, "distance": 0.8, "photo": null, "dob": null, "age": 35, "gender": "Female", "risk_level": null, "offense": null, "offense_date": null, "offenses": [], "source_url": "https://..." } ], "offenders_count": 2, "total_count": 2, "page": 1, "total_pages": 1, "radius": 1 } ``` -------------------------------- ### Search Offenders with Multiple Criteria (JavaScript) Source: https://api.doorprofit.com/docs This JavaScript example demonstrates searching for offenders using multiple parameters like first name, city, and state. It constructs a URLSearchParams object for the query. ```javascript // 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}`); ``` -------------------------------- ### Example Crime Response Source: https://api.doorprofit.com/docs This JSON object represents a typical response from a crime data endpoint, detailing crime scores, descriptions, and incident breakdowns. ```json { "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 } ] } } ``` -------------------------------- ### Get Neighborhood Information Source: https://api.doorprofit.com/docs Retrieves demographic and neighborhood information for a specified address. This includes population, median income, and neighborhood name. ```APIDOC ## GET /v1/neighborhood ### Description Retrieves demographic and neighborhood information for a specified address. This includes population, median income, and neighborhood name. ### Method GET ### Endpoint /v1/neighborhood ### Parameters #### Query Parameters - **address** (string) - Required - The address to get neighborhood information for. - **key** (string) - Required - Your DoorProfit API key. ### Request Example ``` https://api.doorprofit.com/v1/neighborhood?address=500%20Main%20St%2C%20Dallas%2C%20TX%2075202&key=YOUR_API_KEY ``` ### Response #### Success Response (200) - **neighborhood** (object) - Information about the neighborhood. - **name** (string) - The name of the neighborhood. - **income** (object) - Income statistics. - **median** (number) - The median income in the neighborhood. - **demographics** (object) - Demographic statistics. - **population** (number) - The population of the neighborhood. #### Response Example ```json { "neighborhood": { "name": "Downtown Dallas", "income": { "median": 65000 }, "demographics": { "population": 150000 } } } ``` ``` -------------------------------- ### Get API Usage Statistics (curl) Source: https://api.doorprofit.com/docs Use this curl command to retrieve your API usage statistics, including plan details, monthly and daily limits, and rate limits. This endpoint is free and does not count against your quota. ```bash curl "https://api.doorprofit.com/v1/usage?key=YOUR_API_KEY" ``` -------------------------------- ### Example Location Response Source: https://api.doorprofit.com/docs This JSON object represents a successful response containing detailed information about a specific location, including its address, demographic data, income, housing statistics, education levels, cost of living index, rent details, and weather patterns. ```json { "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 } } } } ``` -------------------------------- ### DoorProfit API Python Client Source: https://api.doorprofit.com/docs This Python class provides methods to interact with the DoorProfit API. It requires an API key for authentication and supports fetching crime, neighborhood, and offender data by address or coordinates. Ensure you have the 'requests' library installed. ```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") ``` -------------------------------- ### Get Neighborhood Data Source: https://api.doorprofit.com/docs Retrieves neighborhood demographics and economic data for a given address or geographic coordinates. This endpoint helps in understanding the characteristics of a neighborhood. ```APIDOC ## GET /neighborhood ### Description Get neighborhood demographics and economic data for a specified address or latitude/longitude. ### Method GET ### Endpoint /neighborhood ### Parameters #### Query Parameters - **key** (string) - Required - Your API key. - **address** (string) - Optional - The address to query. - **lat** (float) - Optional - The latitude to query (use if address is not provided). - **lng** (float) - Optional - The longitude to query (use if address is not provided). ### Request Example ```json { "address": "500 Main St, Dallas, TX 75202" } ``` ### Response #### Success Response (200) - **neighborhood** (object) - Information about the neighborhood, including name, income, demographics, and rent. - **name** (string) - **income** (object) - **median** (float) - **demographics** (object) - **population** (integer) - **rent** (object) - **median** (float or null) ``` -------------------------------- ### Get Registered Offenders (Ruby) Source: https://api.doorprofit.com/docs Retrieves a list of registered offenders within a specified radius of an address and prints their count and details. Requires an API client object. ```ruby 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 ``` -------------------------------- ### GET /v1/neighborhood Source: https://api.doorprofit.com/docs Retrieves 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. ```APIDOC ## GET /v1/neighborhood ### Description 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. ### Method GET ### Endpoint /v1/neighborhood ### Parameters #### Query Parameters - **key** (string) - Required - Your API key - **address** (string) - Required (if lat/lng not provided) - Full street address (URL encoded). Example: `500+Main+St+Dallas+TX+75202` - **lat** (number) - Required (if address not provided) - Latitude. Example: `32.778635` - **lng** (number) - Required (if address not provided) - Longitude. Example: `-96.807295` ### Request Example ```http GET /v1/neighborhood?address=500+Main+St+Dallas+TX+75202&key=YOUR_API_KEY ``` ``` -------------------------------- ### Get Offenders Source: https://api.doorprofit.com/docs Retrieves a list of registered offenders within a specified radius of an address. Includes offender name and distance. ```APIDOC ## GET /v1/offenders ### Description Retrieves a list of registered offenders within a specified radius of an address. Includes offender name and distance. ### Method GET ### Endpoint /v1/offenders ### Parameters #### Query Parameters - **address** (string) - Required - The address to search around. - **radius** (number) - Optional - The radius in miles to search for offenders (default: 1). - **key** (string) - Required - Your DoorProfit API key. ### Request Example ``` https://api.doorprofit.com/v1/offenders?address=500%20Main%20St%2C%20Dallas%2C%20TX%2075202&radius=2&key=YOUR_API_KEY ``` ### Response #### Success Response (200) - **offendersCount** (number) - The total number of offenders found. - **offenders** (array) - A list of offenders. - **name** (string) - The name of the offender. - **distance** (number) - The distance of the offender from the specified address in miles. #### Response Example ```json { "offendersCount": 3, "offenders": [ { "name": "John Doe", "distance": 1.5 }, { "name": "Jane Smith", "distance": 1.8 } ] } ``` ``` -------------------------------- ### Get Crime Data Source: https://api.doorprofit.com/docs Retrieves crime data for a specified address. This includes a crime score based on historical data. ```APIDOC ## GET /v1/crime ### Description Retrieves crime data for a specified address. This includes a crime score based on historical data. ### Method GET ### Endpoint /v1/crime ### Parameters #### Query Parameters - **address** (string) - Required - The address to get crime data for. - **key** (string) - Required - Your DoorProfit API key. ### Request Example ``` https://api.doorprofit.com/v1/crime?address=500%20Main%20St%2C%20Dallas%2C%20TX%2075202&key=YOUR_API_KEY ``` ### Response #### Success Response (200) - **crimeScore** (number) - The calculated crime score for the address. #### Response Example ```json { "crimeScore": 75 } ``` ``` -------------------------------- ### Get Crime Statistics Source: https://api.doorprofit.com/docs Retrieves crime statistics and safety scores for a given address or geographic coordinates. This endpoint is useful for assessing the safety of a location. ```APIDOC ## GET /crime ### Description Get crime statistics and safety scores for a specified address or latitude/longitude. ### Method GET ### Endpoint /crime ### Parameters #### Query Parameters - **key** (string) - Required - Your API key. - **address** (string) - Optional - The address to query. - **lat** (float) - Optional - The latitude to query (use if address is not provided). - **lng** (float) - Optional - The longitude to query (use if address is not provided). ### Request Example ```json { "address": "500 Main St, Dallas, TX 75202" } ``` ### Response #### Success Response (200) - **crime_score** (float) - The crime score for the location. - **details** (object) - Detailed crime statistics. ``` -------------------------------- ### DoorProfit API Client (Go) Source: https://api.doorprofit.com/docs A comprehensive Go client for the DoorProfit API, including functions to fetch crime data, neighborhood demographics, and offender information. Requires API key and base URL configuration. ```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) } } ``` -------------------------------- ### DoorProfit API Client in C# Source: https://api.doorprofit.com/docs A C# class to interact with the DoorProfit API for retrieving crime, neighborhood, and offender data. Requires an API key for authentication. Demonstrates usage for fetching crime scores, neighborhood demographics, and nearby offenders. ```csharp // 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 GetCrimeAsync(string address) { var url = $"{BaseUrl}/crime?address={HttpUtility.UrlEncode(address)}&key={_apiKey}"; var json = await _client.GetStringAsync(url); return JsonSerializer.Deserialize(json); } public async Task GetNeighborhoodAsync(string address) { var url = $"{BaseUrl}/neighborhood?address={HttpUtility.UrlEncode(address)}&key={_apiKey}"; var json = await _client.GetStringAsync(url); return JsonSerializer.Deserialize(json); } public async Task 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(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"); } ``` -------------------------------- ### Query Neighborhood by Address (PHP) Source: https://api.doorprofit.com/docs Use PHP's file_get_contents to fetch neighborhood data by address. The address must be URL-encoded. ```php ``` -------------------------------- ### GET /v1/offenders Source: https://api.doorprofit.com/docs Retrieves information on registered offenders, including photos, addresses, and distances from a specified location. The location can be provided as a street address or latitude/longitude coordinates. ```APIDOC ## GET /v1/offenders ### Description Get registered offenders with photos, addresses, and distances. Accepts either a street address or coordinates. ### Method GET ### Endpoint /v1/offenders ### Parameters #### Query Parameters - **key** (string) - Required - Your API key - **address** (string) - Required (if lat/lng not provided) - Full street address (URL encoded). Example: `500+Main+St+Dallas+TX+75202` - **lat** (number) - Required (if address not provided) - Latitude. Example: `32.778635` - **lng** (number) - Required (if address not provided) - Longitude. Example: `-96.807295` ### Request Example ```http GET /v1/offenders?address=500+Main+St+Dallas+TX+75202&key=YOUR_API_KEY ``` ``` -------------------------------- ### Get Registered Offenders Source: https://api.doorprofit.com/docs Retrieves a list of registered offenders within a specified radius of a given address or geographic coordinates. This endpoint is useful for safety assessments. ```APIDOC ## GET /offenders ### Description Get registered offenders near a specified location within a given radius. ### Method GET ### Endpoint /offenders ### Parameters #### Query Parameters - **key** (string) - Required - Your API key. - **address** (string) - Optional - The address to query. - **lat** (float) - Optional - The latitude to query (use if address is not provided). - **lng** (float) - Optional - The longitude to query (use if address is not provided). - **radius** (float) - Optional - The radius in miles to search for offenders (defaults to 1). ### Request Example ```json { "address": "500 Main St, Dallas, TX 75202", "radius": 2 } ``` ### Response #### Success Response (200) - **offenders_count** (integer) - The total number of registered offenders found. - **offenders** (array) - A list of registered offenders. - **name** (string) - The name of the offender. - **distance** (float) - The distance of the offender from the queried location in miles. ``` -------------------------------- ### Crime Endpoint: Query by Address (Python) Source: https://api.doorprofit.com/docs Use the requests library to query the crime endpoint by address and print crime statistics. ```python 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 ``` -------------------------------- ### Crime Endpoint: Query by Address (PHP) Source: https://api.doorprofit.com/docs Use file_get_contents to query the crime endpoint by address and decode the JSON response. ```php