# South Africa Municipal Finance Data - Budgets, Audits, Grants (`superior_typhoon_xgu/sa-municipal-finance-data`) Actor

Official National Treasury Municipal Money data for all 257 South African municipalities: budgets, spending, grants, debtors, irregular expenditure and audit opinions. By Musa AI Tools.

- **URL**: https://apify.com/superior_typhoon_xgu/sa-municipal-finance-data.md
- **Developed by:** [Musa AI Tools](https://apify.com/superior_typhoon_xgu) (community)
- **Categories:** Lead generation, Business, Other
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## 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

## South Africa Municipal Finance Data – Budgets, Spending, Audit Opinions & Grants API

**Get official financial data for all 257 South African municipalities in one click.** This Actor extracts National Treasury **Municipal Money** data covering metros, district and local municipalities: **income & expenditure, budgets vs actuals, balance sheets, cash flow, capital spending, grants, repairs & maintenance, debtors, creditors, irregular / fruitless & wasteful expenditure and Auditor-General audit opinions**. You get clean, flat records as **JSON, CSV, Excel or via API**, ready for spreadsheets, BI dashboards, research and AI agents.

### 🔎 What does SA Municipal Finance Data do?

- Pulls from the official **National Treasury Municipal Money API** (municipaldata.treasury.gov.za), with data from 2003/04 to the latest quarter
- Covers **20 datasets**, including Income & Expenditure, Financial Position, Cash Flow, Capital Acquisition, Grants, Aged Debtors/Creditors, UIFW expenditure, Audit Opinions and the municipality directory
- Filters by **municipality code** (CPT, JHB, TSH, ETH, EKU, NMA, BUF, MAN…), **province**, **financial year** and **amount type** (audited actual, original budget, adjusted budget…)
- Returns flat, consistent fields (`municipalityCode`, `financialYear`, `itemLabel`, `amountType`, `amount`…) plus every original field
- Built to be reliable: automatic retries with exponential backoff, 45 s timeouts and graceful handling of API outages
- Each record carries a **source attribution** line, as the data's terms of use require

### 👥 Who is it for?

- **Investors and credit analysts** assessing municipal bonds, creditworthiness and service-delivery risk
- **Suppliers and contractors** checking whether a municipality pays creditors on time before bidding
- **Journalists, civic-tech groups and NGOs** tracking irregular expenditure and audit outcomes
- **Researchers, consultants and economists** building time series across municipalities
- **Property developers and businesses** comparing metros for capital investment and infrastructure spending

### 📦 Output data

| Field | Example |
|---|---|
| dataset | audit_opinions |
| municipalityCode / municipalityName | CPT / Cape Town |
| financialYear | 2024 (year ending June 2024) |
| itemLabel | Sale of Goods and Rendering of Services |
| amountType | Audited Actual |
| amount | 7808 (Rand) |
| period | 2024 (year) |
| opinion / reportUrl | Unqualified - No findings / link to the AG audit report PDF |
| …all original fields | e.g. `functionCategoryLabel`, `itemCode`, `grantLabel` |
| sourceAttribution, retrievedAt | Source: National Treasury, Municipal Money… |

Sample item:

```json
{
  "dataset": "audit_opinions",
  "municipalityCode": "CPT",
  "municipalityName": "Cape Town",
  "financialYear": 2024,
  "opinion": "Unqualified - No findings",
  "reportUrl": "https://lg.treasury.gov.za/supportingdocs/CPT/...Audit Report_2024....pdf",
  "sourceAttribution": "Source: National Treasury, Municipal Money (municipaldata.treasury.gov.za), dataset \"audit_opinions\", retrieved 2026-10-20."
}
```

### ⚙️ Input

| Field | Description |
|---|---|
| dataset | Which dataset to extract (default: Audit Opinions) |
| municipalities | Demarcation codes, e.g. `CPT`, `JHB`, `WC011`. Leave empty for all |
| province | EC, FS, GT, KZN, LIM, MP, NC, NW, WC |
| financialYears | e.g. `2024`, `2023`. Leave empty for all years |
| amountTypes | e.g. `AUDA` (audited actual), `ORGB` (original budget), `ADJB` (adjusted budget) |
| annualOnly | Keep only full-year figures (default on) |
| maxItems | Maximum number of records (default 1000) |

### 🚀 How to use it

1. Pick a **dataset**, add municipality codes and/or a province and a year, then press **Start**.
2. Download as JSON, CSV or Excel, or call the Apify API from Python, Node.js, Make, Zapier or n8n.
3. **Schedule** monthly or quarterly runs to keep a dashboard or Google Sheet up to date when Treasury publishes new figures.

**Examples**

- Audit opinions for every Gauteng municipality in 2024: `dataset=audit_opinions`, `province=GT`, `financialYears=["2024"]`
- Johannesburg's budget vs actual spending: `dataset=incexp_v2`, `municipalities=["JHB"]`, `amountTypes=["ORGB","AUDA"]`
- Irregular expenditure across all metros: `dataset=uifwexp`, `municipalities=["CPT","JHB","TSH","ETH","EKU","NMA","BUF","MAN"]`

### 💰 Cost

This Actor is lightweight: it calls the API directly, with no browser. Typical runs finish in seconds and cost fractions of a cent.

### ❓ FAQ

**Is this data free to reuse?** Yes. National Treasury's Municipal Money terms of use allow you to download, copy, publish and use the data **commercially and non-commercially**, provided you **acknowledge National Treasury as the source and the publication date**, don't use it to mislead, and don't imply Treasury endorses you. Every record includes a `sourceAttribution` field to make that easy. This Actor is not affiliated with or endorsed by National Treasury.

**Is personal data included?** No. The "Municipal Officials" dataset is deliberately not supported.

**What do the amount types mean?** AUDA = audited actual, ORGB = original budget, ADJB = adjusted budget, PAUD = pre-audit, ACT = in-year actual, IBY1/IBY2 = budget-year forecasts.

**How fresh is the data?** It is live from the API: Treasury updates it quarterly as municipalities submit their returns.

**Need something else?** Open an issue on the Actor's Issues tab.

***

*Keywords: South Africa municipal data, Municipal Money API, National Treasury data, municipal budgets South Africa, municipal finance API, audit opinions Auditor-General, irregular expenditure, fruitless and wasteful expenditure, metro budgets, Cape Town Johannesburg Tshwane eThekwini finances, local government data South Africa, MFMA data.*

# Actor input Schema

## `dataset` (type: `string`):

Which National Treasury Municipal Money dataset to extract.

## `municipalities` (type: `array`):

Demarcation codes, e.g. CPT (Cape Town), JHB (Johannesburg), TSH (Tshwane), ETH (eThekwini), EKU (Ekurhuleni), NMA (Nelson Mandela Bay), BUF (Buffalo City), MAN (Mangaung). Leave empty for all municipalities.

## `province` (type: `string`):

Only municipalities in this province. Combined with municipality codes if both are given.

## `financialYears` (type: `array`):

Financial year-end years, e.g. 2024 (= July 2023 to June 2024). Leave empty for all years.

## `amountTypes` (type: `array`):

For financial datasets only, e.g. AUDA (audited actual), ORGB (original budget), ADJB (adjusted budget), ACT (actual), PAUD (pre-audit), IBY1/IBY2 (budget forecasts). Leave empty for all.

## `annualOnly` (type: `boolean`):

For financial datasets, keep only full-year figures (skip monthly/quarterly in-year reports).

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

Maximum number of records to return.

## Actor input object example

```json
{
  "dataset": "audit_opinions",
  "municipalities": [
    "CPT",
    "JHB"
  ],
  "province": "",
  "financialYears": [
    "2024"
  ],
  "annualOnly": true,
  "maxItems": 1000
}
```

# Actor output Schema

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

All extracted records (flattened, one item per fact).

# 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 = {
    "municipalities": [
        "CPT",
        "JHB"
    ],
    "financialYears": [
        "2024"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("superior_typhoon_xgu/sa-municipal-finance-data").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 = {
    "municipalities": [
        "CPT",
        "JHB",
    ],
    "financialYears": ["2024"],
}

# Run the Actor and wait for it to finish
run = client.actor("superior_typhoon_xgu/sa-municipal-finance-data").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 '{
  "municipalities": [
    "CPT",
    "JHB"
  ],
  "financialYears": [
    "2024"
  ]
}' |
apify call superior_typhoon_xgu/sa-municipal-finance-data --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,superior_typhoon_xgu/sa-municipal-finance-data"
        }
    }
}
```

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/I8TbTGVu3gwqMgMBs/builds/A3S7M4n4vuvi663Oc/openapi.json
