Google Books API

Google released an API for their Book Search at the end of last week. You can implement this in two ways: static (just linking to a URL with a ISBN inserted) or dynamic, which basically means using javascript, which will check to see if Google have the book available as the page loads and can show a link accordingly.

The (very rough and basic) ‘catalogue’ I recently created already had a link to Google Books for each item. This was just a very simple URL with an ISBN stuck on the end, e.g.

Tonight I have made the first steps in adding links to items using the Google Books API using both the static (simple) and dynamic methods.

You can see an example here

You can also do a search via

The layout is currently very rough, and the dynamic search is broken in that it will only show a result for the first ISBN for a given item (I know why but don’t have time to fix now).

I have to confess I know very little javascript. The examples from Google only use a few lines of code but not really understanding what it did, did not help. For example, for the dyanmic display, I found it did not work at all, until I added a second paragraph tag for every ISBN. I can’t see what in the js makes this so :(