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 replace /search
with /search.json
.
-
http://openlibrary.org/search.json?q=the+lord+of+the+rings
-
http://openlibrary.org/search.json?title=the+lord+of+the+rings
-
http://openlibrary.org/search.json?author=tolkien
- http://openlibrary.org/search.json?q=the+lord+of+the+rings&page=2
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",
"lordofrings00tolk_3",
"lordofrings00tolk_2",
"lordofrings00tolk",
"twotowersbeingse1970tolk",
"lordofring00tolk",
"lordofrings56tolk",
"lordofringstolk00tolk",
"fellowshipofring00tolk_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/schema.xml
The schema is not guaranteed to be stable, but most common fields (e.g. title, IA ids, etc) should be safe to depend on.
The special text
field is a composite of the strings in many other fields (edition titles, subtitles, subjects, ISBNs, etc) which is used for the current "All" search mode. This, in particular, is very likely to change in the future.
History
- Created 2013年2月27日
- 3 revisions
2020年3月12日 | Edited by Tom Morris | Add info on the Solr document schema |
2016年4月1日 | Edited by Charles Horn | correct urls and update returned json examples |
2013年2月27日 | Created by Anand Chitipothu | documented search API. |