Pulling API into Excel spreadsheet

Sort:
Tricky_Dicky

I have tried a few different ways, such as using tables, which is cumbersome, but this is simple and works pretty well. Can't take too much credit. Like most things these days looked it up using Google search and adapted what I found.

 

Set up_http as a string of your API address to pull and you get back the data string of the endpoint which you can then interrogate for your required data. In theory the string returned is subject to a character limit but haven't hit that yet so will deal with it if and when.

 

Public Function get_data_string(byref up_http as Sting) As String

Dim xmlhttp
Set xmlhttp = CreateObject("msxml2.xmlhttp.6.0")

With xmlhttp
     .Open "get", up_http, False
     .send
     get_data_string = .responseText
End With

Set xmlhttp = Nothing

End Function