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

> Access tender notices and PDF documents from Italian municipality portals, search for specific tenders, and download official tender documents directly. Get detailed information about tender opportunities and stay updated on public procurement notices from Halley-powered municipal systems.

**Category:** Government & Public Data | **Website:** [halleyweb.com/](https://halleyweb.com/) | **Docs:** [parse.bot/marketplace/4778dcc5-2a11-4f74-800f-561e4d6949d9/halleyweb-com-api](https://parse.bot/marketplace/4778dcc5-2a11-4f74-800f-561e4d6949d9/halleyweb-com-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-halleyweb-com-api-4778dcc5/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### download_tender_pdf

Retrieve metadata (content type, file size, filename) for a specific PDF or document attachment without downloading the file contents. Performs a HEAD-like inspection of the document URL. The url parameter is obtained from get_tender_notice_detail or list_tender_pdfs results.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `url` | string | Yes | Full URL of the PDF/document to inspect (from get_tender_notice_detail or list_tender_pdfs results pdfs[*].url). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-halleyweb-com-api-4778dcc5/download_tender_pdf \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"<string>"}'
```

### get_tender_notice_detail

Extract structured metadata and document links from a specific tender notice detail page. Returns the page title, codes (CIG, CUP when available), and all attached PDF/document links. The url parameter is typically obtained from list_tender_notices results.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `url` | string | Yes | Full URL of the tender notice detail page (from list_tender_notices results[*].detail_url). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-halleyweb-com-api-4778dcc5/get_tender_notice_detail \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"<string>"}'
```

### list_tender_notices

Retrieve all published tender notices from a municipality's HalleyWeb portal. Returns structured metadata for each tender including title, CIG code, dates, awarded amount, and procedure type. Municipalities without active tenders return an empty array. Each tender carries a detail_url suitable for drill-down via get_tender_notice_detail.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `base_url` | string | Yes | Municipality base URL on HalleyWeb, in the format https://www.halleyweb.com/<municipality_code>. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-halleyweb-com-api-4778dcc5/list_tender_notices \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"base_url":"<string>"}'
```

### list_tender_pdfs

List all PDF and document attachments associated with a tender notice page. Returns the same document structure as get_tender_notice_detail, focused on document discovery. Useful when only the attachments are needed.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `url` | string | Yes | Full URL of the tender notice detail page (from list_tender_notices results[*].detail_url). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-halleyweb-com-api-4778dcc5/list_tender_pdfs \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"<string>"}'
```

### search_tenders

Search tender notices by keyword within a municipality portal. Fetches the full tender list and filters client-side by case-insensitive match against title and CIG code. Returns only matching tenders with a total count.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `base_url` | string | Yes | Municipality base URL on HalleyWeb, in the format https://www.halleyweb.com/<municipality_code>. |
| `query` | string | Yes | Search keyword to filter tenders by title or CIG code (case-insensitive). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-halleyweb-com-api-4778dcc5/search_tenders \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"base_url":"<string>","query":"<string>"}'
```
