# UK Postcode Business Profile — food businesses & charities (`powerfully_goliath/uk-business-postcode-profile`) Actor

Give a postcode district, get one row per local business: food hygiene ratings joined with registered charities, tagged by source. Contact details, ratings, charity income, lat/long. Official open data, no API key. Pay per result.

- **URL**: https://apify.com/powerfully_goliath/uk-business-postcode-profile.md
- **Developed by:** [Richie Ellis](https://apify.com/powerfully_goliath) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 1,000 business returneds

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 Business Postcode Profile — every food business & charity in a postcode

Type a **UK postcode district** (`LS6`, `SW1A`, `SG8`) and get **one row per local business**,
built by **joining two official open datasets** and **tagged by source**:

- **Food businesses** from the Food Standards Agency's hygiene-rating scheme: restaurants, cafes,
  takeaways, pubs, shops, schools, nurseries, care premises, with **rating, rating date,
  latitude/longitude and council**;
- **Registered charities** from the Charity Commission: **charity number, income, activities,
  email, phone and website**.

When a food business and a charity share a postcode and a name (a village hall, a community
cafe, a church hall, a school or nursery run as a charity) they become **one row carrying both
tags and both sets of facts**, the join that single-source scrapers do not give you.

No API key, no scraping, no proxies. **Pay only for the results you get.** Suggested price:
**$1.50 per 1,000 rows**, **$6.00 per 1,000** for joined (both-source) rows (the owner sets the
final price in the Apify Console).

***

### What you can do with it

- **Local lead generation**: a complete list of the businesses, schools and charities in a patch,
  with phone, website and email where the registers hold them.
- **Charity-run food businesses**: switch on "only businesses found in both datasets" to list
  community cafes, village halls and church halls with their rating and charity income.
- **Territory planning**: sales and field teams sizing a postcode district before they visit it.
- **Local research and journalism**: how many places serve food in a district, how they rate, and
  how big the local charities are.

### Input

| Field | What it does |
|---|---|
| **Postcode districts** *(required)* | Outward codes: `LS6`, `SW1A`, `M1`. `LS1` never returns `LS10`. Up to 30. |
| **Include food businesses (FSA)** | On by default. |
| **Include charities (Charity Commission)** | On by default. Reads the 44 MB daily register extract (about 20 seconds). |
| **Only businesses found in both datasets** | Keep only joined rows. |
| **Maximum results** | A hard cap. You are never charged for more than this. |

#### Example input

```json
{
  "postcodeDistricts": ["SG8", "SG7"],
  "includeFoodHygiene": true,
  "includeCharities": true,
  "maxItems": 1000
}
```

### Output

One row per business. `sources` tells you which datasets know it. Joined example:

```json
{
  "id": "fsa:1579234",
  "sources": ["food-hygiene", "charity"],
  "name": "Barkway Village Hall",
  "businessType": "Restaurant/Cafe/Canteen",
  "postcode": "SG8 8BS",
  "postcodeDistrict": "SG8",
  "address": "The Village Hall, High Street, Barkway, SG8 8BS",
  "localAuthority": "South Cambridgeshire",
  "phone": "01763 848000",
  "email": "bookings@example.org",
  "website": "https://www.barkwayhall.example.org",
  "latitude": 52.0412,
  "longitude": 0.0518,
  "foodRating": "5",
  "foodRatingDate": "2024-06-12",
  "fhrsId": 1579234,
  "foodRatingUrl": "https://ratings.food.gov.uk/business/1579234",
  "charityNumber": 1100001,
  "charityIncome": 41200,
  "charityUrl": "https://register-of-charities.charitycommission.gov.uk/en/charity-search/-/charity-details/9000001"
}
```

Food-only rows leave the charity fields empty; charity-only rows (`id` starts `charity:`) leave
the food fields empty. The **OUTPUT** record in the key-value store counts food businesses,
charities, joined rows and charity-only rows.

**How the join works:** same postcode, and the names match after dropping filler words (`the`,
`ltd`, `trust`, `society`...), either exactly or one contained in the other. A lone generic word
such as "Cafe" never matches on its own.

### Pricing (pay per event)

| Event | Suggested price |
|---|---|
| Business returned (one dataset) | **$0.0015** ($1.50 per 1,000) |
| Joined business returned (food rating + charity facts) | **$0.006** ($6.00 per 1,000) |
| Actor start | Apify's minimum ($0.00005 per run) |

You pay only for rows delivered. The **Maximum results** cap and your spending limit are respected
exactly.

### Good to know

- **Companies House is not included**: its API needs a key. For company data, use the separate
  UK Companies House actor.
- Food ratings are the council's at the time of inspection; Scottish premises use Pass /
  Improvement Required instead of 0-5.
- A small number of FSA premises have no full postcode and are skipped for district filtering.
- Contains public sector information licensed under the
  [Open Government Licence v3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/):
  Food Standards Agency (c) FSA; Charity Commission for England and Wales register extract.
  This actor is independent and not endorsed by either body.

### Related UK open-data actors

- **UK Food Hygiene Ratings (FSA)**: full filters, scores and radius search.
- **UK Charity Register**: every registered charity, with trustees and causes.
- **UK CQC Care Providers**: care homes, GPs, dentists and homecare in England.

# Actor input Schema

## `postcodeDistricts` (type: `array`):

Outward codes such as LS6, SW1A or M1. LS1 never returns LS10.

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

Restaurants, takeaways, pubs, shops, schools, nurseries and every other FSA-rated premises.

## `includeCharities` (type: `boolean`):

Registered charities with a contact address in the district. Downloads the 44 MB daily register extract (about 20 seconds).

## `onlyJoined` (type: `boolean`):

Keep only food businesses that are also a registered charity at the same postcode (village halls, community cafes, church halls...).

## `maxItems` (type: `integer`):

Stop after this many businesses. You are charged only for results delivered.

## Actor input object example

```json
{
  "postcodeDistricts": [
    "LS6",
    "SG8"
  ],
  "includeFoodHygiene": true,
  "includeCharities": true,
  "onlyJoined": false,
  "maxItems": 20
}
```

# Actor output Schema

## `overview` (type: `string`):

Business, sources, type, address and contact.

## `ratings` (type: `string`):

Food hygiene rating and charity number and income side by side.

## `runSummary` (type: `string`):

The OUTPUT record: query used, results delivered, events charged and why the run stopped.

# 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 = {
    "postcodeDistricts": [
        "SG8"
    ],
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("powerfully_goliath/uk-business-postcode-profile").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 = {
    "postcodeDistricts": ["SG8"],
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("powerfully_goliath/uk-business-postcode-profile").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 '{
  "postcodeDistricts": [
    "SG8"
  ],
  "maxItems": 20
}' |
apify call powerfully_goliath/uk-business-postcode-profile --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,powerfully_goliath/uk-business-postcode-profile"
        }
    }
}
```

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/uR2795OSjpHGsdUMy/builds/vAkHn12pgeNifmSAk/openapi.json
