title: Using Excel VBA to get stock quotes from Google or Bloomberg thinks I'm a bot
body: <p>I'm trying to create an Excel macro that will get a stock quote from either Google or Bloomberg. Each site seems to detect that I'm not calling from a web browser, and refuses to work. </p>
  
  <p>Here is a simplified version of my code that demonstrates the problem. If you copy and paste the URL value directly into a web browser, it works fine. But if you look at the result returned by my code, it's a message that essentially says, "We think you're not human." Any way around this?</p>
  
  <p>(The Bloomberg version is actually preferable because it returns JSON. The Google version returns HTML that I would have to parse. But at this point I'll take anything.)</p>
  
  <pre><code>Private Sub TestQuote()
      Dim sURL As String
      Dim http As WinHttp.WinHttpRequest
  
      'BLOOMBERG QUERY
      sURL = "https://www.bloomberg.com/markets/api/bulk-time-series/price/MSFT%3AUS?timeFrame=1_DAY"
  
      'GOOGLE QUERY
      'sURL = "https://www.google.com/search?q=MSFT"
  
      Set http = CreateObject("WinHttp.WinHttpRequest.5.1")
      http.Open "GET", sURL, False
      http.send
  
      Debug.Print http.responseText
  End Sub
  </code></pre>