Radius Risk Analysis
curl --request GET \
--url https://api.vects.ai/risk-assessment/radius/import requests
url = "https://api.vects.ai/risk-assessment/radius/"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.vects.ai/risk-assessment/radius/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.vects.ai/risk-assessment/radius/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.vects.ai/risk-assessment/radius/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.vects.ai/risk-assessment/radius/")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vects.ai/risk-assessment/radius/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"200": {},
"400": {},
"401": {},
"429": {},
"500": {},
"riskPoints": [
{
"riskPoints[].lat": 123,
"riskPoints[].lng": 123,
"riskPoints[].weight": 123,
"riskPoints[].riskLevel": "<string>",
"riskPoints[].distance": 123,
"riskPoints[].threats": [
{}
]
}
],
"center": {
"center.latitude": 123,
"center.longitude": 123,
"center.radius_km": 123
},
"summary": {
"summary.overallRisk": "<string>",
"summary.maxRiskWeight": 123,
"summary.averageRisk": 123,
"summary.area_km2": 123,
"summary.highRiskZones": 123,
"summary.safeZones": 123
},
"threats": [
{
"threats[].id": "<string>",
"threats[].type": "<string>",
"threats[].severity": "<string>",
"threats[].description": "<string>",
"threats[].location": {},
"threats[].affected_radius": 123,
"threats[].confidence": 123
}
],
"zones": [
{
"zones[].id": "<string>",
"zones[].type": "<string>",
"zones[].boundary": [
{}
],
"zones[].riskLevel": "<string>",
"zones[].primaryThreats": [
{}
]
}
]
}Risk Assessment
Radius Risk Analysis
Assess risks within a specified radius around a geographic point
GET
/
risk-assessment
/
radius
/
Radius Risk Analysis
curl --request GET \
--url https://api.vects.ai/risk-assessment/radius/import requests
url = "https://api.vects.ai/risk-assessment/radius/"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.vects.ai/risk-assessment/radius/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.vects.ai/risk-assessment/radius/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.vects.ai/risk-assessment/radius/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.vects.ai/risk-assessment/radius/")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vects.ai/risk-assessment/radius/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"200": {},
"400": {},
"401": {},
"429": {},
"500": {},
"riskPoints": [
{
"riskPoints[].lat": 123,
"riskPoints[].lng": 123,
"riskPoints[].weight": 123,
"riskPoints[].riskLevel": "<string>",
"riskPoints[].distance": 123,
"riskPoints[].threats": [
{}
]
}
],
"center": {
"center.latitude": 123,
"center.longitude": 123,
"center.radius_km": 123
},
"summary": {
"summary.overallRisk": "<string>",
"summary.maxRiskWeight": 123,
"summary.averageRisk": 123,
"summary.area_km2": 123,
"summary.highRiskZones": 123,
"summary.safeZones": 123
},
"threats": [
{
"threats[].id": "<string>",
"threats[].type": "<string>",
"threats[].severity": "<string>",
"threats[].description": "<string>",
"threats[].location": {},
"threats[].affected_radius": 123,
"threats[].confidence": 123
}
],
"zones": [
{
"zones[].id": "<string>",
"zones[].type": "<string>",
"zones[].boundary": [
{}
],
"zones[].riskLevel": "<string>",
"zones[].primaryThreats": [
{}
]
}
]
}Overview
The Radius Risk Analysis API evaluates potential threats and hazards within a circular area around a specified geographic point. This endpoint is ideal for assessing risks in a specific location, planning safe zones, or analyzing area-wide security concerns.Authentication
curl -X GET "https://api.vects.ai/risk-assessment/radius/?latitude=37.7749&longitude=-122.4194&radius_km=5" \
-H "Authorization: Api-Key YOUR_API_KEY"
curl -X GET "https://api.vects.ai/risk-assessment/radius/?latitude=37.7749&longitude=-122.4194&radius_km=5" \
-H "Authorization: Token YOUR_AUTH_TOKEN"
curl -X GET "https://api.vects.ai/risk-assessment/radius/?latitude=37.7749&longitude=-122.4194&radius_km=5"
This endpoint supports anonymous access for basic risk assessments, though authenticated requests receive more detailed analysis and higher point limits.
Query Parameters
number
required
Center latitude coordinate (-90 to 90)
number
required
Center longitude coordinate (-180 to 180)
number
required
Radius in kilometers (0.1 to 100)
integer
default:"100"
Number of analysis points to generate within the radius (10 to 1000)
- Anonymous users: max 100 points
- Authenticated users: max 1000 points
string
Comma-separated list of risk types to analyze. If not provided, all types are assessed.Available types:
geopolitical, environmental, infrastructure, crime, traffic, weatherstring
default:"medium"
Analysis resolution:
low, medium, highstring
ISO 8601 timestamp for time-specific analysis. Defaults to current time.
Example Requests
curl -X GET "https://api.vects.ai/risk-assessment/radius/?latitude=37.7749&longitude=-122.4194&radius_km=2" \
-H "Authorization: Api-Key YOUR_API_KEY"
curl -X GET "https://api.vects.ai/risk-assessment/radius/?latitude=37.7749&longitude=-122.4194&radius_km=5&num_points=500&resolution=high" \
-H "Authorization: Api-Key YOUR_API_KEY"
curl -X GET "https://api.vects.ai/risk-assessment/radius/?latitude=37.7749&longitude=-122.4194&radius_km=3&risk_types=crime,traffic&num_points=200" \
-H "Authorization: Api-Key YOUR_API_KEY"
curl -X GET "https://api.vects.ai/risk-assessment/radius/?latitude=37.7749&longitude=-122.4194&radius_km=1&time=2024-01-15T22:00:00Z" \
-H "Authorization: Api-Key YOUR_API_KEY"
Response
array
Array of risk assessment points within the specified radius
Show riskPoints structure
Show riskPoints structure
number
Latitude coordinate of the risk point
number
Longitude coordinate of the risk point
number
Risk weight/score (0.0 to 1.0, where 1.0 is highest risk)
string
Categorical risk level:
low, medium, high, criticalnumber
Distance from center point in kilometers
array
Array of specific threats identified at this location
object
object
Area risk summary statistics
Show summary properties
Show summary properties
array
Detailed threat information for the area
Show threats structure
Show threats structure
array
Example Response
{
"riskPoints": [
{
"lat": 37.7749,
"lng": -122.4194,
"weight": 0.3,
"riskLevel": "medium",
"distance": 0.0,
"threats": ["moderate_traffic", "minor_crime_activity"]
},
{
"lat": 37.7759,
"lng": -122.4184,
"weight": 0.8,
"riskLevel": "high",
"distance": 1.2,
"threats": ["active_construction", "high_crime_area"]
},
{
"lat": 37.7739,
"lng": -122.4204,
"weight": 0.1,
"riskLevel": "low",
"distance": 1.1,
"threats": []
}
],
"center": {
"latitude": 37.7749,
"longitude": -122.4194,
"radius_km": 2.0
},
"summary": {
"overallRisk": "medium",
"maxRiskWeight": 0.8,
"averageRisk": 0.4,
"area_km2": 12.57,
"highRiskZones": 2,
"safeZones": 5
},
"threats": [
{
"id": "threat_001",
"type": "infrastructure",
"severity": "high",
"description": "Major construction project causing significant disruption",
"location": {
"lat": 37.7759,
"lng": -122.4184
},
"affected_radius": 0.5,
"confidence": 0.92
},
{
"id": "threat_002",
"type": "crime",
"severity": "medium",
"description": "Elevated crime activity in commercial district",
"location": {
"lat": 37.7755,
"lng": -122.4180
},
"affected_radius": 0.3,
"confidence": 0.78
}
],
"zones": [
{
"id": "zone_001",
"type": "safe",
"boundary": [
[37.7740, -122.4210],
[37.7740, -122.4200],
[37.7750, -122.4200],
[37.7750, -122.4210]
],
"riskLevel": "low",
"primaryThreats": []
},
{
"id": "zone_002",
"type": "danger",
"boundary": [
[37.7755, -122.4190],
[37.7755, -122.4180],
[37.7765, -122.4180],
[37.7765, -122.4190]
],
"riskLevel": "high",
"primaryThreats": ["construction", "crime"]
}
]
}
Use Cases
Emergency Planning
# Assess risks around a hospital for emergency evacuation planning
curl -X GET "https://api.vects.ai/risk-assessment/radius/?latitude=37.7749&longitude=-122.4194&radius_km=3&risk_types=environmental,infrastructure&num_points=300" \
-H "Authorization: Api-Key YOUR_API_KEY"
Event Security
# Analyze security risks around an event venue
curl -X GET "https://api.vects.ai/risk-assessment/radius/?latitude=37.7749&longitude=-122.4194&radius_km=1&risk_types=crime,geopolitical&time=2024-01-15T19:00:00Z" \
-H "Authorization: Api-Key YOUR_API_KEY"
Real Estate Assessment
# Evaluate neighborhood safety for property investment
curl -X GET "https://api.vects.ai/risk-assessment/radius/?latitude=37.7749&longitude=-122.4194&radius_km=0.5&risk_types=crime,environmental&resolution=high" \
-H "Authorization: Api-Key YOUR_API_KEY"
Logistics Planning
# Assess risks around a distribution center
curl -X GET "https://api.vects.ai/risk-assessment/radius/?latitude=37.7749&longitude=-122.4194&radius_km=10&risk_types=traffic,infrastructure,weather" \
-H "Authorization: Api-Key YOUR_API_KEY"
Status Codes
OK
Risk analysis completed successfully
Bad Request
Invalid coordinates, radius, or other parameters
Unauthorized
Invalid or missing API key (for authenticated features)
Too Many Requests
Rate limit exceeded
Internal Server Error
Server error during risk analysis
Error Responses
{
"error": "Invalid radius: radius_km must be between 0.1 and 100",
"code": "INVALID_RADIUS",
"details": {
"field": "radius_km",
"min_value": 0.1,
"max_value": 100,
"provided_value": 150
}
}
{
"error": "Too many points requested for anonymous user",
"code": "POINTS_LIMIT_EXCEEDED",
"details": {
"max_points_anonymous": 100,
"max_points_authenticated": 1000,
"requested_points": 500
}
}
Integration Examples
JavaScript/Web
async function analyzeAreaRisk(lat, lng, radius) {
const params = new URLSearchParams({
latitude: lat,
longitude: lng,
radius_km: radius,
num_points: 200,
resolution: 'high'
});
const response = await fetch(`https://api.vects.ai/risk-assessment/radius/?${params}`, {
headers: {
'Authorization': 'Api-Key YOUR_API_KEY'
}
});
const riskData = await response.json();
// Create heat map visualization
createRiskHeatMap(riskData.riskPoints);
// Highlight high-risk zones
riskData.zones.forEach(zone => {
if (zone.riskLevel === 'high') {
highlightDangerZone(zone.boundary);
}
});
}
Python
import requests
def analyze_area_risk(lat, lng, radius_km, api_key, num_points=100):
url = "https://api.vects.ai/risk-assessment/radius/"
params = {
"latitude": lat,
"longitude": lng,
"radius_km": radius_km,
"num_points": num_points,
"resolution": "high"
}
headers = {
"Authorization": f"Api-Key {api_key}"
}
response = requests.get(url, params=params, headers=headers)
return response.json()
# Example usage
risk_data = analyze_area_risk(37.7749, -122.4194, 2.0, "your_api_key", 300)
# Find high-risk areas
high_risk_points = [
point for point in risk_data['riskPoints']
if point['weight'] > 0.7
]
R
library(httr)
library(jsonlite)
analyze_area_risk <- function(lat, lng, radius_km, api_key) {
url <- "https://api.vects.ai/risk-assessment/radius/"
response <- GET(
url,
query = list(
latitude = lat,
longitude = lng,
radius_km = radius_km,
num_points = 200
),
add_headers(Authorization = paste("Api-Key", api_key))
)
content(response, "parsed")
}
# Example usage
risk_data <- analyze_area_risk(37.7749, -122.4194, 2.0, "your_api_key")
Visualization Tips
Heat Maps
Use theweight values to create color-coded heat maps showing risk intensity across the area.
Zone Boundaries
Render thezones boundaries to clearly delineate safe and dangerous areas.
Threat Markers
Place markers at threat locations with icons representing the threat type and severity.Distance Rings
Show concentric circles at different distances from the center point for spatial reference.Next Steps
- Combine with Route Risk Analysis for comprehensive travel planning
- Integrate with Urban Mobility MARL for dynamic risk modeling
- Use with Simulation APIs for scenario-based risk assessment