Example Webservice / API call- Yahoo Query Language with AutoHotkey

Rest API Robot FrameworkWhite sticker on computer 4
While we touched on this API in our API Webinar, I wanted to review a bit more and demonstrate the Yahoo Console which can greatly aide you in developing your API calls. ¬†Below is the code I demonstrate in the video. ¬†The Yahoo API is pretty straight-forward and, for many calls, you don’t need a secure Token or ID!

queryString:=QueryString_Builder({"q":"select * from local.search where zip='75019' and query='hot dogs'","format":"json"})
;~  MsgBox % queryString

;***********API call*******************
HTTP := ComObjCreate("WinHttp.WinHttpRequest.5.1")
HTTP.Open("GET", EndPoint . queryString) ;GET or POST most common; Uppercase matters!
SciTE_Output(Response_Data) ;Text,Clear=1,LineBreak=1,Exit=0
;~  SciTE_Output(sXML_Pretty(Response_data,"   ")) ;Text,Clear=1,LineBreak=1,Exit=0

for key, value in kvp
  queryString.=((A_Index="1")?(url "?"):("&")) key "=" value
return queryString

Black Bottle2Video demonstrating Example API call to Yahoo


Comments are closed.