The Editions API serves to get information pertaining to a specific edition of a work.
For more usage examples of this API, see EditionAPIExamples.
Get a populated instance of OLEdition using OpenLibraryClient and a valid edition's ID (be aware this will make multiple requests):
OpenLibraryClient client = new OpenLibraryClient();
OLEdition edition = await client.GetEditionAsync("OL7826547M");
You can get editions by OLID, ISBN, OCLC or LCCN.
// These are all logically equivalent, though some might populate more of
// edition's fields than others, depending on the data returned by OpenLibrary
OLEdition edition = await client.GetEditionAsync("OL7826547M", BookIdType.OLID);
OLEdition edition = await client.GetEditionAsync("OL7826547M", BookIdType.ISBN);
OLEdition edition = await client.GetEditionAsync("551650731", BookIdType.OCLC);
OLEdition edition = await client.GetEditionAsync("95043936", BookIdType.LCCN);
If you specify either S(mall), M(edium) or L(arge) as optional parameter, GetEditionAsync will also load the cover in the respective size.
OLEdition edition = await client.GetEditionAsync("95043936", BookIdType.LCCN, "s");
Alternatively, you can make individual requests using the OpenLibraryClient
OLEditionData editionData = await client.Edition.GetDataAsync("95043936", BookIdType.LCCN);
byte[] coverSmall = await client.Image.GetCoverAsync("LCCN", "95043936", "s");
or using the static OLEditionLoader class.
HttpClient httpClient = new HttpClient();
OLEditionData editionData = await OLEditionLoader.GetDataAsync(httpClient, "95043936", BookIdType.LCCN);
byte[] coverSmall = await OLImageLoader.GetCoverAsync(httpClient, "LCCN", "95043936", "s");
If the GetCoverAsync call is not clear to you, see the Covers API.
In addition to its data, you can also get an edition's viewapi:
OLViewAPIData viewAPI = await client.Edition.GetViewAPIAsync(httpClient, "OL7826547M", BookIdType.LCCN);
// To get a more detailed response
OLViewAPIData viewAPI = await client.Edition.GetViewAPIAsync(httpClient, "OL7826547M", details: true, BookIdType.LCCN);