dwyl / dwyl/reading-tracker

Open Library (Internet Archive) Books API

Open
#9 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
HTML
Stars
3
Forks
1
PR merge metrics
No merged PRs in 30d

Description

When researching which Book database to use for adding books to our app, we were reminded of https://openlibrary.org
via: https://news.ycombinator.com/item?id=25405737

hadn't used Open Library in a while so revived my account and and attempted to go through the UX.
IMO, the search functionality is not very good ... or at least the sorting is not intuitive. 🔍

For example, if I visit amazon.com and start typing the name of Seth Godin's latest book "The Practice" I get an autosuggestion/autocompletion:
![image](https://user-images.githubusercontent.com/194400/103489305-8e10bb00-4e0b-11eb-945c-25864a083a5b.png)

> This is the benchmark for Product search. Intuitive and returns the most relevant result immediately.

The book was released on Nov 3rd 2020 (2 months ago today).
https://www.amazon.com/Practice-Shipping-Creative-Work/dp/0593328973
![image](https://user-images.githubusercontent.com/194400/103489424-5f471480-4e0c-11eb-9ff7-4d2045d4e53d.png)

It was a best seller and has several hundred reviews on Amazon:
![image](https://user-images.githubusercontent.com/194400/103489751-7555d480-4e0e-11eb-8ee8-0380e2ad54fa.png)

If I attempt to search for "The Practice" on OpenLibrary and sort by newest, the results are useless:
https://openlibrary.org/search?q=the+practice&mode=everything&sort=new
![open-library-search-for-the-practice](https://user-images.githubusercontent.com/194400/103489396-30c93980-4e0c-11eb-849a-0eb79115093d.png)

> **Note**: without the sorting, the results are just as useless; I just thought that sorting would help, it didn't.
> Instead we get an _irrelevant_ article published in **2104** (_83 years in the future!_)

If we type the name of the book _and_ the name of the author a result is found:
https://openlibrary.org/search?q=the+practice+seth+godin&mode=everything

The page for the book itself is underwhelming: https://openlibrary.org/works/OL21094745W/The_Practice
![image](https://user-images.githubusercontent.com/194400/103490786-1a27e000-4e16-11eb-8f1e-c351270bdb4c.png)

**1 five star rating** but we cannot view it. 🤷

# Code

The code for the site is Open Source (obviously): https://github.com/internetarchive/openlibrary
![image](https://user-images.githubusercontent.com/194400/103489696-1abc7880-4e0e-11eb-8276-50fa1a195ef8.png)

It's Python but doesn't appear to use Django or other recognisable framework according to [`setup.py`](https://github.com/internetarchive/openlibrary/blob/2ba6765c99c5f7d54b40821ee73feadffa2f5b0c/setup.py) or [`requirements.txt`](https://github.com/internetarchive/openlibrary/blob/2ba6765c99c5f7d54b40821ee73feadffa2f5b0c/requirements.txt) ...
but it appears to use Vue.js, Core.js, JQuery and Chart.js according to the [`package.json`](https://github.com/internetarchive/openlibrary/blob/2ba6765c99c5f7d54b40821ee73feadffa2f5b0c/package.json#L61)
Not much info on BuiltWith, sadly ... https://builtwith.com/detailed/openlibrary.org NGinx and Google Analytics. 🤷

The search appears to be using [Lucene](https://en.wikipedia.org/wiki/Apache_Lucene) from this dependency:
https://github.com/internetarchive/openlibrary/blob/2ba6765c99c5f7d54b40821ee73feadffa2f5b0c/package.json#L51

# API

The main API we're interested in is the Books one: https://openlibrary.org/dev/docs/api/books

If we attempt to view the aforementioned book via the API: https://openlibrary.org/books/OL29509316M.json

![image](https://user-images.githubusercontent.com/194400/103538261-cce75500-4e8d-11eb-9049-8737ec320b13.png)

> **Note**: Firefox automatically displays JSON content formatted. Use Firefox, it's _better_! 😉 > Get it: [mozilla.org/firefox](https://www.mozilla.org/en-US/firefox/new/)

```
curl 'https://openlibrary.org/books/OL29509316M.json'
```

We get the following result:

```json
{
"publishers":[
"Penguin Books, Limited"
],
"languages":[
{
"key":"/languages/eng"
}
],
"source_records":[
"bwb:9780241470046"
],
"title":"Practice",
"number_of_pages":208,
"last_modified":{
"type":"/type/datetime",
"value":"2020-09-16T05:01:18.543431"
},
"created":{
"type":"/type/datetime",
"value":"2020-08-26T13:56:48.732622"
},
"isbn_13":[
"9780241470046"
],
"full_title":"Practice",
"lc_classifications":[
"",
"HF5386"
],
"publish_date":"2020",
"key":"/books/OL29509316M",
"authors":[
{
"key":"/authors/OL6847264A"
}
],
"latest_revision":2,
"works":[
{
"key":"/works/OL21094745W"
}
],
"type":{
"key":"/type/edition"
},
"revision":2
}
```

This is kinda useless as it lists the **`full_title`** as "Practice" which it is not.
Rather the **full title** is "***The Practice: Shipping Creative Work***"

Given that Open Library can be edited by anyone, I updated the record:
![image](https://user-images.githubusercontent.com/194400/103541711-bc39dd80-4e93-11eb-8d70-e350c3ebb5d8.png)

But I don't see _other_ people doing this ... _most_ people just _consume_ Wiki content, they don't _create/improve_ it.
So I think our _primary_ search still needs to be the Google Books API https://github.com/dwyl/library/issues/1

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.