This is the API used in the Book Recommendations project by Oslo Public Library.
The reviews in the API are distributed under a Creative Commons license: Navngivelse-DelPåSammeVilkår CC BY-SA 3.0 NO
The API will be expanded as we see fit. Currently only the /reviews
and /works
endpoints are implemented.
The API is open for anyone to use, but a key is required in order to write to the API (i.e perform POST/PUT/DELETE requests). Please get in touch if your library wants to publish to our RDF-store.
https://anbefalinger.deichman.no/api
(fallback: https://marc2rdf.deichman.no/api)
The return format is JSON. All responses from /api/reviews and /api/works now responds to the format:
"works" : [
{ "uri" : "https://example.com/workid",
"originalTitle" : "Title of work",
"prefTitle": "Norwegian title of work",
"authors": [
{
"uri": "https://example.com/authorid",
"name": Author's name",
}
],
"editions": [
{
"uri": "https://example.com/editionid",
"lang": Edition's language",
"title": Edition's title",
"isbn": Edition's isbn",
"cover_url": Edition coverimage",
}
],
...
"reviews" : [
{
"uri": "https://example.com/review_id",
"title": "A Review Title",
"reviewer": {
"uri": "https://example.com/reviewer_id",
"name": "Reviewer's name"
},
"source": {
"name": "Deichmanske Bibliotek",
"uri": "https://data.deichman.no/source/deichmanske_bibliotek"
},
"audience": [
"Voksen"
],
"teaser": "Short teaser to review",
"text": "Full Text of review...",
}
]
}
]
Fetches one or more reviews
- Other parameters will be ignored if
uri
,reviewer
orwork
is present. - The
uri
must refer to a bookreview.uri
can also be an Array of uris reviewer
,work
,author
,reviewer
, andsource
must be a urioffset
andlimit
must be integers.order_by
allows valuesauthor_name
,title
,reviewer
,issued
,modified
,created
order
must bedesc
orasc
.
Examples
http GET https://anbefalinger.deichman.no/api/reviews uri="https://data.deichman.no/bookreviews/deich3456"
http GET https://anbefalinger.deichman.no/api/reviews uri:='["https://data.deichman.no/bookreviews/deich3456",
"https://data.deichman.no/bookreviews/deich3457"]'
http GET https://anbefalinger.deichman.no/api/reviews reviewer="https://data.deichman.no/reviewer/id_0"
http GET https://anbefalinger.deichman.no/api/reviews work="https://data.deichman.no/work/x18370200_snoemannen"
http GET https://anbefalinger.deichman.no/api/reviews limit=20 offset=20 order_by=author_name order=desc
Fetches one or more works, optionally with reviews
- Other parameters will be ignored if
uri
orisbn
is present. - The
uri
must refer to a work id. offset
andlimit
must be integers.order_by
allows valuesauthor_name
,title
,issued
,modified
,created
order
must bedesc
orasc
.
Examples
http GET https://anbefalinger.deichman.no/api/works uri="https://data.deichman.no/work/x18370200_snoemannen" reviews=true
http GET https://anbefalinger.deichman.no/api/works uri:='["https://data.deichman.no/resource/work/x123456",
"https://data.deichman.no/resource/work/x123456"]'
http GET https://anbefalinger.deichman.no/api/works title="Test Title"
http GET https://anbefalinger.deichman.no/api/works author="Jo Nesbø" reviews=true limit=10 order_by=author_name order=desc
Creates a new review
-
Required:
api_key
,isbn
,title
,teaser
,text
-
Optional:
reviewer
,reviewer_name
,audience
allowed audience values are
voksen
,adult
,ungdom
,youth
,children
orbarn
can be multiple separated by either comma, slash or pipe (,/|)reviewer
must be valid e-mail. If e-mail is new, a new user and useraccount will be created. If no reviewer, anonymous will be used. Reviewer's name will be set to e-mail ifreviewer_name
param is not used
Example
http POST https://anbefalinger.deichman.no/api/reviews api_key="dummyapikey" isbn=9788243006218 title="Title of review"
teaser="A brief text for teaser, infoscreens, etc." text="The entire text of review. Lorem ipsum and the glory of utf-8"
reviewer="test@person.com" audience="children"
Updates existing review
-
Required:
api_key
,uri
-
Optional:
title|teaser|text|reviewer|audience
uri
must refer to the URI of an already published review
Deletes a review
- Required:
api_key
,uri
JSON hash result string