# Simple Bitquery API not working

**URL:** <https://community.bitquery.io/t/simple-bitquery-api-not-working/134>\
**Category:** GraphQL API\
**Tags:** support, closed\
**Created:** [June 9, 2021, 3:45am UTC](https://community.bitquery.io/t/simple-bitquery-api-not-working/134 "2021-06-09T03:45:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cryptophil23](https://avatars.discourse-cdn.com/v4/letter/c/22d042/32.png) [@Cryptophil23](https://community.bitquery.io/u/Cryptophil23)\
**Post date:** [June 9, 2021, 3:45am UTC](https://community.bitquery.io/t/simple-bitquery-api-not-working/134/1 "2021-06-09T03:45:58Z")

</div>

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.

```auto
<!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>

```

---

<div class="post-metadata">

**Author:** ![gaurav](https://avatars.discourse-cdn.com/v4/letter/g/b487fb/32.png) [@gaurav](https://community.bitquery.io/u/gaurav)\
**Post date:** [June 9, 2021, 4:18am UTC](https://community.bitquery.io/t/simple-bitquery-api-not-working/134/2 "2021-06-09T04:18:44Z")

</div>

For me, it’s saying UrlFetchApp not defined.

---

<div class="post-metadata">

**Author:** ![sayon](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@sayon](https://community.bitquery.io/u/sayon)\
**Post date:** [July 30, 2021, 9:42am UTC](https://community.bitquery.io/t/simple-bitquery-api-not-working/134/3 "2021-07-30T09:42:00Z")

</div>

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.
