APIs
The platform provides two APIs for accessing commentary data.
JSON API (/api)
Endpoints
GET /api/commentaries - List all published commentaries
GET /api/commentaries/{id} - Retrieve a specific commentary by ID
Query Parameters
The GET /api/commentaries endpoint supports the following query parameters:
language - Content language (en, de, fr, it). Default: en
search - Full-text search query
legislative_act - Filter by legislative act ID
sort - Sort order: title, -title, date, -date. Default: -date
page - Page number for pagination. Default: 1
Example Usage
# Get all commentaries curl -H 'Accept: application/json' 'https://onlinekommentar.ch/api/commentaries' # Search for specific term in German curl -H 'Accept: application/json' 'https://onlinekommentar.ch/api/commentaries?language=de&search=universalversammlung' # Get commentaries from specific legislative act, sorted by title curl -H 'Accept: application/json' 'https://onlinekommentar.ch/api/commentaries?legislative_act=2cdeaaed-30b6-416e-a6ca-7eaef78dfd69&sort=title' # Get a specific commentary by ID curl -H 'Accept: application/json' 'https://onlinekommentar.ch/api/commentaries/40eb831a-088b-4b27-9fe2-31f049c790a5'
OAI-PMH API (/oai)
Supported Verbs
Identify - Repository information and configuration
ListMetadataFormats - Available metadata formats (oai_dc, oai_openaire)
ListSets - Available sets (legal_domain:*)
ListIdentifiers - List record identifiers with optional filtering
ListRecords - Harvest full metadata records
GetRecord - Retrieve a single record by identifier
Parameters
verb - Required OAI-PMH verb (see list above)
metadataPrefix - Metadata format (oai_dc or oai_openaire)
identifier - Specific record identifier for GetRecord
from - Date range start (YYYY-MM-DD format)
until - Date range end (YYYY-MM-DD format)
set - Limit results to specific set
resumptionToken - Token for pagination continuation
Example Usage
# Get repository information curl 'https://onlinekommentar.ch/oai?verb=Identify' # List all records in Dublin Core format curl 'https://onlinekommentar.ch/oai?verb=ListRecords&metadataPrefix=oai_dc' # List records in OpenAIRE format from specific legal domain curl 'https://onlinekommentar.ch/oai?verb=ListRecords&metadataPrefix=oai_openaire&set=legal_domain:civil-procedure' # Get a specific record by identifier curl 'https://onlinekommentar.ch/oai?verb=GetRecord&metadataPrefix=oai_dc&identifier=oai:onlinekommentar.ch:commentary:40eb831a-088b-4b27-9fe2-31f049c790a5'
Metadata Formats
oai_dc - Dublin Core metadata standard for basic bibliographic information
oai_openaire - OpenAIRE v4.0 compliant metadata for research repositories