Plugin will load data from https://data.police.uk and return to Twig templates as array
Function in twig will look something like...
{% set response = getPoliceAndCrimeData('forces') %}
{% if (not response.error is defined) %}
{% set forces = response.body %}
{% for force in forces %}
...
{% endfor %}
{% endif %}
A function with params would look something like...
{% set response = getPoliceAndCrimeData('streetcrimepoint', {category: 'all-crime', lat: 51.507375, lng: -0.127537, month: '2017-01' }) %}
{% if (not response.error is defined) %}
{% set crimes = response.body %}
{% for crime in crimes %}
...
{% endfor %}
{% endif %}
Plugin caches data for a period of 1 hour.
To get a reference to the services class powering the twig extension elsewhere (in your own class for example) you'd need to add a use reference and then call the getPoliceAndCrimeData method on ukcrimestatsservice as below...
use signalfire\craftukcrimestats\CraftUKCrimeStats;
CraftUKCrimeStats::getInstance()
->ukcrimestatsservice
->getPoliceAndCrimeData($name, $params, $method);