# Service Public — 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 the official French public service portal (service-public.fr) for practical guides, legal information, administrative procedures, and support resources. Retrieve structured content from any guide or category page, explore autocomplete suggestions, and access legal references — all through a single unified API.

**Category:** Government & Public Data | **Website:** [service-public.fr/](https://service-public.fr/) | **Docs:** [parse.bot/marketplace/a2df7739-0c80-4b91-a9b8-fa1c03d43123/service-public-fr-api](https://parse.bot/marketplace/a2df7739-0c80-4b91-a9b8-fa1c03d43123/service-public-fr-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-service-public-fr-api-a2df7739/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_fiche_by_id

Fetch and parse a practical guide (Fiche Pratique) or category page by its ID. Returns structured content including title, breadcrumb, introduction, and accordion sections.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `id` | string | Yes | Fiche ID such as 'F32239' or 'N31146'. Typically starts with F (fiche), N (node/category), or R (resource). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-service-public-fr-api-a2df7739/get_fiche_by_id \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"id":"<string>"}'
```

### get_suggestions

Get autocomplete suggestions and direct access links for a search term on service-public.fr.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `query` | string | Yes | Search term to get autocomplete suggestions for (e.g. 'retraite', 'logement') |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-service-public-fr-api-a2df7739/get_suggestions \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"<string>"}'
```

### search_site

Search service-public.fr for practical guides, news, and services. Returns paginated results with titles, URLs, and document IDs.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `page` | integer | No | Page number for pagination. |
| `query` | string | Yes | Search keywords |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-service-public-fr-api-a2df7739/search_site \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"page":"<integer>","query":"<string>"}'
```
