API

v1.17.0 Check our open bugs or report a new issue (requires GitHub login). See all our open issues on GitHub.

All endpoints use GET and support queries using the id, name, q (query all fields, supports elasticsearch query string syntax), and format parameters. Result formats short, ids, and full return JSON; use format=negotiate (or none), and set an accept header for different RDF formats, see details below. The short result format supports an optional modifier to specify the field to use for collecting the values. The syntax is short.field, see this sample request. All queries can be filtered by type using the type parameter, see this sample request (pass multiple comma-separated types for OR query). Note that you have to encode the # as %23 (the hash is interpreted as a local anchor by the browser, and not sent to the server).

Parameters →
↓ Endpoint
id name q format Info
/resource hbz ID, ISBN, URN /resource?name=Faust /resource?q=Suhrkamp source, short, ids, full, negotiate (default) Title data
(lobid-resources)
/item item?id=BT000000079:DE-Sol1:GA+644 /item?name=GA+644 /item?q="DE-5-4" short, ids, full, negotiate (default) Inventory data
(lobid-resources)
/organisation /organisation?id=DE-605 /organisation?name=Universität /organisation?q=Einrichtung+ohne+Bestand short, ids, full, negotiate (default) Authority data
(lobid-organisations)
/person /person?id=118580604 /person?name=Johann+Sebastian+Bach /person?q="Bruder+von" short, ids, full, negotiate (default) Authority data
(GND)
/subject /subject?id=1706733-9 /subject?name=Heinsberg /subject?q=de short, ids, full, negotiate (default) Authority data
(GND)
/search /search?id=HT002189125&format=full /search?name=Basel&format=full /search?q=Wittenberg&format=full short, ids, full (default) Search all
(nested JSON result)

The /resource endpoint supports a few additional parameters (can be combined with each other and the other parameters above):

Parameters →
↓ Endpoint
author subject set owner sort Info
/resource 118580604 (GND ID)
Abramson (GND label)
4414195-6 (GND ID)
Chemie (Dewey label)
NWBib DE-5,DE-6
(comma separated values for OR boolean search)
newest, oldest Title data
(lobid-resources)

Pagination and Limits and Bulk Downloads

All endpoints support pagination via from and size parameters specifying the index to start the result set from (default is 0, must be >= 0), and the size of the result set (default is 50, must be <= 100). Sample request: /organisation?name=Universität&from=10&size=5&format=ids.
However, if you want to receive all hits or get loads of data it is way faster and more coherent to use the boolean scroll parameter. You may even give a 8 digit date to get only the metadata of resources that changed (created or modificated) since this time. Sample request:

curl --header "Accept: application/ld+json" --header "Accept-Encoding: gzip" "http://lobid.org/resource?set=nwbib&scroll=20150301"

Note that the format parameter doesn't work when scrolling. Note also to request gzip compression to speed up getting loads of data.

Content Negotiation

To return different RDF serializations as the result format (default is JSON-LD), you can specify an accept header, e.g. for N-Triples:

curl -L --header "Accept: text/plain" http://lobid.org/resource?id=HT002189125

Currently supported: JSON_LD [application/json, application/ld+json], RDF_A [text/html, text/xml, application/xml], RDF_XML [application/rdf+xml], N_TRIPLE [text/plain], N3 [text/rdf+n3, text/n3], TURTLE [application/x-turtle, text/turtle]

Sample usage: auto suggest

For /person

Type any person data to get suggestions (uses the name query parameter). Upon selecting a suggestion, the corresponding value will be inserted (here: the ID). Search will return details on the selected person.

This calls the /person endpoint with the format=ids parameter to get the suggestions. The actual search uses the id parameter with the inserted value. See the implementation using JavaScript and jQuery UI on the right and the source of this page.

The sample on the right gets the autocomplete data from a remote URL (i.e. a different server from the one that serves the HTML) by using JSONP (use full URL in your code, i.e. http://lobid.org/person for the url attribute).

                
    $('input.search-person').each(function() {
        var $input = $(this);
        $input.autocomplete({
            source : function(request, response) {
                $.ajax({
                    url : "/person",
                    dataType : "jsonp",
                    data : {
                        name : request.term,
                        format : "ids"
                    },
                    success : function(data) {
                        response(data);
                    }
                });
            }
        });
    });

            

For /subject

Type any subject data to get suggestions (uses the name query parameter). Upon selecting a suggestion, the corresponding value will be inserted (here: the ID). Search will return details on the selected subject.

This calls the /subject endpoint with the format=ids parameter to get the suggestions. The actual search uses the id parameter with the inserted value. See the implementation using JavaScript and jQuery UI on the right and the source of this page.

The sample on the right gets the autocomplete data from a remote URL (i.e. a different server from the one that serves the HTML) by using JSONP (use full URL in your code, i.e. http://lobid.org/subject for the url attribute).

                
    $('input.search-subject').each(function() {
        var $input = $(this);
        $input.autocomplete({
            source : function(request, response) {
                $.ajax({
                    url : "/subject",
                    dataType : "jsonp",
                    data : {
                        name : request.term,
                        format : "ids"
                    },
                    success : function(data) {
                        response(data);
                    }
                });
            }
        });
    });

            

For /resource

Type any resource data to get suggestions (uses the name query parameter). Upon selecting a suggestion, the corresponding value will be inserted (here: the name). Search will return details on the selected resource.

This calls the /resource endpoint with the format=short parameter to get the suggestions. The actual search uses the name parameter with the inserted value. See the implementation using JavaScript and jQuery UI on the right and the source of this page.

The sample on the right gets the autocomplete data from a remote URL (i.e. a different server from the one that serves the HTML) by using JSONP (use full URL in your code, i.e. http://lobid.org/resource for the url attribute).

                
    $('input.search-resource').each(function() {
        var $input = $(this);
        $input.autocomplete({
            source : function(request, response) {
                $.ajax({
                    url : "/resource",
                    dataType : "jsonp",
                    data : {
                        name : request.term,
                        format : "short"
                    },
                    success : function(data) {
                        response(data);
                    }
                });
            }
        });
    });

            

For /organisation

Type any organisation data to get suggestions (uses the name query parameter). Upon selecting a suggestion, the corresponding value will be inserted (here: the ID). Search will return details on the selected organisation.

This calls the /organisation endpoint with the format=ids parameter to get the suggestions. The actual search uses the id parameter with the inserted value. See the implementation using JavaScript and jQuery UI on the right and the source of this page.

The sample on the right gets the autocomplete data from a remote URL (i.e. a different server from the one that serves the HTML) by using JSONP (use full URL in your code, i.e. http://lobid.org/organisation for the url attribute).

                
    $('input.search-organisation').each(function() {
        var $input = $(this);
        $input.autocomplete({
            source : function(request, response) {
                $.ajax({
                    url : "/organisation",
                    dataType : "jsonp",
                    data : {
                        name : request.term,
                        format : "ids"
                    },
                    success : function(data) {
                        response(data);
                    }
                });
            }
        });
    });