internetarchive / internetarchive/openlibrary

Books API: Promote original work description to each edition

Open
#1,816 9 comments 1 reaction 0 assignees View on GitHub
Affects: Data Editions Lead: @mekarpeles Priority: 3 Theme: Public APIs Type: Feature Request
Dominant language
Python
Stars
6.7k
Forks
2k
Avg merge
2d 19h
Merged PRs (30d)
138

Description

## Description
I'm building a mobile app that allows people to scan ISBNs and get some info on the book that they've scanned. However, I'm not sure I can always get the description, particularly when the scanned ISBN is for an edition that "inherits" the description from the original work.

## Evidence

I have ISBN: 9780091953638
For that, I can get data via:
- [The API, using `jscmd=data`](https://openlibrary.org/api/books?bibkeys=ISBN:9780091953638&jscmd=data&format=json)
- [The JSON API, just appending `.json` to the normal book URL](https://openlibrary.org/books/OL26095592M.json)

However, none of the above see to return the "parent" OLID, or some way to get to https://openlibrary.org/works/OL17507444W.json, which is the data for the ["parent object"](https://openlibrary.org/works/OL17507444W/Expatriots).

Admitedly, I can get the "works" array [if I use `jscmd=details`](https://openlibrary.org/api/books?bibkeys=OLID:OL26095592M&jscmd=details&format=json) but [according to the docs](https://openlibrary.org/dev/docs/api/books), it's unrecommended/deprecated, and I'm not comfortable with using it in the app in that case.

## Expectation
I expected more control over the available fields to be retrieved through the Books API. At the very least, the description field should always be available when `jscmd=data`, if it exists on either the specific edition or the parent work.

## Proposal & Constraints

Adding the description field as described shouldn't break any existing integrations of the API.
For the long run, some control over the granularity of the returned data would be nice. I'd imagine something like:

```
https://openlibrary.org/api/books
?bibkeys=ISBN:9780091953638
&fields=author,cover,description,... // This can be an enum field documented in the API docs
&format=json
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.