It looks like you're offline.
Open Library logo
additional options menu
Last edited by Drini
January 20, 2023 | History

Open Library Search API

Open Library provides an experimental API to search.

WARNING: This is an experimental API and can change in future.

URL format

The URL format for API is simple. Take the search URL and add .json to the end. Eg:

URL Parameters

Parameter Description
q The solr query. See Search HowTo for sample queries
fields The fields to get back from solr. Use the special value * to get all fields (although be prepared for a very large response!).
To fetch availability data from archive.org, add the special value, availability. Example: /search.json?q=harry%20potter&fields=*,availability&limit=1. This will fetch the availability data of the first item in the `ia` field.
sort You can sort the results by various facets such as "old", "new", or "random". For a complete list of sorts facets look here (this link goes to a specific commit, be sure to look at the latest one for changes).

Response Format

The response with be of the following format.

{
    "start": 0,
    "num_found": 629,
    "docs": [
        {...},
        {...},
        ...
        {...}]
}

Each document specified listed in "docs" will be of the following format:

{
    "cover_i": 258027,
    "has_fulltext": true,
    "edition_count": 120,
    "title": "The Lord of the Rings",
    "author_name": [
        "J. R. R. Tolkien"
    ],
    "first_publish_year": 1954,
    "key": "OL27448W",
    "ia": [
        "returnofking00tolk_1",
        "lordofrings00tolk_1",
        "lordofrings00tolk_0",
    ],
    "author_key": [
        "OL26320A"
    ],
    "public_scan_b": true
}

The fields in the doc are described by Solr schema which can be found here:
https://github.com/internetarchive/openlibrary/blob/master/conf/solr/conf/managed-schema#L136-L216

The schema is not guaranteed to be stable, but most common fields (e.g. title, IA ids, etc) should be safe to depend on.

History

August 10, 2024 Edited by Drini Fix some formatting issues
November 30, 2023 Edited by Drini Update code links
November 30, 2023 Edited by Drini Fix html
November 30, 2023 Edited by Drini Add more parameters to url params table
February 27, 2013 Created by Anand Chitipothu documented search API.