# Portalcompraspublicas — 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.

> Search and access detailed information about public tenders, bids, and procurement documents from Brazilian municipalities and states. Retrieve tender items, clarification logs, winner details, and all related documentation to monitor and analyze public purchasing activity across Brazil.

**Category:** Government & Public Data | **Website:** [portalcompraspublicas.com.br/](https://portalcompraspublicas.com.br/) | **Docs:** [parse.bot/marketplace/596f2537-7069-4f66-bbf4-b182109d9820/portalcompraspublicas-com-br-api](https://parse.bot/marketplace/596f2537-7069-4f66-bbf4-b182109d9820/portalcompraspublicas-com-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-portalcompraspublicas-com-br-api-596f2537/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_licitacao_detail

Get full details of a specific tender using its reference URL slug. Returns comprehensive information including dates, modality, buyer, status, legislation, and responsible officials. The slug comes from the urlReferencia field in list_licitacoes results.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `url_referencia` | string | Yes | URL reference slug from the tender listing's urlReferencia field (e.g. '/ap/prefeitura-municipal-de-porto-grande-3447/cmp-01-2026-2026-485985'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-portalcompraspublicas-com-br-api-596f2537/get_licitacao_detail \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url_referencia":"<string>"}'
```

### get_search_parameters

Retrieve the list of valid modalities, statuses, judgment types, realization types, and states used for filtering in list_licitacoes. A superset of list_ufs for UF data. Use this to discover valid filter codes before searching.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-portalcompraspublicas-com-br-api-596f2537/get_search_parameters \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### list_clarifications

Retrieve chat logs and clarifications for a specific tender. Returns system messages and communications in reverse chronological order with pagination. For tenders without messages, returns an empty frasesChat array.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `codigo_licitacao` | integer | Yes | The licitacao code (codigoLicitacao from list_licitacoes or get_licitacao_detail). |
| `page` | integer | No | Page number (1-based). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-portalcompraspublicas-com-br-api-596f2537/list_clarifications \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"codigo_licitacao":"<integer>","page":"<integer>"}'
```

### list_documents

Retrieve the list of documents (editais, anexos, relatórios) attached to a specific tender. Each document includes name, type, and download URL.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `codigo_licitacao` | integer | Yes | The licitacao code (codigoLicitacao from list_licitacoes or get_licitacao_detail). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-portalcompraspublicas-com-br-api-596f2537/list_documents \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"codigo_licitacao":"<integer>"}'
```

### list_licitacao_items

List the items or lots associated with a specific tender. Returns a flattened array of items (or lots when isLote is true). Each item includes description, quantity, unit, best bid, and situacao status. Supports pagination via page number.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `codigo_licitacao` | integer | Yes | The licitacao code (codigoLicitacao from list_licitacoes or get_licitacao_detail). |
| `page` | integer | No | Page number (1-based). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-portalcompraspublicas-com-br-api-596f2537/list_licitacao_items \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"codigo_licitacao":"<integer>","page":"<integer>"}'
```

### list_licitacao_winners

Retrieve homologated (awarded) items for a specific tender. Scans all items/lots and returns those with situacao codigo 7 (Homologado), 8 (Adjudicado), or 9. For unfinished or open tenders, returns an empty vencedores array.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `codigo_licitacao` | integer | Yes | The licitacao code (codigoLicitacao from list_licitacoes or get_licitacao_detail). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-portalcompraspublicas-com-br-api-596f2537/list_licitacao_winners \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"codigo_licitacao":"<integer>"}'
```

### list_licitacoes

List or search for public tenders (licitações) with optional filters and pagination. Returns paginated results ordered by most recent. Supports filtering by state, modality, status, date range, and keyword. Each result includes a urlReferencia slug for detail lookup and a codigoLicitacao for items/documents/clarifications/winners.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `codigo_modalidade` | integer | No | Modality code filter, from get_search_parameters. |
| `codigo_status` | integer | No | Status code filter. |
| `codigo_uf` | integer | No | State (UF) code to filter by, from list_ufs or get_search_parameters. |
| `data_final` | string | No | End date filter in YYYY-MM-DD format. |
| `data_inicial` | string | No | Start date filter in YYYY-MM-DD format. |
| `limit` | integer | No | Number of results per page. |
| `objeto` | string | No | Search keyword for the tender object/description. |
| `page` | integer | No | Page number (1-based). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-portalcompraspublicas-com-br-api-596f2537/list_licitacoes \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"codigo_modalidade":"<integer>","codigo_status":"<integer>","codigo_uf":"<integer>","data_final":"<string>","data_inicial":"<string>","limit":"<integer>","objeto":"<string>","page":"<integer>"}'
```

### list_ufs

List all 27 Brazilian states (UFs) with their internal codes. These codes are used for the codigo_uf filter in list_licitacoes.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-portalcompraspublicas-com-br-api-596f2537/list_ufs \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```
