Hi, basically what you want is a JavaScript code that would send a request to some web API and receive a JSON response.
First I'm not sure if your sites already use some JavaScript library, for example jQuery, in case they do then note that there are quite a lot of samples showing how to do accomplish this [
^].
Now in case you are looking for a plain JavaScript solution (without any additional libraries) then you would need something like
this.