The Open Library Books API provides a programmatic client-side method for querying information of books using Javascript.
This API is inspired by the Google Books Dynamic links API and is compatible with it.
API
The API allows requesting information on one or more books using ISBNs, OLCC Numbers, LCCNs and OLIDs (Open Library IDs).
At the core of the API is a URL format that allows developers to construct URLs requesting information on one or more books and send the requests to the Open Library using the <script>
tag.
<script src="http://openlibrary.org/api/books?bibkeys=ISBN:0451526538&callback=mycallback"></script>
Request Format
The URL expects query parameter bibkeys
a list of comma separated books IDs and optional callback
.
An optional parameter details=true
can be passed to get additional details about the books.
The Books API supports ISBNs, LCCNs, OCLC numbers and OLIDs (Open Library IDs).
ISBN
Ex. &bibkeys=ISBN:0451526538 (The API supports both ISBN 10 and 13.)
OCLC
&bibkeys=OCLC:#########
LCCN
&bibkeys=LCCN:#########
Optional Parameters:
callback:
Name of the JavaScript function to call with the result.
Response Format
The response from this call will be information about the requested books returned as one or more JSON objects. Each JSON object will have the following fields.
bib_key
Identifier used to query this book.
info_url
A URL to the book page in the Open Library.
preview
Preview state - either "noview" or "full".
preview_url
A URL to the preview of the book. This is provided only when the fulltext of the book is available.
thumbnail_url
A URL to a thumbnail of the cover of the book. This is provided only when thumbnail is available.
details
Details about the book. This is provided only if parameter details=true
is passed in the request.
Example:
Request:
http://openlibrary.org/api/books?bibkeys=ISBN:0201558025,ISBN:0931137071,LCCN:93005405,ISBN:invalid,&callback=processOLBooks
Response:
ProcessOLBooks({
"ISBN:0931137071": {
"bib_key": "ISBN:0931137071",
"preview": "noview",
"thumbnail_url": "http:\/\/covers.openlibrary.org\/b\/olid\/OL2724920M-S.jpg",
"preview_url": "http:\/\/openlibrary.org\/b\/OL2724920M",
"info_url": "http:\/\/openlibrary.org\/b\/OL2724920M"
},
"LCCN:93005405": {
"bib_key": "LCCN:93005405",
"preview": "noview",
"thumbnail_url": "http:\/\/covers.openlibrary.org\/b\/olid\/OL1397864M-S.jpg",
"preview_url": "http:\/\/openlibrary.org\/b\/OL1397864M",
"info_url": "http:\/\/openlibrary.org\/b\/OL1397864M"
},
"ISBN:0201558025": {
"bib_key": "ISBN:0201558025",
"preview": "noview",
"thumbnail_url": "http:\/\/covers.openlibrary.org\/b\/olid\/OL1429049M-S.jpg",
"preview_url": "http:\/\/openlibrary.org\/b\/OL1429049M",
"info_url": "http:\/\/openlibrary.org\/b\/OL1429049M"
}
});
When optional parameter details=true
is passed in the request, details of each book are also provided in the response.
Request:
http://openlibrary.org/api/books?bibkeys=ISBN:0201558025,LCCN:93005405&callback=processOLBooks&details=true
Response:
processOLBooks({
"LCCN:93005405": {
"info_url": "http:\/\/openlibrary.org\/b\/OL1397864M",
"bib_key": "LCCN:93005405",
"preview_url": "http:\/\/openlibrary.org\/b\/OL1397864M",
"thumbnail_url": "http:\/\/covers.openlibrary.org\/b\/olid\/OL1397864M-S.jpg",
"details": {
"by_statement": "adapted and illustrated by Tsai Chih Chung ; translated by Brian Bruya.",
"title": "Zen speaks",
"publisher": [],
"key": "\/b\/OL1397864M",
"authors": [
{
"name": "Zhizhong Cai",
"key": "\/a\/OL223368A"
}
]
},
"preview": "noview"
},
"ISBN:0201558025": {
"info_url": "http:\/\/openlibrary.org\/b\/OL1429049M",
"bib_key": "ISBN:0201558025",
"preview_url": "http:\/\/openlibrary.org\/b\/OL1429049M",
"thumbnail_url": "http:\/\/covers.openlibrary.org\/b\/olid\/OL1429049M-S.jpg",
"details": {
"by_statement": "Ronald L. Graham, Donald E. Knuth, Oren Patashnik.",
"title": "Concrete mathematics",
"publisher": [],
"key": "\/b\/OL1429049M",
"authors": [
{
"name": "Ronald L. Graham",
"key": "\/a\/OL720958A"
}
]
},
"preview": "noview"
}
});
Examples
History
- Created October 27, 2008
- 24 revisions
November 27, 2023 | Edited by Mek | Edited without comment. |
November 27, 2023 | Edited by Mek | Edited without comment. |
January 26, 2023 | Edited by raybb | add info about ratings and bookshelves |
January 6, 2023 | Edited by AgentSapphire | Example url was a redirect. |
October 27, 2008 | Created by Anand Chitipothu | OL Books API |