You’ll be pleased to know PHP is a better choice than javascript in this case because you can’t know what filters or security the client has going to prevent access to third party sites.
Is the URL for the image static? Will it never change over time? Then it’s best to grab the value when saving the post and insert the img tag with the URL directly into the post content. Otherwise, my initial suggestion to inject it into the content on each request would have to suffice. (And probably introduces a huge performance hit to load many images)
Finding a hook that fires only when the post is first created and not subsequently is a bit tricky. ‘save_post’ will fire on any update as well as the initial save, so is unsuitable. One needs to experiment with the various parameters passed to the ‘transition_post_status’ action to find which variable action fired in the wp_transition_post_status() function will work. IIRC, that would be the action ‘draft_to_publish’. (You should verify this for yourself.) This action fires for every new post published, so your callback function must first check the post type is correct for inserting cover images. The current post object is passed to your hook callback for your use.
At this point, all the post data has been saved, but I’m not sure about post meta, which is where the ISBN gets saved. If it has been saved, use get_post_meta(). If not, it should still be in $_POST. You’ll need to examine a var_dump() of it to determine the proper key name. Get the ISBN value and append it to your API query string.
Then how to query another site for the image URL. This depends on your server configuration, some methods are not always available. If available, I like using cURL. There is also HTTP and failing that, fsock. Plenty of generic examples on using these transports can be found online.
To interpret the JSON response, use json_decode(). Do a var_dump() of the returned array to figure out how to extract the URL you’re looking for. Then insert the HTML img tag with the src URL in front of the content (or where ever you want it to appear) and update the post data before returning.
This entire process can be done from within your action hook into ‘draft_to_publish’ or whatever it is, just be sure to do some error handling in case of connection issues with an external site.
I’ve obviously left out many details, but this will get you going in the right direction at least. Good luck!