Shortcuts Workflow for Extracting Read Books from Goodreads

Edit: I’ve updated the workflow because I realised there was an actual book links field that I could use instead of trying to extract the book ID to build the link.

I also realise that my workflow was built using iOS 13’s Shortcuts app, so a lot of people won’t be able to use it. I will build one using iOS 12 asap and will post a link to that as soon as that’s done.

Lastly, you might find that the workflow doesn’t populate some start/finish dates. This is not an error with the workflow, instead, it seems that Goodreads doesn’t provide the dates for some of the books. The date fields are just missing, I’m not sure why. I’ve tried re-adding the dates on some of my books but they still don’t show up, although the modify dates changed, so I know something has been recorded. I will keep looking into this and will report back if I find anything.

So I forgot where I’d read it, but I saw that some people were creating a “read/reading” page1; listing all the books they’ve read/reading this year.

I’ve also created my own page, but – being the nerd that I am – I decided to create a Shortcuts workflow to help me create and maintain this list.

I use Goodreads to keep track of my books and I thought I would use Goodreads’ API to help gather the books I’ve read/currently reading, and create a markdown list with all the pertinent information (ie. title, author, date started, date finished, rating, and whether this is a re-reading of a book).

I can then prepend that list to my previously mentioned page.

I know my workflow is not very polished – my method of processing XML files probably needs work – but for now it does the job.

Installing the workflow

You can download the Shortcuts workflow here.

When you first import the script, it’ll ask you for your Goodreads ID and your API key.

You can find your Goodreads ID by going to your bookshelf after you’ve logged into Goodreads and looking at the URL; it should be the string of numbers and letters between “list/” and “?”.
eg. https://www.goodreads.com/review/list/USERNAME?shelf=read

The workflow would ask that you save your Goodreads ID in a dictionary that the workflow would then refer to.

To get a Goodreads API key, you’d need to register here. It’s free and doesn’t require more than your name and your application name (I just used “Shortcuts”).

I save my API key in a text file in my Shortcuts folder and reference it in the script.

How to use the workflow

Now for how to use the workflow.

When you run it, it’ll ask for which bookshelf you want to list. I’ve put in two options, read and currently-reading. You can add any other bookshelf you currently use.2

Then the script will ask for the number of books you want to list.

When I ran the script the first time, I entered in 200 – I knew I’ve only read about 30 books this year, but I wanted to create pages for previous years as well.

For on going maintenance of my books list, I’d probably run the script once a month and then only need to request info on 1 to 2 books.

The script would then produce a markdown list with the requested books (sorted by read date) and copy them to the clipboard. I would then paste them into my reading page.

Final words

As I’ve mentioned, my workflow is not the most polished, but I hope it helped some people. If you customised it in any quirky way or figured out a more elegant way to deal with XML files, please comment and let me know. I would love to see how people use this.

So if you have a “read/reading page”, please let me know so I can retroactively add links to your page. ↩

Remember that the shelf name uses “-” in place of spaces and is all lower case, ie. Currently Reading is rendered as currently-reading ↩