openBD (https://openbd.jp/)
前置き
ここで言及するのは日本の書籍情報を取得できる API であるところの openBD です。JAVAのライブラリの方ではありません。
とりあえず
書籍「いかにして問題をとくか」をISBNで取得する。
スクリプト
function clickGet(){ genRequest( uri, function(resp){ var output_area = document.getElementById("output"); output_area.value = JSON.stringify(resp); }); } function genRequest( uri, callback){ var xhr = new XMLHttpRequest(); xhr.onreadystatechange = function(){ if (this.readyState==4 && this.status==200) { callback(this.response); } }; xhr.responseType = 'json'; xhr.open('GET',uri,true); xhr.send(); } var uri = "https://api.openbd.jp/v1/get?isbn=4621045938?pretty";