APIs
The platform provides two APIs for accessing commentary data.
JSON API (/api)
Endpoints
GET /api/commentaries
- List all published commentariesGET /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: ensearch
- Full-text search querylegislative_act
- Filter by legislative act IDsort
- Sort order: title, -title, date, -date. Default: -datepage
- 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 configurationListMetadataFormats
- Available metadata formats (oai_dc, oai_openaire)ListSets
- Available sets (legal_domain:*)ListIdentifiers
- List record identifiers with optional filteringListRecords
- Harvest full metadata recordsGetRecord
- 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 GetRecordfrom
- Date range start (YYYY-MM-DD format)until
- Date range end (YYYY-MM-DD format)set
- Limit results to specific setresumptionToken
- 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