title: Unable to pull data from an API http://www.infogroup.com/ - Code is showing some errors
body: <p>I am trying to pull the data for around 1000 companies using this API <a href="http://www.infogroup.com/" rel="nofollow">http://www.infogroup.com/</a> which uses GET and POST query, GET url has the following format [<a href="https://api.infoconnect.com/v1/companies?apikey=4iRztNp5euNzjK3i69xlnpIMa3K6AZCv&amp;companyname=ambarella&amp;resourcetype=enhanced]][1]" rel="nofollow">https://api.infoconnect.com/v1/companies?apikey=4iRztNp5euNzjK3i69xlnpIMa3K6AZCv&amp;companyname=ambarella&amp;resourcetype=enhanced]][1]</a></p>
  
  <p>I am using VB in excel to pull data. Following is my code which I am using:</p>
  
  <pre><code>Function Creditrating(CompName As String) As String
  Dim companyname As String
  Dim strQuery As String
  Dim CreditRatingScore   As String
  companyname = URLEncode(CompName)
  'Assemble the query string
  strQuery = "http://api.infoconnect.com/v1/companies?apikey=4iRztNp5euNzjK3i69xlnpIMa3K6AZCv"
  strQuery = strQuery &amp; "&amp;companyname=" &amp; companyname
  strQuery = strQuery &amp; "&amp;resourcetype=enhanced"
  
  'define XML and HTTP components
  Dim googleResult As New MSXML2.DOMDocument
  Dim googleService As New MSXML2.XMLHTTP
  Dim oNodes As MSXML2.IXMLDOMNodeList
  Dim oNode As MSXML2.IXMLDOMNode
  
  'create HTTP request to query URL - make sure to have
  'that last "False" there for synchronous operation
  
  googleService.Open "GET", strQuery, False
  googleService.send
  googleResult.LoadXML (googleService.responseText)
  
  Set oNodes = googleResult.getElementsByTagName("CreditRatingScore")
  
  If oNodes.Length = 1 Then
  For Each oNode In oNodes
    CreditRatingScore = oNode.ChildNodes(0).ChildNodes(0).Text
  Next oNode
  Else
  CreditRatingScore = "NF"
  End If
  
  Creditrating = CreditRatingScore
  
  End Function
  
  
  Public Function URLEncode(StringVal As String, Optional SpaceAsPlus As Boolean   = False) As String
  Dim StringLen As Long: StringLen = Len(StringVal)
  
  If StringLen &gt; 0 Then
  ReDim result(StringLen) As String
  Dim i As Long, CharCode As Integer
  Dim Char As String, Space As String
  
  If SpaceAsPlus Then Space = "+" Else Space = "%20"
  
  For i = 1 To StringLen
    Char = Mid$(StringVal, i, 1)
    CharCode = Asc(Char)
  
    Select Case CharCode
    Case 97 To 122, 65 To 90, 48 To 57, 45, 46, 95, 126
      result(i) = Char
    Case 32
      result(i) = Space
    Case 0 To 15
      result(i) = "%0" &amp; Hex(CharCode)
    Case Else
      result(i) = "%" &amp; Hex(CharCode)
    End Select
  Next i
  URLEncode = Join(result, "")
  End If
  End Function
  </code></pre>
  
  <p>The code is working fine for google APIs but is not working for infogroup API.
  Please help</p>