I´me using GAPI (Google Analytics PHP Interface) to get the most searched keywords in my website. This code works ok
$ga->requestReportData(id, array('searchKeyword'), array('searchUniques'),array('-searchUniques'),null,null,null,1,12 );
foreach($ga->getResults() as $result)
{
echo ' '. $result .' '.$result->getSearchUniques().'<br/> ' ;
}
But I would like the output to be written on a file....