Using the Hypothes.is API in a Google Apps Script

I've started using the Hypothes.is annotation tool more lately, mostly at the behest of Kris Shaffer. He started writing about it's potential for public discourse on research back in April and has since created Pypothesis to turn his annotations into a blog post using Python and the Hypothes.is API.

The API is pretty simple - it can take a call for various requests (username, annotation, etc) and return information to use within your app. Kris used Python to create a Markdown page to post on a GitHub-based blog. Coming from K12 land, I see Google Docs serving as the larger research-curation hub and I figured, why not turn this into a simple Google Apps Script?

So I did.

It's nothing fancy, but it works. It's nice that the API is so straightforward...Kris mentions how easy it is to jump into if you've got even a little experience with scripting. The hardest part, in the Google Script world, was interacting with the JSON. But, I managed to get that worked out.

As you can see, this will search for annotations under my username. There are other parameters you can use in a search, including multiple at a time. Read more about those in the docs. Also, John Stewart has a much more thoroughly developed Google Spreadsheet which takes multiple search terms and returns results from an API call. Very cool application to play with.

Leave a Reply

Your email address will not be published. Required fields are marked *