my $BingKey="xxxxxxxxxxx";#This is my personal Microsoft API key my $MyBingJsonQuery=" My two Key words"; my $href= 'https://api.cognitive.microsoft.com/bing/v5.0/search[?'. "$MyBingJsonQuery". ']'; my $ua= LWP::UserAgent->new(keep_alive); $ua->credentials("api.cognitive.microsoft.com".':443', '', '', $BingKey); my $req = HTTP::Request->new(GET => $href); my $res = $ua->request($req); # Check the outcome of the response if ($res->is_success) { #DO SOMETHING }