# Brazil Municipal Fiscal Health (LRF/SICONFI) - Payroll & Debt (`kman-br/brazil-municipal-fiscal-health-lrf`) Actor

Latest Fiscal Management Report (RGF) of each Brazilian municipality or state from Tesouro Nacional SICONFI: net current revenue (RCL), personnel spending % of RCL vs. LRF limits, room in R$ until prudential limit, and net debt % of RCL. Search by IBGE code, name/UF, state or capitals.

- **URL**: https://apify.com/kman-br/brazil-municipal-fiscal-health-lrf.md
- **Developed by:** [Kman](https://apify.com/kman-br) (community)
- **Categories:** Business, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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

## Brazil Municipal Fiscal Health (LRF / SICONFI) - Personnel & Debt

**EN** · [PT-BR abaixo](#pt-br)

Every Brazilian municipality and state must publish a Fiscal Management Report (RGF) under the Fiscal Responsibility Law (LRF). The data sit in Tesouro Nacional's SICONFI as thousands of loose accounting lines per entity, with different periodicities (four-monthly or half-yearly, full or simplified). This Actor finds the **latest RGF of each entity** and returns one clean row:

- **Net current revenue** (RCL and adjusted RCL).
- **Personnel spending** (12 months): gross, active staff, retirees and pensioners, total for LRF purposes and **% of RCL**.
- **LRF status**: regular, alert (90%), prudential (95%) or above the maximum limit (54% municipalities / 49% states), plus the **room in R$** until the prudential limit.
- **Debt**: consolidated and net consolidated debt, **% of RCL** in the period and at the end of the previous year, Senate limit (120% / 200%).
- Select by IBGE code or Name/UF, by state, capitals, states/DF, or minimum population; filter by LRF status; sort by personnel % or debt %.

Built for companies that sell to governments (payment risk), banks and FIDCs with municipal exposure, public-sector consultancies, rating and ESG analysts, journalists and candidates' teams.

### Input

```json
{ "entes": ["3550308", "Campinas/SP", "Areias/SP"] }
```

or

```json
{ "estados": ["MG"], "populacaoMinima": 50000, "somenteSituacoes": ["prudencial", "acima_do_limite"] }
```

### Output (real row, RGF 2nd four-month period 2026)

```json
{ "ente": "Rio de Janeiro", "uf": "RJ", "cod_ibge": 3304557, "populacao": 6730729, "exercicio": 2026, "periodicidade": "quadrimestral", "periodo": 2, "rcl": 37824045684.68, "despesa_total_pessoal": 15986299915.93, "dtp_pct_rcl": 42.77, "limite_prudencial_pct": 51.3, "limite_maximo_pct": 54, "situacao_pessoal": "regular", "folga_ate_prudencial_rs": 3188060835.96, "dcl_pct_rcl": 28.46, "dcl_pct_rcl_exercicio_anterior": 35.85, "limite_senado_dcl_pct": 120 }
```

Entities with no RGF published in the last three years come back with `status: "sem_rgf_publicado"` **free of charge**.

### Pricing (pay per event)

- US$ 0.01 per run
- US$ 0.005 per entity analysed (all 27 state capitals ≈ US$ 0.14)

### Source and licence

Tesouro Nacional - SICONFI open data API (`/ords/siconfi/tt/rgf` and `/entes`), https://apidatalake.tesouro.gov.br/docs/siconfi/. Executive branch reports. Public entities only, no personal data. Not affiliated with Tesouro Nacional.

***

### PT-BR

**Situação fiscal (LRF) de prefeituras e estados** a partir do último RGF publicado no SICONFI do Tesouro Nacional:

- RCL, despesa com pessoal (12 meses) e **% da RCL** contra os limites de alerta, prudencial e máximo, com a **folga em R$** até o prudencial.
- Dívida consolidada e dívida consolidada líquida em % da RCL, no período e no fim do exercício anterior.
- Busca por código IBGE ou Nome/UF, UF, capitais, estados ou população mínima; filtro por situação; ordenação por pessoal ou dívida.
- Trata RGF quadrimestral, semestral e simplificado automaticamente.
- Preço: US$ 0,01 por execução + US$ 0,005 por ente (ente sem RGF sai de graça).
- Fonte: Tesouro Nacional / SICONFI, dados abertos. Sem dado pessoal.

# Actor input Schema

## `entes` (type: `array`):

IBGE code (7 digits for a municipality, 2 for a state) or Name/UF, e.g. Campinas/SP. If filled, the filters below are ignored.

## `tipoEnte` (type: `string`):

Used when 'Entities' is empty.

## `estados` (type: `array`):

Only entities in these states, e.g. SP, MG.

## `populacaoMinima` (type: `integer`):

Without entities or states, municipalities need at least 100,000 inhabitants (about 330 cities).

## `exercicio` (type: `integer`):

Empty = latest published report (tries the current and the two previous years).

## `somenteSituacoes` (type: `array`):

regular, alerta, prudencial, acima_do_limite (personnel spending vs. LRF).

## `ordenarPor` (type: `string`):

Order of the output rows.

## `maxEntes` (type: `integer`):

Largest first when filtering by state/population.

## Actor input object example

```json
{
  "entes": [
    "3550308",
    "Campinas/SP",
    "Areias/SP"
  ],
  "tipoEnte": "municipios",
  "populacaoMinima": 0,
  "ordenarPor": "dtp_pct_desc",
  "maxEntes": 100
}
```

# Actor output Schema

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

No description

## `summary` (type: `string`):

RUN_SUMMARY: entities selected, count per LRF status, not found, charged events.

# 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 = {
    "entes": [
        "3550308",
        "Campinas/SP",
        "Areias/SP"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("kman-br/brazil-municipal-fiscal-health-lrf").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 = { "entes": [
        "3550308",
        "Campinas/SP",
        "Areias/SP",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("kman-br/brazil-municipal-fiscal-health-lrf").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 '{
  "entes": [
    "3550308",
    "Campinas/SP",
    "Areias/SP"
  ]
}' |
apify call kman-br/brazil-municipal-fiscal-health-lrf --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,kman-br/brazil-municipal-fiscal-health-lrf"
        }
    }
}
```

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/NP8aOvPPXdWWnpz53/builds/ToSuY7UuPjXNHaT6e/openapi.json
