title: Google Sheets: Parsing JSON results
body: <p>Preface: I'm a complete novice at JS and have tried googling my solution for hours.</p>
  
  <p>I am making an API call to a public endpoint using Google Sheets (within the script editor). Here's my current code:</p>
  
  <pre><code>function getMaterials() {
      var myUrl = "https://api.guildwars2.com/v2/account/materials?access_token=[my_access_token]";
      var jsonData = UrlFetchApp.fetch(myUrl);
      var jsonString = jsonData.getContentText();
      return jsonString;
  }
  </code></pre>
  
  <p>Here's a snippet of what is returned:</p>
  
  <pre><code>[
    {
      "id": 12134,
      "category": 5,
      "count": 14
    },
    {
      "id": 12238,
      "category": 5,
      "count": 0
    },
    {
      "id": 12147,
      "category": 5,
      "count": 6
    },
    {
      "id": 12142,
      "category": 5,
      "count": 12
    },
    {
      "id": 12135,
      "category": 5,
      "count": 0
    },
    {
      "id": 12246,
      "category": 5,
      "count": 1
    }
  ]
  </code></pre>
  
  <p>Here's the documentation to the particular API I'm interacting with:</p>
  
  <p><a href="https://wiki.guildwars2.com/wiki/API:2/account/materials" rel="nofollow noreferrer">https://wiki.guildwars2.com/wiki/API:2/account/materials</a></p>
  
  <p>There's no real way to filter off my call, or I'd be more than happy to use that.</p>
  
  <p>I am looking to query on the "id" value, but return only the "count" value in the same query. I've tried multiple ways from various sites, but can't get anywhere. Help?</p>