| 0 |
## Searching for Authors |
0 |
## Searching for Authors |
| ... |
|
... |
|
| 5 |
|
5 |
|
| 6 |
``` |
6 |
<pre> |
| 7 |
{ |
7 |
{ |
| 8 |
numFound: 1, |
8 |
numFound: 1, |
| 9 |
start: 0, |
9 |
start: 0, |
| 10 |
numFoundExact: true, |
10 |
numFoundExact: true, |
| 11 |
docs: [ |
11 |
docs: [ |
| ... |
|
... |
|
| 25 |
} |
25 |
} |
| 26 |
``` |
26 |
</pre> |
| 27 |
|
27 |
|
| ... |
|
... |
|
| 33 |
|
33 |
|
|
|
34 |
### Batch Requests |
|
|
35 |
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)`. <a href="https://openlibrary.org/search/authors?q=key%3A(%2Fauthors%2FOL3874685A+OR+%2Fauthors%2FOL1394244A)">Example search</a> and <a href="https://openlibrary.org/search/authors.json?q=key%3A(%2Fauthors%2FOL3874685A+OR+%2Fauthors%2FOL1394244A)">example API call</a>. |
|
|
36 |
|
|
|
37 |
## Works by an Author |
|
|
38 |
|
|
|
39 |
https://openlibrary.org/authors/OL23919A/works.json |
|
|
40 |
|
|
|
41 |
The above URL will return 50 works by an author. |
|
|
42 |
|
|
|
43 |
You can append `?limit=1000` to return the first 1000 works by an author like so: |
|
|
44 |
https://openlibrary.org/authors/OL1394244A/works.json?limit=100 |
|
|
45 |
|
|
|
46 |
If you want to paginate, you can set offset like so: |
|
|
47 |
https://openlibrary.org/authors/OL1394244A/works.json?offset=50 |
|
|
48 |
|
|
|
49 |
|
| 34 |
## Gotchas |
50 |
## Gotchas |
| 35 |
|
51 |
|
| 36 |
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. |
52 |
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. |
|