Workflow: Get ESV Bible Verse

One common challenge I run into while taking notes during regular Bible reading is writing down the text of a verse or short passage that was meaningful to me. I usually like to jot down the actual text in Day One and write a few notes about what “stood out” during my reading – but because I prefer to read from a physical Bible, the tedious part is typing out the words.

An API For the Bible

I recently came across an article from Chris Bowler about the ESV API, and I was somewhat thrilled to discover that Crossway actually has a fully-functional REST API for the ESV Bible. Last weekend I spent an hour or so reading over their documentation, and I even created an account, mulling over the possibilities of using the API for various needs. One morning a few days ago, I realized I could use the ESV API to help with noting down verses that stand out during my daily Bible reading.

A New Workflow

I did a bit of research first to see if anyone had ever used a REST API in Workflow, and it appears that it’s actually quite common. Armed with a few examples, I built a new workflow from scratch while on my lunch break. Here’s the general plan I followed:

  1. Get the input text. I’m assuming the input is some sort of Bible reference.
  2. URL Encode the input text so we can put it in the query string of our API call
  3. Build a URL that includes the query, along with a few default parameters
  4. Use a GET call to query the API, passing my Authorization token in the Headers as described in the API docs.
  5. From the output of the call, get a “Dictionary” value called passages which contains the verse text.
  6. Copy the resulting text to the clipboard.

This workflow allows me to use the “share” action on a selected Bible reference (e.g. “Matthew 6:5-8”) and run my Get ESV Bible Verse workflow. Then, all I have to do is paste, and the actual text from my clipboard replaces the original reference.

Here’s a quick screencast of the workflow in action using the Notes app:

If you’re interested, feel free to download the workflow and try it out!