Open Library
Connecting & Authenticating
ServiceConnect["OpenLibrary"] creates a connection to the Open Library API. If a previously saved connection can be found, it will be used; otherwise, a new authentication request will be launched.
Requests
ServiceExecute["OpenLibrary","request",params] sends a request to the Open Library API, using parameters params. The following give possible requests.
Search Books
"BookSearch" — search books by title or author
| "Query" | None | query string | |
| "Author" | None | author name | |
| "Title" | None | book title | |
| "Subject" | None | subject | |
| MaxItems | 100 | maximum number of items returned | |
| "StartIndex" | 0 | start index |
Book Information
"BookSummary" — information about a single book edition
"BookInformation" — information about readable versions of a single book edition
| "BibKeys" | (required) | key(s) identifying specific book edition(s) | |
| "ShowThumbnails" | False | whether to include cover thumbnail in results |
"BookText" — full text of a book
| "BibKeys" | (required) | key(s) identifying specific book edition(s) |
Examples
Basic Examples (1)
Create a new connection to Open Library:
openlibrary = ServiceConnect["OpenLibrary"]resultsByAuthor = openlibrary["BookSearch", <|"Author" -> "Kurt Vonnegut", MaxItems -> 20, "StartIndex" -> 5|>]Analyze data from search results:
Tally@DeleteMissing@Flatten[Normal@resultsByAuthor[All, "Language"]]DateListPlot[Tally@DeleteMissing@resultsByAuthor[[All, "FirstPublishYear"]], Joined -> False, Filling -> Bottom]Get information on a specific edition of a book:
openlibrary["BookInformation", {"BibKeys" -> { "OLID", "OL12580254M" }, "ShowThumbnails" -> True}]openlibrary["BookSummary", {"BibKeys" -> {"OLID", "OL13996678M"}, "ShowThumbnails" -> True}]text = openlibrary["BookText", {"BibKeys" -> {{"OLID", "OL13996678M"}}}];StringTake[text[1], {2285, 3063}]See Also
ServiceExecute ▪ ServiceConnect ▪ WikipediaSearch ▪ WikipediaData