Simple Bitquery API not working

This file does not appear to return/display data on my page. I do have my API key in here, but removed it for example.

<!doctype html>
<html>
<head>
<meta charset="utf-8">
	<title>Bitquery</title>
    <meta name="description" content="Bitquery" />
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1" /></head>

    <body>
	<h2><a href="/">Back to Home</a></h2>
	<h2>Bitquery Examples</h2>
	
  <h2>Simple Bitquery API in App Script</h2>
  
  <script>
    
    function GET_TOKEN_TEST(token) {
      const query = `
      query{
      bitcoin{
        blocks{
          count
        }
       }
    }
    `;
    const url = "https://graphql.bitquery.io/";
    const opts = {
        method: "POST",
        headers: {
            "Content-Type": "application/json",
            "X-API-KEY": "myAPIkeyHERE"
        },
        payload: JSON.stringify({
            query
        })
    };
    var response = UrlFetchApp.fetch(url, opts)
    var w = JSON.parse(response.getContentText());
    console.log(w)
    }
</script>
		
</body>
</html>

For me, it’s saying UrlFetchApp not defined.

If you simply want to console.log( ) the response into the browser window, you do not need to make any additional variable for it (here, ‘w’). You can simply make the console log call.
Also, UrlFetchApp is not needed.