The AuthorAPI deals with everything related to Author pages on Open Library that begin with the URL prefix /authors
.
In these docs you will find all the methods of the Author
struct. To populate the struct you must first call GetAuthor
.
If you are looking to get the Author from a work or edition, head out to that API's documentation i.e (docs/WorkAPI.md
or docs/BookAPI.md
etc.)
The fields can be found here
Author satisfy these interfaces:
- HasCovers
- IKeyAuthors
Here are some examples of how you could use the AuthorAPI.
author := gol.GetAuthor("OL236174A") // Get the Author Richard Dawkins
// Output:
// Author
works := author.Works() // Get the Works of the author
// Output:
// []Works
// Get the Author's Photo
cover := author.Cover("L") // Alternatively: Cover(author, size)
// Output:
// url to the cover