Skip to content

Instantly share code, notes, and snippets.

@terrywbrady
Created December 2, 2016 21:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save terrywbrady/86c5690fa1828c6914deb5efc5210340 to your computer and use it in GitHub Desktop.
Save terrywbrady/86c5690fa1828c6914deb5efc5210340 to your computer and use it in GitHub Desktop.
function isbnLookup(id) {
var url = "https://www.googleapis.com/books/v1/volumes?country=US&q=isbn:"+id;
var options = {contentType : "application/json"};
var resp = UrlFetchApp.fetch(url, options);
if (resp == null || resp == "") return "N/A";
var respdata = JSON.parse(resp.getContentText());
if (respdata["items"].length == 0) return "Not found";
return respdata["items"][0]["volumeInfo"]["title"];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment