Data source: Retsinformation (api.retsinformation.dk)
Overview
Retsinformation (Danish Legislation) wraps Retsinformation (api.retsinformation.dk), handling authentication, pagination, and rate limits for you. This tutorial covers all 4 tools with working code examples you can copy and run.
Prerequisites
- Sign up at https://context.gnist.ai/signup for a free API key (100 calls/day).
- Choose your integration method: MCP protocol or REST API.
Connect via MCP
Add to your MCP client config (Claude Desktop, Cursor, etc.):
{
"mcpServers": {
"gnist-retsinformation": {
"url": "https://context.gnist.ai/mcp/retsinformation/",
"headers": {
"Gnist-API-Key": "YOUR_API_KEY"
}
}
}
}
Tools (4)
harvest_changes
Get recently changed Danish legislation documents from Retsinformation. Returns documents that were added, modified, or removed in the last 24 hours (or for a specific date within the last 10 days). Includes laws (LOV), regulations (BEK), circulars (CIR), and other official documents. Each document includes an ELI URL for retrieving the full text. Returns: Dict with 'count' and 'documents' list. Each has accession_number, document_type, change_date, reason_for_change, and eli_url.
| Parameter | Type | Required | Description |
|---|---|---|---|
date | any | optional | Date (YYYY-MM-DD, within last 10 days). Omit for today's changes. |
curl -X POST "https://context.gnist.ai/mcp/retsinformation/" \
-H "Content-Type: application/json" \
-H "Gnist-API-Key: YOUR_API_KEY" \
-d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "harvest_changes", "arguments": {"date": "2025-01-15"}}}'
import httpx
resp = httpx.post(
"https://context.gnist.ai/mcp/retsinformation/",
headers={"Gnist-API-Key": "YOUR_API_KEY"},
json={'id': 1,
'jsonrpc': '2.0',
'method': 'tools/call',
'params': {'arguments': {'date': '2025-01-15'}, 'name': 'harvest_changes'}},
)
print(resp.json())
get_document
Get full details of a Danish legal document by its accession number. Retrieves the document XML via ELI (European Legislation Identifier) URI and parses key metadata: title, dates, status, subjects, and body text. Document types include: - LOV: Laws (love) - BEK: Regulations (bekendtgørelser) - CIR: Circulars (cirkulærer) - VEJ: Guidelines (vejledninger) Returns: Document detail dict with title, dates, status, subjects, and body_text excerpt.
| Parameter | Type | Required | Description |
|---|---|---|---|
accession_number | string | required | Accession number from harvest results (e.g. 'B20260037005') |
curl -X POST "https://context.gnist.ai/mcp/retsinformation/" \
-H "Content-Type: application/json" \
-H "Gnist-API-Key: YOUR_API_KEY" \
-d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_document", "arguments": {"accession_number": "'B20260037005'"}}}'
import httpx
resp = httpx.post(
"https://context.gnist.ai/mcp/retsinformation/",
headers={"Gnist-API-Key": "YOUR_API_KEY"},
json={'id': 1,
'jsonrpc': '2.0',
'method': 'tools/call',
'params': {'arguments': {'accession_number': "'B20260037005'"},
'name': 'get_document'}},
)
print(resp.json())
search_by_type
Search recent Danish legislation changes filtered by document type. Filters today's (or a specific date's) harvest feed by document type. Useful for monitoring specific categories of legal changes. Returns: Dict with 'count' and 'documents' list filtered by type.
| Parameter | Type | Required | Description |
|---|---|---|---|
doc_type | any | optional | Document type filter: 'LOV' (law), 'BEK' (regulation), 'CIR' (circular), 'VEJ' (guideline) |
date | any | optional | Date (YYYY-MM-DD, within last 10 days). Omit for today. |
curl -X POST "https://context.gnist.ai/mcp/retsinformation/" \
-H "Content-Type: application/json" \
-H "Gnist-API-Key: YOUR_API_KEY" \
-d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "search_by_type", "arguments": {"doc_type": "example"}}}'
import httpx
resp = httpx.post(
"https://context.gnist.ai/mcp/retsinformation/",
headers={"Gnist-API-Key": "YOUR_API_KEY"},
json={'id': 1,
'jsonrpc': '2.0',
'method': 'tools/call',
'params': {'arguments': {'doc_type': 'example'}, 'name': 'search_by_type'}},
)
print(resp.json())
report_feedback
Report a bug, feature request, or general feedback for this data source. Use this when something doesn't work as expected, when you'd like a new feature, or when you have suggestions for improvement. Args: feedback: Describe the issue or suggestion. feedback_type: One of 'bug', 'feature_request', or 'general'.
| Parameter | Type | Required | Description |
|---|---|---|---|
feedback | string | required | |
feedback_type | string | optional | (default: general) |
curl -X POST "https://context.gnist.ai/mcp/retsinformation/" \
-H "Content-Type: application/json" \
-H "Gnist-API-Key: YOUR_API_KEY" \
-d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "report_feedback", "arguments": {"feedback": "example"}}}'
import httpx
resp = httpx.post(
"https://context.gnist.ai/mcp/retsinformation/",
headers={"Gnist-API-Key": "YOUR_API_KEY"},
json={'id': 1,
'jsonrpc': '2.0',
'method': 'tools/call',
'params': {'arguments': {'feedback': 'example'}, 'name': 'report_feedback'}},
)
print(resp.json())
Common Patterns
Use
search_by_type to find items, then get_document to get full details. This two-step pattern is common for exploring data before drilling down.FAQ
What data does Retsinformation (Danish Legislation) provide?
Danish legislation — daily harvest of changed laws, regulations, and circulars with ELI document retrieval. It exposes 4 tools: harvest_changes, get_document, search_by_type, report_feedback.
What do I need to get started?
A Gnist API key (free tier: 100 calls/day). Sign up at https://context.gnist.ai/signup.
What format does the Retsinformation (Danish Legislation) API return?
JSON, via either MCP protocol (JSON-RPC 2.0) or REST API.