# Govdata — 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 retrieve official German government datasets including demographics, economic indicators, and business statistics, or browse available organizations and categories to discover relevant open data resources. Filter results by high-value datasets and access site statistics to learn about recently updated information from Germany's Federal Open Data Portal.

**Category:** Government & Public Data | **Website:** [govdata.de/](https://govdata.de/) | **Docs:** [parse.bot/marketplace/fd933b21-8ea9-4052-aa0b-8b63f3c53cc2/govdata-de-api](https://parse.bot/marketplace/fd933b21-8ea9-4052-aa0b-8b63f3c53cc2/govdata-de-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-govdata-de-api-fd933b21/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_dataset

Retrieve complete metadata for a single dataset by its slug name or UUID. Returns all fields including resources (with format and download URL), tags, groups, extras, and full organization details.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `id` | string | Yes | Dataset slug name (e.g. '000-einwohner') or UUID. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-govdata-de-api-fd933b21/get_dataset \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"id":"<string>"}'
```

### get_recently_updated_datasets

Retrieve datasets sorted by most recent modification date descending. Equivalent to search_datasets with sort='metadata_modified desc' and no query. Useful for monitoring new data on the portal.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `limit` | integer | No | Number of recently updated datasets to return. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-govdata-de-api-fd933b21/get_recently_updated_datasets \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"limit":"<integer>"}'
```

### get_site_statistics

Retrieve portal-wide aggregate statistics: total dataset count and High Value Dataset count. Lightweight call suitable for dashboards and monitoring.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-govdata-de-api-fd933b21/get_site_statistics \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### list_categories

List all thematic categories (CKAN groups) with dataset counts. Returns the complete set of portal categories (~13 topics). No pagination needed since the set is small and fixed.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-govdata-de-api-fd933b21/list_categories \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### list_datasets

List dataset slug names available on the portal. Returns a paginated array of string identifiers (under 'items') that can be passed to get_dataset for full metadata retrieval.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `limit` | integer | No | Maximum number of slugs to return. |
| `offset` | integer | No | Offset for pagination. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-govdata-de-api-fd933b21/list_datasets \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"limit":"<integer>","offset":"<integer>"}'
```

### list_organizations

List data-publishing organizations registered on the portal with dataset counts. Returns paginated results sorted alphabetically by name.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `limit` | integer | No | Maximum number of organizations to return. |
| `offset` | integer | No | Offset for pagination. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-govdata-de-api-fd933b21/list_organizations \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"limit":"<integer>","offset":"<integer>"}'
```

### search_datasets

Full-text search over the portal's dataset catalog. Supports CKAN filter queries (fq), sorting, and offset-based pagination. Returns matching datasets with full metadata including organization, resources, tags, and groups.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `filters` | string | No | CKAN filter query (fq parameter) for faceted filtering, e.g. 'groups:soci' or 'organization:statistisches-bundesamt'. |
| `limit` | integer | No | Number of results to return per page. |
| `offset` | integer | No | Starting index for pagination. |
| `query` | string | No | Full-text search query (CKAN q parameter). Matches title, description, and tags. |
| `sort` | string | No | Sort field and direction, e.g. 'metadata_modified desc', 'title asc'. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-govdata-de-api-fd933b21/search_datasets \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"filters":"<string>","limit":"<integer>","offset":"<integer>","query":"<string>","sort":"<string>"}'
```

### search_hvd_datasets

Search for High Value Datasets (HVD) as defined by EU Implementing Regulation 2023/138. Filters on the hvd_category CKAN facet. Returns paginated results sorted by most recent modification.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `limit` | integer | No | Number of results to return. |
| `offset` | integer | No | Offset for pagination. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-govdata-de-api-fd933b21/search_hvd_datasets \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"limit":"<integer>","offset":"<integer>"}'
```
