lobid-client
Installation
Using npm
npm install lobid-client
Using yarn
yarn add lobid-client
Import
Using esm
syntax:
;// or;
Using commonjs
syntax:
const LobidClient = ;// orconst searchGnd = ;
Usage
The search is asynchronous and returns a Promise. You can await it in an asynchronous function or resolve it yourself.
Basic usage
Depending on how you imported the function you can use:
LobidClient;//or;
Default Parameters
If not specified otherwise, the searchGnd
function will always use the following query parameters:
size=100
- Return 100 itemsformat=json
- Return JSON data
Using async/await
{ const result = await LobidClient;}
Resolving yourself
LobidClient console; ;
Using Parameters
You can pass in additional query options by passing in a queryOptions
object.
The following example matches all GND entries with Twain in the field preferredName
and where the matched entries match the type Person
.
const queryOptions = field: 'preferredName' filter: type: 'Person' ;
The queryOptions are handled using the following interface:
Example for utilizing all available queryOptions.
; const queryOptions = field: 'preferredName' filter: type: 'Person' 'gender.label': 'Unbekannt' size: 50 from: 2 format: 'json' formatFields: 'preferredName' 'professionOrOccupation'; console; ;