In GAS Rest Library migration, you can see a port of Rest to Excel library from VBA to Google Apps Script. This handles many complex queries and generally can execute them in a few lines of code using the libraries – see Using the mcpher library in your code. GAS is more suited to this kind of work, and it’s kind of suboptimal to do things in a VBA way – unless you are planning to support both platforms with the same apps. 

Here’s a simple GAS restquery without any dependencies. The objective for this example is to use the Wikipedia stats API (stats.grok.api), to concatenate a bunch of queries into a single Google Sheet. 

The grok data looks like this. I chose this since it’s a little funky, in that it uses data values as key names, so we have to do a little bit of unusual coding compared to normal rest query response data.

The results

After creating an empty sheet called ‘grok’, I run the function testGroks() and get this

The code

For more like this, see  From VBA to Google Apps Script . Why not join our forum.