| 0 |
The Open Library Books API provides a programmatic client-side method for querying information of books using Javascript. |
0 |
[Developer Center](https://openlibrary.org/developers/api) → [APIs](https://openlibrary.org/dev/docs/api) → Books API |
| 1 |
|
1 |
|
| 2 |
## APIs |
2 |
|
| 3 |
|
3 |
## Book APIs |
| 4 |
Open Library has 3 types of Book APIs. |
4 |
|
| 5 |
|
5 |
Open Library has several APIs for accessing Book data. |
| 6 |
1. The **Works** API (by Work ID) |
6 |
|
| 7 |
2. The **Editions** API (by Edition ID) |
7 |
1. The [**Search** API](https://openlibrary.org/dev/docs/api/search) (preferred, multi) |
| 8 |
3. The **ISBN** API (by ISBN) |
8 |
2. The **Works** API (by Work ID) |
| 9 |
4. The **Books** API (generic) |
9 |
3. The **Editions** API (by Edition ID) |
| 10 |
|
10 |
4. The **ISBN** API (by ISBN) |
| 11 |
## Works & Editions APIs |
11 |
5. The **Books** API (generic) |
|
|
12 |
|
|
|
13 |
## The Book Search API |
|
|
14 |
|
|
|
15 |
If you are looking for a single API to meet all of your book needs, it's likely the [Book Search API](https://openlibrary.org/dev/docs/api/search). |
|
|
16 |
|
|
|
17 |
## Learnings about Works v Editions |
|
|
18 |
|
|
|
19 |
When we [refer to books](https://openlibrary.org/about/lib) on Open Library, we're often referring to a specific work and possibly a specific edition of this work. |
| 12 |
|
20 |
|
| 13 |
A Work is a logical collection of similar Editions. "Fantastic Mr. Fox" could be a Work which contains a Spanish translation edition, or perhaps a 2nd edition which has an additional chapter or corrections. Work metadata will include general umbrella information about a book, whereas an Edition will have a publisher, an ISBN, a book-jacket, and other specific information. |
21 |
A Work is a logical collection of similar Editions. "Fantastic Mr. Fox" could be a Work which contains a Spanish translation edition, or perhaps a 2nd edition which has an additional chapter or corrections. Work metadata will include general umbrella information about a book, whereas an Edition will have a publisher, an ISBN, a book-jacket, and other specific information. |
| 14 |
|
22 |
|
| 15 |
Both Work and Edition pages on Open Library (i.e. the pages you navigate to) may also be returned as json or yml (in addition to HTML) by modifying the page URL. |
23 |
Both Work and Edition pages on Open Library (i.e. the pages you navigate to) may also be returned as json or yml (in addition to HTML) by modifying the page URL. |
| 16 |
|
24 |
|
|
|
25 |
Learn more about the [fields](https://openlibrary.org/about/work_edition) that belong to works and editions. |
|
|
26 |
|
| 17 |
### Works API |
27 |
### Works API |
| 18 |
|
28 |
|
| 19 |
Work pages on Open Library begin with the URL prefix "/works". |
29 |
Work pages on Open Library begin with the URL prefix "/works". |
| 20 |
|
30 |
|
| 21 |
Here is an example: |
31 |
Here is an example: |
| 22 |
https://openlibrary.org/works/OL45883W/Fantastic_Mr._FOX |
32 |
https://openlibrary.org/works/OL45804W/Fantastic_Mr._FOX |
| 23 |
|
33 |
|
| 24 |
In this example, if we remove the /Title from the URL (e.g. https://openlibrary.org/works/OL45883W) and then add a suffix of ".json" or ".yml" to the end, the page will return a data representation instead of HTML, e.g.: |
34 |
In this example, if we remove the /Title from the URL (e.g. https://openlibrary.org/works/OL45804W) and then add a suffix of ".json" or ".yml" to the end, the page will return a data representation instead of HTML, e.g.: |
| 25 |
|
35 |
|
| 26 |
https://openlibrary.org/works/OL45883W.json |
36 |
https://openlibrary.org/works/OL45804W.json |
| 27 |
|
37 |
|
|
|
38 |
#### Fetching a Work's Editions |
|
|
39 |
|
|
|
40 |
You can fetch a work's editions by adding `/editions.json` after the work ID: |
|
|
41 |
|
|
|
42 |
https://openlibrary.org/works/OL45804W/editions.json |
|
|
43 |
|
|
|
44 |
#### Ratings and Bookshelves |
|
|
45 |
|
|
|
46 |
Can be accessed by the following APIs: |
|
|
47 |
https://openlibrary.org/works/OL18020194W/bookshelves.json |
|
|
48 |
https://openlibrary.org/works/OL18020194W/ratings.json |
| 28 |
|
28 |
|
| ... |
|
... |
|
| 35 |
|
35 |
|
| 36 |
In this example, if we remove the /Title from the URL (e.g. https://openlibrary.org/works/OL45883W) and then add a suffix of ".json" or ".yml" to the end, the page will return a data representation instead of HTML, e.g.: |
57 |
In this example, if we remove the /Title from the URL (e.g. https://openlibrary.org/works/OL45804W) and then add a suffix of ".json" or ".yml" to the end, the page will return a data representation instead of HTML, e.g.: |
| 37 |
|
37 |
|
| ... |
|
... |
|
| 53 |
|
53 |
|
| 54 |
## Book API |
75 |
## Legacy Book API |
|
|
76 |
|
|
|
77 |
Please consider using the Book Search API above; this is a legacy endpoint and may be phased out in the future. |
| 55 |
|
55 |
|
| ... |
|
... |
|
| 554 |
Earlier these details were provided when `details=true` parameter is passed. It is equivalent to `jscmd=details` and it is retained only for backward-compataibilty. |
554 |
Earlier these details were provided when `details=true` parameter is passed. It is equivalent to `jscmd=details` and it is retained only for backward-compataibilty. |
|