New to Atom - can I call a REST API and get response?

I’m looking to call GitHub’s API and parse the results. I can run this code successfully in Coda or even in a CMS :

<script>

	// Create a new request object
	var request = new XMLHttpRequest();
	
	//set the callback function
	request.onload = parseResponse;

	// Initialize a request
	request.open('get', 'https://api.github.com/repos/prebid/prebid-server/contents/adapters?ref=master')
	// Send it
	request.send()


function parseResponse() {
  
	console.log(this.responseText);
  
}

</script>

but it doesn’t seem to work in Atom.