# Crimedata LatLon

This service returns the variables with information on the crime level of the requested latitude, longitude location. Said location can come from a GPS type device of a cell phone, Laptop, PC, etc. Or information stored in their data repositories.

Required parameters in a Crimedata request:

  • latlon: the latitude and longitude values ​​that specify the location for which you want to get the Crimedata information.
  • key: the API key of your application. This key identifies your application for quota management purposes. Learn how to get API key.

# Crimedata LatLon Example

The following base service request would have the following structure:

https://apis.geodir.co/crimedata/v1/json?latlon=-12.059888,-77.049072&key=YOUR_KEY

Note: Make sure that there is no space between the latitude and longitude values ​​when passed in the latlon 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"
                }
            ]
        }
    ]
}


# Responses from Crimedata LatLon

Below are the possible status codes in a response from Crimedata.

# Crimedata LatLon Status Codes

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. Each element consists of a group pair which is a value and fully constrains the results of crimedata. See more 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. <!-- Los segments que se pueden filtrar incluyen:

  • postal_code coincide con postal_code y postal_code_prefix.
  • country coincide con el nombre de un país o con un código de país de dos letras ISO 3166-1 (opens new window). La API sigue el estándar ISO para definir países y el filtrado funciona mejor cuando se usa el código ISO correspondiente del país. -->

The following groups can be used to influence the results, but will not be applied:

  • locality coincide con tipos locality y sublocality.

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.
https://apis.geodir.co/crimedata/v1/json?latlon=-12.059888,-77.049072&group=locality_id:150105&info=cod_peticion:1020|canal:abc|origen_sistema:cde
Last updated: 09/18/2023, 10:30:49 PM