How can I use javascript to send an api request

I used the following articles to do exactly this to be able to search the Library API for songs in Poop Simulator, using an external proxy hosted on Google servers for free (up to 10K daily hits):