Search API

The Swiss Federal Archives provide an Application Programming Interface (API) to the metadata on recherche.bar.admin.ch. With this API, developers can create their own applications on top of the SFA's search engine.

Access the documentation of the API 

All metadata which is publically accessible in the Swiss Federal Archive’s online search is available via the API. Direct access to primary data is not possible, because only allowed for logged users. No login or API key is needed. The API is designed for single searches. It is not designed for bulk downloads. All publically available metadata from the SFA can be conveniently downloaded from the OpenData.swiss platform in one single zipped file (504.0MB).

Technical specification

Host: "https://www.recherche.bar.admin.ch/recherche/api/v1/"

API type: RESTful.

Exchange format: JSON

Character encoding: UTF-8.

  • Fetch one record using its id: GET "https://www.recherche.bar.admin.ch/recherche/api/v1/entities/{id}"
  • Fetch multiple records: GET "https://www.recherche.bar.admin.ch/recherche/api/v1/entities?ids=1,412,42"
  • Search a record: POST request with header: {‘content-type’ : ‘application/json; charset=utf-8'} to "https://www.recherche.bar.admin.ch/recherche/api/v1/entities/Search"