garethbjohnson / gutendex

Web API for Project Gutenberg ebook metadata
https://gutendex.com
MIT License
231 stars 46 forks source link

Recent Book #20

Closed Willypen closed 2 years ago

Willypen commented 2 years ago

It will be nice if the API can call Recently added. The latest new and updated eBooks.

Thanks in advance & for this great project.

garethbjohnson commented 2 years ago

Hello, I don't know how to get recently updated books (except by downloading the full contents of every book everyday and comparing each to the last downloaded version, which I don't want to do, because it takes a lot of time and space).

However, I could add an option to sort by descending ID. Since newer books seem to get larger IDs, I would expect that to show the most recently added ones first. Would that help?

Willypen commented 2 years ago

Yeah, I think that is a good idea! Thanks!

garethbjohnson commented 2 years ago

OK, I added a sort parameter. /books/?sort=descending should do it now. Let me know if you have any issues.

Willypen commented 2 years ago

Thanks for adding the new parameter!, but I noticed something, I do not know if to open a new issue or not. Looks like the new parameter /books/?sort=descending is not getting the book covers and download count.

Example: https://www.gutenberg.org/ebooks/67200 in the API those not get the image

Thanks!

garethbjohnson commented 2 years ago

Yes, unfortunately, this is a limitation of the approach that the Project Gutenberg website asks people to take: its downloadable catalog data, which Gutendex uses, seems to be missing some cover images and download counts that appear on Project Gutenberg.

However, for cover images, you might have success with this URL format:

https://www.gutenberg.org/cache/epub/<id>/pg<id>.cover.<small|medium|large>.jpg

Example: https://www.gutenberg.org/cache/epub/67200/pg67200.cover.medium.jpg

Willypen commented 2 years ago

Thanks!