# Crimedata with address
This service returns the variables with crime level information from a requested address (home). Such location may come from online addresses or from information stored in its data repositories.
Required parameters in a Crimedata request:
- address: Specify addresses according to the format used by the national postal service of the country in question. Additional address elements such as business names and unit, suite, or floor numbers should be avoided. Postal address elements must be delimited by spaces (shown here as a %20-escaped URL).
- key: the API key of your application. This key identifies your application for quota management purposes. Learn how to get API key.
# Example of Crimedata with address
The following base service request would have the following structure:
https://apis.geodir.co/crimedata/v1/json?address=jr pedro ruiz gallo nro 668&key=YOUR_KEY
Note: Be sure to enter a valid address for the address parameter.
{
"status": "OK",
"groups": [
{
"name": "grid_code",
"description": "Codigo de Identificación Única",
"fields": [
{
"name": "grid_code",
"value": 657668,
"typeField": "integer",
"description": "Codigo de Identificación Única"
}
]
},
{
"name": "peso",
"description": "Peso",
"fields": [
{
"name": "weight",
"value": 0,
"typeField": "integer",
"description": "Peso del Nivel de Delito"
}
]
},
{
"name": "riesgo",
"description": "Riesgo",
"fields": [
{
"name": "risk",
"value": "Bajo",
"typeField": "text",
"description": "Nivel de Delito"
}
]
},
{
"name": "asalto",
"description": "Asalto Robo de Vehículos",
"fields": [
{
"name": "vechicle_theft_assasult",
"value": 0,
"typeField": "integer",
"description": "Asalto Robo de Vehículos"
}
]
},
{
"name": "estafa",
"description": "Estafa",
"fields": [
{
"name": "fraud",
"value": 0,
"typeField": "integer",
"description": "Estafa"
}
]
},
{
"name": "extorsión",
"description": "Extorsión",
"fields": [
{
"name": "extortion",
"value": 0,
"typeField": "integer",
"description": "Extorsión"
}
]
},
{
"name": "homicidio",
"description": "Homicidio",
"fields": [
{
"name": "qualified_homicide",
"value": 0,
"typeField": "integer",
"description": "Homicidio Calificado"
},
{
"name": "firearms_homicide",
"value": 0,
"typeField": "integer",
"description": "Homicidio por Armas de Fuego"
}
]
},
{
"name": "hurto",
"description": "Hurto",
"fields": [
{
"name": "robbery",
"value": 0,
"typeField": "integer",
"description": "Hurto"
},
{
"name": "aggravated_robbery",
"value": 0,
"typeField": "integer",
"description": "Hurto Agravado"
},
{
"name": "aggravated_robbery_inhabited_house",
"value": 0,
"typeField": "integer",
"description": "Hurto Agravado Casa Habitada"
},
{
"name": "vehicle_robbery",
"value": 0,
"typeField": "integer",
"description": "Hurto Vehículo"
},
{
"name": "attempted_robbery",
"value": 0,
"typeField": "integer",
"description": "Hurto Frustrado"
}
]
},
{
"name": "microcomercialización de droga",
"description": "Microcomercialización de Droga",
"fields": [
{
"name": "drug_microcommercialization",
"value": 0,
"typeField": "integer",
"description": "Microcomercialización de Droga"
}
]
},
{
"name": "robo",
"description": "Robo",
"fields": [
{
"name": "theft",
"value": 0,
"typeField": "integer",
"description": "Robo"
},
{
"name": "aggravated_theft",
"value": 0,
"typeField": "integer",
"description": "Robo Agravado"
},
{
"name": "aggravated_armed_theft",
"value": 0,
"typeField": "integer",
"description": "Robo Agravado Mano Armada"
},
{
"name": "aggravated_theft_night",
"value": 0,
"typeField": "integer",
"description": "Robo Agravado por la Noche"
},
{
"name": "attempted_theft",
"value": 0,
"typeField": "integer",
"description": "Robo Frustrado"
}
]
},
{
"name": "secuestro",
"description": "Secuestro",
"fields": [
{
"name": "kidnapping",
"value": 0,
"typeField": "integer",
"description": "Secuestro"
}
]
},
{
"name": "tenencia informal de armas",
"description": "Tenencia Informal de Armas",
"fields": [
{
"name": "informal_possession_weapons",
"value": 0,
"typeField": "integer",
"description": "Tenencia Informal de Armas"
}
]
},
{
"name": "violencia sexual de menores",
"description": "Violencia Sexual de Menores",
"fields": [
{
"name": "child_sexual_violence",
"value": 0,
"typeField": "integer",
"description": "Violencia Sexual de Menores"
}
]
},
{
"name": "establecimientos penitenciarios",
"description": "Establecimientos Penitenciarios",
"fields": [
{
"name": "penitentiary_establishments",
"value": 0,
"typeField": "integer",
"description": "Establecimientos Penitenciarios"
}
]
},
{
"name": "lugar de residencia",
"description": "Lugar de Residencia",
"fields": [
{
"name": "place_residence",
"value": 0,
"typeField": "integer",
"description": "Lugar de Residencia"
}
]
},
{
"name": "geom",
"description": "Geometria",
"fields": [
{
"name": "geom",
"value": null,
"typeField": "geometry",
"description": "Geometria"
}
]
},
{
"name": "Localización",
"description": "Localización",
"fields": [
{
"name": "admin_level_3_code",
"value": "150105",
"typeField": "text",
"description": "Código de ubigeo"
}
]
}
]
}
# Crimedata responses with address
Below are the possible status codes in a response from Crimedata.
# Crimedata State Codes with address
The "status" field within the crimedata response object contains the status of the request and may contain debugging information to help you figure out why geocoding isn't working. The "status" field can contain the following values:
-- "OK" indicates that the crimedata service produced no errors; the service performed the action correctly.
- "ZERO_RESULTS" indicates that the crimedata service succeeded but returned no results. This can happen if the service passed a non-existent latlon or was out of zone.
- "OVER_QUERY_LIMIT" indicates that you have exceeded your quota.
- "REQUEST_DENIED" indicates that your request was denied.
- "INVALID_REQUEST" generally indicates one of the following:
- Missing query (address, groups or latlon).
- An invalid groups was provided.
- "UNKNOWN_ERROR" indicates that the request could not be processed due to a server error. The request may be successful if you try again.
# Optional Parameters
Optional parameters:
- Groups: is a filter with elements separated by a pipe (|). The group filter is also accepted as an optional parameter if an address is provided. Each element consists of a segment pair which is a value and fully constrains the results of the crimedata. See more information about group filtering.
- info: is a series of values useful to the client to store complementary information or metadata, these elements must be separated by a pipe (|).
# Group Filtering
In a Crimedata response, the Crimedata API can return results restricted to a specific area. You can specify the restriction using the groups filter. A filter consists of a list of sgroup:value pairs separated by a pipe (|). Filter values support the same partial matching and spell checking methods as other Crimedata requests.
The following groups can be used to influence the results, but will not be applied:
- locality matches locality and sublocality types.
Notes on group filtering:
- Results are consistent with Geodir Maps, which occasionally produces ZERO_RESULTS responses.
- For each address segment, specify it in the group parameter.
A geographic code for "jr pedro ruiz gallo nro 668" con groups=locality_id:150105
https://apis.geodir.co/crimedata/v1/json?address=jr pedro ruiz gallo nro 668&groups=locality_id:150105&info=cod_peticion:1020|canal:abc|origen_sistema:cde