# BOE — Wrapped API

> **You are on:** `https://api.beta.paywithlocus.com/api` | [llms.txt](https://beta.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 Spain's official government publications to retrieve daily legislative summaries, browse consolidated laws, and view detailed legal documents with their full text and metadata. Stay informed about new regulations and find specific legislation through comprehensive search and retrieval of official state gazette content.

**Category:** Government & Public Data | **Website:** [boe.es/](https://boe.es/) | **Docs:** [parse.bot/marketplace/e8f028c1-7141-4da6-bc80-33ededf0eef2/boe-es-api](https://parse.bot/marketplace/e8f028c1-7141-4da6-bc80-33ededf0eef2/boe-es-api)

Pay-per-use API proxy for Locus Pro. Each call burns credits from your workspace balance.

## Access

**Base URL:** `https://api.beta.paywithlocus.com/api/wrapped/credits/boe/`
**Auth:** `Authorization: Bearer <LOCUS_CREDITS_SECRET_KEY>` (an `lcr_` secret key or a scoped `lcac_` agent credential)
**Required header:** `Idempotency-Key: <fresh UUID per call>`. A retry with the same key replays the stored result without a new charge.
**Response:** the provider response after any endpoint-specific normalization. `X-Locus-Credits-Charged` carries the charge and `X-Locus-Credits-Balance` the remaining balance. Insufficient credits return `402` before the provider is called.
**Pricing:** estimated costs below are USD. Locus debits the credit equivalent at your workspace rate.

Full call contract: https://docs.paywithlocus.com/api-reference/introduction

> Using a Pay With Locus wallet key (`claw_` prefix)? Wallet routes are documented separately: https://docs.paywithlocus.com/wrapped-apis/for-agents

## Endpoints

### Get auxiliary data

Retrieve auxiliary classification codes used in the BOE system. Returns a flat dictionary mapping numeric code strings to descriptive name strings. Available types: 'rangos' (law types like Ley, Real Decreto), 'departamentos' (ministries and departments), 'materias' (subject matter categories).

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `type` | string | No | Type of auxiliary data to retrieve. |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/boe/get-auxiliary-data \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"type":"<string>"}'
```

### Get consolidated legislation list

Retrieve the complete list of consolidated legislation entries currently maintained in the BOE system. Each entry includes identifier, title, dates, scope, department, and links. The list is sorted by most recently updated. No pagination — returns the full list in one response.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/boe/get-consolidated-legislation-list \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Get daily summary

Retrieve the full summary of all documents published on a specific date in the BOE. Returns hierarchically structured data: diario sections, departments, and individual items with identifiers, titles, and links to PDF/HTML/XML versions. Dates without publications (weekends, holidays) return an upstream error. Items are grouped by section and department within the diario.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `date` | string | Yes | Publication date in YYYYMMDD format (e.g. 20260513). Must be a date when the BOE published (typically weekdays). |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/boe/get-daily-summary \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"date":"<string>"}'
```

### Get law details

Retrieve full metadata, analytical data (subject matters, cross-references to other laws), and ELI metadata for a specific consolidated law. The response includes metadatos (identification, dates, scope), analisis (materias and referencias anteriores/posteriores), and texto section headers. Use identifiers from get_consolidated_legislation_list or get_daily_summary.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `id` | string | Yes | BOE identifier for a consolidated law (e.g. BOE-A-2015-9140). Obtain from get_consolidated_legislation_list results or get_daily_summary items. |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/boe/get-law-details \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"id":"<string>"}'
```

### Get law text

Retrieve the structured full text of a consolidated law. Returns the content organized by blocks (bloque array) with types such as preambulo, encabezado, articulo, seccion, and nota_inicial. Each block contains versioned paragraphs with their publication and vigencia dates.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `id` | string | Yes | BOE identifier for a consolidated law (e.g. BOE-A-2015-9140). Obtain from get_consolidated_legislation_list results or get_daily_summary items. |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/boe/get-law-text \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"id":"<string>"}'
```

## Next steps

- [All wrapped API providers](https://beta.paywithlocus.com/wapi/index.md): pick another provider.
- [Find and call tools](https://beta.paywithlocus.com/agent/tools.md): price ceilings, async results, and errors.
- [Credits and billing](https://beta.paywithlocus.com/agent/billing.md): what a call costs and how to add credits.
- [Agent docs index](https://beta.paywithlocus.com/agent/index.md): every Locus agent page.