# UK Location Risk & Amenity Report (`hllerdgn80/uk-location-risk-report`) Actor

For any UK postcode: live Environment Agency flood warnings, police.uk street crime counts, and FSA food hygiene ratings nearby, combined into one transparent report with a plain-English composite score.

- **URL**: https://apify.com/hllerdgn80/uk-location-risk-report.md
- **Developed by:** [Halil Erdogan](https://apify.com/hllerdgn80) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.01 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## UK Location Risk & Amenity Report

Give this Actor a list of UK postcodes. For each one it geocodes the
postcode and then checks it against **three separate official UK
government / open-data sources in the same run**, combined into one
plain-English composite score:

1. **Live flood warnings** — Environment Agency real-time flood-monitoring
   API (currently active severe warnings, warnings, and alerts nearby).
2. **Street crime** — data.police.uk (the Home Office's official open-data
   API), most recently published month, broken down by category.
3. **Food hygiene ratings** — Food Standards Agency Ratings API, nearby
   establishments' 0–5 hygiene ratings, with any 0/1 ("urgent improvement
   necessary") findings flagged separately.

The pay-per-event charge (`address-checked`) only fires for a postcode that
actually resolved to a real UK location — a mistyped or non-existent
postcode costs nothing.

### Why this is different from existing crime/flood/food-hygiene Actors

The Apify Store already has separate, single-source Actors for UK police
crime data, EA flood warnings, and FSA food hygiene ratings individually.
**None of them combine all three for the same address in one run with a
single transparent composite score.** That is the gap this Actor fills —
anyone checking a property, area, or client address for risk (movers,
surveyors, landlords, insurers doing a first-pass screen, local journalists,
due-diligence teams) currently has to run three separate tools and
manually cross-reference them. This Actor does the cross-referencing.

The composite score is deliberately **not** a black box: every deduction it
makes is listed in the `risk_score.explanation` field of every single
result row, and is traceable straight back to one of the three source
fields (worst active flood severity level, crimes reported in the last
published month, and the average / worst FSA hygiene rating found nearby).
It is a transparency aid for comparing postcodes side by side, not an
insurance-grade underwriting product — the README and every output row say
so explicitly.

### Input

| Field | Type | Default | Notes |
|---|---|---|---|
| `postcodes` | array of strings | — | UK postcodes, e.g. `"SW1A 1AA"` |
| `postcodesText` | string | — | Same, pasted as one-per-line or comma-separated text; merged with `postcodes` |
| `includeCrime` | boolean | `true` | Query data.police.uk |
| `includeFlood` | boolean | `true` | Query the Environment Agency |
| `includeFoodHygiene` | boolean | `true` | Query the FSA Ratings API |
| `foodSearchRadiusMiles` | integer 1–5 | `1` | Food hygiene search radius |
| `floodSearchRadiusKm` | integer 1–30 | `10` | Flood warning search radius |

At least one postcode is required. Up to 500 postcodes are processed per
run; duplicates are removed automatically.

### Output (one row per postcode)

```json
{
  "postcode": "SW1A 1AA",
  "status": "ok",
  "latitude": 51.50101,
  "longitude": -0.141563,
  "region": "London",
  "local_authority_district": null,
  "parliamentary_constituency": "Cities of London and Westminster",
  "crime": {
    "month": "2026-07",
    "total_crimes": 42,
    "by_category": { "anti-social-behaviour": 18, "theft-from-the-person": 9 },
    "unavailable": false
  },
  "flood": {
    "active_warnings_count": 0,
    "active_alerts_count": 0,
    "worst_severity_level": null,
    "worst_severity_label": null,
    "warnings": [],
    "search_radius_km": 10
  },
  "food_hygiene": {
    "establishments_checked": 30,
    "rated_establishments": 28,
    "average_rating_0_to_5": 4.6,
    "low_rated_count": 0,
    "low_rated_establishments": [],
    "search_radius_miles": 1
  },
  "risk_score": {
    "composite_score_0_100": 96,
    "deductions": { "flood_deduction": 0, "crime_deduction": 4, "food_hygiene_deduction": 0 },
    "explanation": "composite_score_0_100 = 100 minus deductions: ..."
  }
}
```

A postcode that does not exist returns `"status": "postcode_not_found"`
and nothing else — it is not charged.

### What this Actor does NOT do (honest scope)

- **No historical/modelled flood risk.** The Environment Agency's separate
  long-term "risk of flooding from rivers and sea" score (a probability
  band, not a live event) is not an API product and is not scraped here.
  This Actor only reports *currently active* warnings/alerts, which is a
  different and narrower thing — the README and field names say "active",
  never "risk of flooding" to avoid implying the broader product.
- **No population-normalised crime rate when postcodes.io does not return
  a population figure for the area** — the `crime_deduction` falls back to
  a coarser, clearly-labelled count-based band rather than fabricating a
  per-capita rate from an assumed population.
- **No scraping.** All four data sources (postcodes.io, data.police.uk,
  Environment Agency, Food Standards Agency) are official, free, keyless,
  documented JSON APIs, called at a low request rate with retry/backoff on
  transient errors only (429/5xx) — never used to bypass a paywall or
  access restriction, because none of the four have one.
- **Not an underwriting or insurance product.** The composite score is a
  side-by-side comparison aid built transparently from three official
  fields; it is not a substitute for a professional survey, mortgage
  valuation, or insurer's own risk assessment, and the README/output say so.

### Related Actors on this account

- `app-store-intelligence` — Apple App Store rankings/ratings/history
- `uk-planning-applications` — UK local council planning application search
- `corporate-kyc-intelligence` — GLEIF LEI company ownership/compliance
- `companies-house-watchlist` — Companies House change-alert monitoring

Each covers a distinct official-data niche; this one is the first covering
UK **location/area** risk rather than a company, app, or planning case.

# Actor input Schema

## `postcodes` (type: `array`):

List of UK postcodes to check, e.g. "SW1A 1AA". Each valid postcode is geocoded with postcodes.io, then checked against the sources selected below.

## `postcodesText` (type: `string`):

Alternative to the list above for bulk input: one UK postcode per line, or comma-separated. Merged with 'postcodes' and de-duplicated.

## `includeCrime` (type: `boolean`):

Fetch the most recent month's street-level crime counts near the postcode from the official data.police.uk API (Home Office open data).

## `includeFlood` (type: `boolean`):

Fetch currently active flood warnings/alerts near the postcode from the Environment Agency's real-time flood-monitoring API.

## `includeFoodHygiene` (type: `boolean`):

Fetch nearby food hygiene ratings from the Food Standards Agency's official Ratings API and flag any 0/1-rated establishments.

## `foodSearchRadiusMiles` (type: `integer`):

How far from the postcode to look for rated food establishments, in miles. The FSA API accepts whole or fractional miles; this field is rounded to a whole number for simplicity.

## `floodSearchRadiusKm` (type: `integer`):

How far from the postcode to look for active Environment Agency flood warnings/alerts, in kilometres.

## Actor input object example

```json
{
  "postcodes": [
    "SW1A 1AA"
  ],
  "includeCrime": true,
  "includeFlood": true,
  "includeFoodHygiene": true,
  "foodSearchRadiusMiles": 1,
  "floodSearchRadiusKm": 10
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "postcodes": [
        "SW1A 1AA"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("hllerdgn80/uk-location-risk-report").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "postcodes": ["SW1A 1AA"] }

# Run the Actor and wait for it to finish
run = client.actor("hllerdgn80/uk-location-risk-report").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "postcodes": [
    "SW1A 1AA"
  ]
}' |
apify call hllerdgn80/uk-location-risk-report --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,hllerdgn80/uk-location-risk-report"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/7BIG01mS3Rp2iYXvi/builds/ITdtZUQbFS9W8DsFi/openapi.json
