Navigation and service

29 March to 1 April 2024

The German National Library will be closed at both locations. The exhibitions of the German Museum of Books and Writing will open from 10:00 to 18:00.

Searching for and importing bibliographic and authority data

With SRU (Search/Retrieve via URL), you can use search indices and search terms to conduct systematic searches of the German National Library’s data and subsequently import it into your own environment. The results of the search are provided in a defined XML format.
Queries are formulated in the retrieval language (Contextual Query Language).

The SRU standard was published by the Library of Congress and is a further development of the Z39.50 protocol.

An overview of all available metadata as well as the different options of obtaining data is given here.

Standards of SRU interface

SRU protocol: Version 1.1
Retrieval language CQL Context Set Version 1.2, Conformance-Level 2

SRU functions

SRU encompasses the basic functions:

  • Explain: Self-description in XML standard format, including information on

    • Catalogue
    • Indices and supported sorting parameters
    • Data formats
  • Search/Retrieve: Search query

    • Retrieval language: CQL (Contextual Query Language)
    • Boolean operators (and, or, not) are supported. An index must be entered for each search term, otherwise the search is carried out in the default index WOE.

      Syntax of a search query: ... index%3Dsearch term%20or%20index%3Dsearch term ...

    • Help in formulating a CQL search query
  • Sort: Sorting the result set

    • the sort parameter is not supported in SRU version 1.1 but as part of CQL Context Set version 1.2. For which indices the sorting parameter is supported is available in the catalogue-specific SRU-Explain, in the specification sort=“true“, a combination is not possible.
      Syntax of a search query: sort.descending or sort.ascending

Access requirements

The SRU interface can be accessed free of charge and without registration.

Available catalogues and formats

Catalogues
Catalogue selectionStart of a search query to this catalogue
Catalogue of the German National Library (DNB) excluding the Integrated Authority File (GND)https://services.dnb.de/sru/dnb?version=1.1&operation=searchRetrieve&query=…
Catalogue of the German Music Archive (DMA)https://services.dnb.de/sru/dnb.dma?version=1.1&operation=searchRetrieve&query=…
Authorities: Catalogue of Integrated Authority File (GND)
Restrictions according to entities
https://services.dnb.de/sru/authorities?version=1.1&operation=searchRetrieve&query=…
Catalogue of the German Union Catalogue of Serials (ZDB)https://services.dnb.de/sru/zdb?version=1.1&operation=searchRetrieve&query=…

The following formats are offered in UTF-8 decomposed character encoding:

Formats
FormatsFormat nameStandardized XML schemaExamples
MARC21-xmlMARC 21 in an XML structureXML schema for MARC 21MARC21-xml
DNB Casual (oai_dc)Selection of Dublin-Core-Elements bibliographic data onlyXML schema for Dublin CoreDNB Casual (oai_dc)
RDF (RDFxml)Linked Data ServiceXML syntax for RDFRDF (RDFxml)

Further formats are available for the metadata of the German Union Catalogue of Serials (ZDB).

Terms of use and provision

Detailed information on terms of use and provision is given here.

Practical examples

Syntax of an SRU query
ExampleExplanation
https://services.dnb.de/sru
Query to the DNB’s SRU server
/dnbCatalogue specification (e.g. DNB)
?version=1.1Specification of SRU version, standard
&operation=searchRetrieveCommand to server
&query=Anfrage formulieren
SW%3DGoethe
%20or%20
SW%3DSchiller
SW is the name of the index, %3D is the URL encoding for =, search terms in this example: Goethe or Schiller (boolean combination)
%20sortby%20tit/sort.ascendingResult set sorted by title from A-Z ascending
&recordSchema=MARC21-xmlDesired format for SRU response

SRU-query for the bibliographic data of a specific edition or calendar week of a series of the Deutschen Nationalbibliografie: Queries for the calendar week must follow the pattern: YY,seriesCW in the „WVN" index (e. g. Series A, Edition 05 of year 2022 = 22,A05). The calendar week requires two digits, weeks 1 through 9 starting with 0.

Example:
https://services.dnb.de/sru/dnb?version=1.1&operation=searchRetrieve&query=WVN%3D22A05&recordSchema=MARC21-xml

The following qualifications are possible:

Qualified by entity in "authorities" catalogue
EntitiesBibliographic genre
Geographical entityTg
Congress/eventTf
Corporate bodyTb
PersonTp
Subject termTs
WorkTu

The Asterisk *is a placeholder for any number of characters and must be placed directly behind the value.

Examples of SRU requests:

Tp* (Person)

https://services.dnb.de/sru/authorities?version=1.1&
operation=searchRetrieve&
query=WOE%3DRupp%20Elisabeth%20and%20BBG%3DTp*&
recordSchema=MARC21-xml

