Developers
Lexipedia REST API
A versioned JSON API for Swiss laws and court decisions. Public read endpoints are unauthenticated.
OpenAPI
The machine-readable specification is available at /api/openapi.json.
curl https://lexipedia.io/api/openapi.jsonPublic Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /api/v1/laws | List laws, ordinances, treaties, and other legislation records. |
| GET | /api/v1/laws/{documentId} | Fetch one law with HTML and plain-text content. |
| GET | /api/v1/laws/search | Search laws with the canonical legal search engine. |
| GET | /api/v1/decisions | List court decisions with metadata and pagination. |
| GET | /api/v1/decisions/{documentId} | Fetch one court decision with HTML and plain-text content. |
| GET | /api/v1/decisions/search | Search court decisions with the canonical legal search engine. |
Pagination
List endpoints accept limit and offset. The default limit is 20 and the maximum public page size is 100.
{
"data": [],
"pagination": { "limit": 20, "offset": 0, "total": 0 },
"links": { "self": "/api/v1/laws?limit=20&offset=0" }
}Examples
curl "https://lexipedia.io/api/v1/laws?locale=fr&type=law&limit=10&sort=number&order=asc"
curl "https://lexipedia.io/api/v1/laws/search?q=contrat&locale=fr&sort=relevance"
curl "https://lexipedia.io/api/v1/decisions?locale=de&court=BGer&fromDate=2024-01-01&sort=publication_date&order=desc"
curl "https://lexipedia.io/api/v1/decisions/search?q=bonne%20foi&locale=fr&court=BGer"
curl "https://lexipedia.io/api/v1/decisions/123?locale=fr"Errors
{
"error": {
"code": "not_found",
"message": "Decision not found."
}
}