questo codice mi fallisce sempre:

codice:
if ($query && $www) {

  $q = urldecode($query);
  //if ($www != "true") { $q.= " site:$yourWebsite"; }
  if(!$start) { $start=0; } else { $start = intval($start); }

  $parameters = array( 
    "key"         => $yourGoogleKey,   // google developer key
    "q"           => $q,               // search query
    "start"       => $start,           // result start index
    "maxResults"  => 10,               // 10 is the maximum
    "filter"      => false,            // filtering similar entries
    "restrict"    => "",               // country and topic restrictions
    "safeSearch"  => false,            // adult content filter
    "lr"          => "",               // language restrictions
    "ie"          => "",               // deprecated and ignored parameter
    "oe"          => ""                // deprecated and ignored parameter
  );

PRINT_R($parameters);

  $soapclient = new soapclient("http://api.google.com/search/beta2");
  $result = $soapclient->call("doGoogleSearch", $parameters, "urn:GoogleSearch");
  $begin = $start + 1;
  $end = $start + $parameters["maxResults"];
  $total = $result["estimatedTotalResultsCount"];

PRINT_R($result );
}
... dicendomi chiave non valida la chiave l'ho presa dal sito di google non mi ha datto nessun errore sto testando in localhost
e quando ho preso la chiave ho selezionato come opzine (application)