Ts* (Subject term)

https://services.dnb.de/sru/authorities?version=1.1&
operation=searchRetrieve&
query=WOE%3DMarketing%20and%20BBG%3DTs*&
recordSchema=MARC21-xml

Subject headings can be obtained by qualifiying the search with „COD=s“:

https://services.dnb.de/sru/authorities?version=1.1&
operation=searchRetrieve&
query=WOE%3Dsozialistenkongress%20and%20COD%3Ds&
recordSchema=MARC21-xml

URL coding

In URL-Encoding umlauts are coded using UTF-8 and with a prefixed % sign (percent encoding).
Example: Lower case ö in UTF-8 = C3 B6. With prefixed % sign = %C3%B6.

URL coding
ZeichenUTF-8 hexadezimal
Ä=%C3%84
Ö=%C3%96
Ü=%C3%9C
ä=%C3%A4
ö=%C3%B6
ü=%C3%BC
ß=%C3%9F
(space)=%20
" (quotation marks)=%22
/ (slash)=%2F
\ (backslash)=%5C
List of other characters

In order to use "=" in a query (... query=dc.title=musik ...) the guidelines recommend replacing the second "=" by "%3D" (... query=dc.title%3Dmusik ...) and replacing special characters (e. g. diacritical marks with UTF-8 hexadecimal) in the search key (Standard).
Spaces e.g. before and after Boolean operators should be replaced by %20 (... SW%3DKRAFTWERK%20not%20SW%3DROBOTER ...), depending on client.

Number of data records returned per request

Standard (default): 10 data records per response
Maximum: 100 data records per reply if ...&maximumRecords=100 specified (possible values 1 to 100)
Call of further data records: ...&startRecord=101 (possible values 1 to 99,000)

Frequently asked questions (FAQ)

What is the difference between SRU and OAI?

SRU enables you to conduct purposeful research without having your own database.
OAI facilitates the constant synchronisation of large data sets; for this, a current set of basic data stock must be imported into your own database.

Where can I get programmes/software which enable me to use SRU?

The SRU website of the Library of Congress provides a corresponding overview of software for use with SRU.

What are the SRU interface's server name, host name, port and data base designation?

address or name of data source: e.g. https://services.dnb.de/sru or DNB-catalogue (in most cases you are free to choose the designation in this field)
server name/host name/computer: services.dnb.de
port: 443 (HTTPS-Protokoll)
data base designation/path: sru/dnb or sru/zdb or sru/authorities etc.
format/syntax: MARC 21/USMARC
coding: UTF-8 (decomposed)

What happens if a parameter in the URL request is incorrect or not supported?

The SRU interface delivers an error diagnosis in XML (diagnostic) depending on the standard.

Example:

<diagnostics>
<diag:diagnostic xmlns:diag="http://www.loc.gov/zing/srw/diagnostic/">
<diag:uri>info:srw/diagnostic/1/8</diag:uri>
<diag:details>Unsupported parameter</diag:details>
<diag:message>[quer]</diag:message>
</diag:diagnostic>
</diagnostics>

What happens if a request is entered without specifying an index?

If no index is entered in the SRU request, the request is forwarded to the most extensive index in the catalogue selected (fallback).

How are diacritical marks, spaces and slash marks encoded in a request?

In an SRU request, these have to be converted into URL code (UTF-8 hexadecimal, also known as percent encoding). Examples: the letter ä is converted to %C3%A4, a space to %20 and a slash to %2F. Search terms can be enclosed in quotation marks (“search term”). If a search term contains the signs < > = / ( ) or spaces, these must be enclosed by quotation marks (for example the library code "1w/r" in URL code: "1w%2Fr") (see Standard).

How are markup characters transported in an SRU response?

Markup characters (<, > and &) in an SRU response are transported in a CDATA section.

What happens in the case of a request for which no matching data exists?

The SRU interface responds with “number of records 0”.

Further processing

If you are just getting started with processing metadata, useful programmes include MarcEdit, MARC Specialized Tools, the software suite Catmandu, OpenRefine or Metafacture, while data can be analysed with "Konstanz Information Miner" (KNIME) or the Metadata Quality Assurance Framework. A more detailed overview is provided in the presentation slides "Open Source Software zur Verarbeitung und Analyse von Metadaten" (available only in German) and the article "Survey of Tools for Linked Data Consumption".

How can I get important information, e.g. about changes and disruptions at the SRU interface?

We suggest you sign up to the SRU interface mailing list to make sure you receive timely information about changes, new developments, disruptions and maintenance work.

Contact

schnittstellen-service@dnb.de

News

Last changes: 24.04.2023
Short-URL: https://www.dnb.de/EN/sru
Contact: schnittstellen-service@dnb.de

to the top