Searching for Authors
You can search for authors using the https://openlibrary.org/search/authors.json search API which accepts q
as a query parameter:
https://openlibrary.org/search/authors.json?q=j%20k%20rowling
{ numFound: 1, start: 0, numFoundExact: true, docs: [ { key: "OL23919A", text: [...], type: "author", name: "J. K. Rowling", alternate_names: [...], birth_date: "31 July 1965", top_work: "Harry Potter and the Philosopher's Stone", work_count: 162, top_subjects: [...], _version_: 1702166143068799000 }, ] }
Data on Individual Authors
Once you have the identifier key of an author of interest, e.g. /authors/OL23919A
, you can fetch their complete data by visiting their Author page as .json
, .rdf
, .yml
:
e.g. https://openlibrary.org/authors/OL23919A.json
Batch Requests
Currently, we do not have a way to get the full data for multiple authors in one request. However, you can get a subset (name, subjects, ratings, and more) by using the search API with a query like key:(/authors/OL3874685A OR /authors/OL1394244A)
. Example search and example API call.
Works by an Author
https://openlibrary.org/authors/OL23919A/works.json
The above URL will return 50 works by an author.
You can append ?limit=1000
to return the first 1000 works by an author like so:
https://openlibrary.org/authors/OL1394244A/works.json?limit=100
If you want to paginate, you can set offset like so:
https://openlibrary.org/authors/OL1394244A/works.json?offset=50
Gotchas
Note that by default, navigating to https://openlibrary.org/authors/OL23919A will redirect to https://openlibrary.org/authors/OL23919A/J._K._Rowling (appending the human readable slug "J._K._Rowling"). Adding .json to the end of the slug (e.g. https://openlibrary.org/authors/OL23919A/J._K._Rowling.json) will not work. You must first remove the human readable slug and append .json
directly to the end of the author's key, e.g. https://openlibrary.org/authors/OL23919A.json.
History
- Created June 27, 2021
- 6 revisions
September 3, 2024 | Edited by raybb | add data on batch requests |
August 1, 2021 | Edited by raybb | add pagination and limits |
July 1, 2021 | Edited by Mek | Edited without comment. |
June 27, 2021 | Edited by Mek | Edited without comment. |
June 27, 2021 | Created by Mek | Edited without comment. |