Source: site.view [edit]
Function name: bingImageSearch
Arguments: query
Description: Find links to webpages matching 'query'
Page type: webl
Render function:  
Module: global

Page source:

var P = GetURL("https://api.cognitive.microsoft.com/bing/v7.0/images/search",   [. q=query,  .], 
              [. "Ocp-Apim-Subscription-Key"="7f8fb108bc644c0cb1d3b21cd1d1846b" .] );

var res = [];

every e in Elem(P, "value") do
   var wres = [. .];
   var v = Elem(P, "contentUrl") inside e;
   wres.url := Str_Trim(Text(v[0])) ? "";
   v = Elem(P, "width") inside e;
   wres.width := Str_Trim(Text(v[0])) ? "0";
   v = Elem(P, "height") inside e;
   wres.height := Str_Trim(Text(v[0])) ? "0";
   v = Elem(P, "thumbnailUrl") inside e;
   wres.thumbnail := Str_Trim(Text(v[0])) ? "";
   v = Elem(P, "hostPageUrl") inside e;
   wres.hostPage := Str_Trim(Text(v[0])) ? "";
   v = Elem(P, "contentSize") inside e;
   wres.contentSize := Str_Trim(Text(v[0])) ? "";
   v = Elem(P, "datePublished") inside e;
   wres.datePublished := Str_Trim(Text(v[0])) ? "";
   v = Elem(P, "name") inside e;
   wres.text := Str_Trim(Text(v[0])) ? "";
   v = Elem(P, "encodingFormat") inside e;
   wres.encodingFormat := Str_Trim(Text(v[0])) ? "";
   res = res + [wres]
end;

res;