Skip to content

OPDS search in a library

GET
/opds/v2/libraries/{libraryId}/search
curl --request GET \
--url 'http://localhost:8080/opds/v2/libraries/1/search?query=example' \
--header 'Authorization: Bearer <token>'

Searches one library. The library’s feed links here with a search link templated as {?query}.

libraryId
required
integer format: int64
query
required
string
>= 1 characters <= 200 characters

What to search for, up to 200 characters.

cursor
string

Opaque cursor from the previous page’s nextCursor.

An OPDS 2 publications feed of matches, best first.

Media typeapplication/opds+json

An OPDS 2 feed or publication, defined by the OPDS 2 schemas rather than here. Publication metadata follows the Readium Web Publication model.

object
metadata
object
links
Array<object>
object

Example generated

{
"metadata": {},
"links": [
{}
]
}

The request was malformed.

Media typeapplication/json
object
code
required
string
Allowed values: bad_request unauthorized forbidden not_found unavailable scan_in_progress content_changed already_set_up name_taken last_admin progress_conflict too_many_attempts not_linked identity_taken last_sign_in provider_unavailable too_many_sign_ins repository_exists repository_not_allowed repository_unreadable repository_needs_token repository_needs_password repository_needs_credentials repository_credentials_refused extension_invalid source_failed source_unavailable source_check_failed internal
message
required

Explains the problem to a developer.

string

Example

{
"code": "bad_request"
}

No valid credentials. The Basic challenge and the Authentication for OPDS document both ask for a name and password.

Media typeapplication/opds-authentication+json

An Authentication for OPDS document offering HTTP Basic sign-in.

object
id
required
string format: uri
title
required
string
authentication
required
Array<object>
object
type
required
string
labels
object
login
string
password
string

Example

{
"authentication": [
{
"type": "http://opds-spec.org/auth/basic"
}
]
}
WWW-Authenticate
string
Example
Basic realm="Chek", charset="UTF-8"
Link
string
Example
<https://chek.example/opds/v2/auth>; rel="http://opds-spec.org/auth/document"; type="application/opds-authentication+json"

The resource does not exist.

Media typeapplication/json
object
code
required
string
Allowed values: bad_request unauthorized forbidden not_found unavailable scan_in_progress content_changed already_set_up name_taken last_admin progress_conflict too_many_attempts not_linked identity_taken last_sign_in provider_unavailable too_many_sign_ins repository_exists repository_not_allowed repository_unreadable repository_needs_token repository_needs_password repository_needs_credentials repository_credentials_refused extension_invalid source_failed source_unavailable source_check_failed internal
message
required

Explains the problem to a developer.

string

Example

{
"code": "bad_request"
}

The server failed; details are in its log.

Media typeapplication/json
object
code
required
string
Allowed values: bad_request unauthorized forbidden not_found unavailable scan_in_progress content_changed already_set_up name_taken last_admin progress_conflict too_many_attempts not_linked identity_taken last_sign_in provider_unavailable too_many_sign_ins repository_exists repository_not_allowed repository_unreadable repository_needs_token repository_needs_password repository_needs_credentials repository_credentials_refused extension_invalid source_failed source_unavailable source_check_failed internal
message
required

Explains the problem to a developer.

string

Example

{
"code": "bad_request"
}