# Transparenciaportal — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Track and analyze Brazilian government spending by accessing detailed records on politician amendments, public servant salaries, beneficiary payments, and government payment card transactions. Monitor how public funds are allocated across different government bodies and identify spending patterns through comprehensive financial data from Brazil's official transparency portal.

**Category:** Government & Public Data | **Website:** [transparenciaportal.gov.br/](https://transparenciaportal.gov.br/) | **Docs:** [parse.bot/marketplace/8e9f5ce6-bdcb-4984-9c48-5d0bdc66d2ec/transparenciaportal-gov-br-api](https://parse.bot/marketplace/8e9f5ce6-bdcb-4984-9c48-5d0bdc66d2ec/transparenciaportal-gov-br-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-transparenciaportal-gov-br-api-8e9f5ce6/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_cartoes

Get government payment card transactions for a given period. Returns paginated results ordered by transaction date. Each record includes card type, issuing agency, cardholder, and transaction value. Pagination is offset-based.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `date_from` | string | No | Start date in DD/MM/YYYY format. |
| `date_to` | string | No | End date in DD/MM/YYYY format. |
| `limit` | integer | No | Maximum number of results per page. |
| `offset` | integer | No | Pagination offset (number of records to skip). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-transparenciaportal-gov-br-api-8e9f5ce6/get_cartoes \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"date_from":"<string>","date_to":"<string>","limit":"<integer>","offset":"<integer>"}'
```

### get_despesas_favorecido

Get detailed public expenditures by beneficiary and phase. Returns paginated results ordered by value descending. Each record includes date, beneficiary, state, value, expense phase, supervising agency, function, program, and action. Pagination is offset-based.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `date_from` | string | No | Start date in DD/MM/YYYY format. |
| `date_to` | string | No | End date in DD/MM/YYYY format. |
| `fase` | string | No | Expense phase: 1 for Empenho, 2 for Liquidação, 3 for Pagamento. |
| `limit` | integer | No | Maximum number of results per page. |
| `offset` | integer | No | Pagination offset (number of records to skip). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-transparenciaportal-gov-br-api-8e9f5ce6/get_despesas_favorecido \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"date_from":"<string>","date_to":"<string>","fase":"<string>","limit":"<integer>","offset":"<integer>"}'
```

### get_despesas_recursos_recebidos

Get resources received by beneficiaries for a given period. Returns paginated results ordered by month/year. Each record identifies the beneficiary, their type, location, and the value received. Pagination is offset-based.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `date_from` | string | No | Start date in DD/MM/YYYY format. |
| `date_to` | string | No | End date in DD/MM/YYYY format. |
| `limit` | integer | No | Maximum number of results per page. |
| `offset` | integer | No | Pagination offset (number of records to skip). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-transparenciaportal-gov-br-api-8e9f5ce6/get_despesas_recursos_recebidos \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"date_from":"<string>","date_to":"<string>","limit":"<integer>","offset":"<integer>"}'
```

### get_emendas

Get parliamentary amendments (spending by politicians) for a specific year. Returns paginated results ordered by author. Each amendment includes budget details such as committed, liquidated, and paid values across multiple government functions and programs. Pagination is offset-based: advance by incrementing offset by limit.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `limit` | integer | No | Maximum number of results per page. |
| `offset` | integer | No | Pagination offset (number of records to skip). |
| `year` | string | No | Year to query amendments for in YYYY format. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-transparenciaportal-gov-br-api-8e9f5ce6/get_emendas \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"limit":"<integer>","offset":"<integer>","year":"<string>"}'
```

### get_servidores

Get federal public servants data. Automatically extracts the required security token from the consultation page. Returns paginated results ordered by name. Each record includes servant type, masked CPF, organization, role, and status. Pagination is offset-based.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `limit` | integer | No | Maximum number of results per page. |
| `offset` | integer | No | Pagination offset (number of records to skip). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-transparenciaportal-gov-br-api-8e9f5ce6/get_servidores \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"limit":"<integer>","offset":"<integer>"}'
```
