我们如何配置谷歌自定义搜索使用API与PHP


How can we configure Google Custom search using API with PHP

我想使用Google自定义搜索API,我可以知道如何在PHP语言上使用它。例如:-

<?php
 $keyword = "Demo Test" ;
 $URL = "http://www.google.com/search?hl=en&q=demo+test&oq=demo+test&aq=f&aqi=g-s1g5g-v3g-j1&aql=&gs_sm=3&gs_upl=298789l300162l0l300519l9l9l0l0l0l0l274l1243l0.3.3l6l0" ;
 echo "return number of the website position"; // using method...
 ?>

它返回网站的位置编号。以前我们使用作为cURL。由于谷歌cURL封锁,我们无法使用以前的方法进行搜索。

你能给我推荐一种合适的配置方式吗。。

感谢

如果您使用的是GoogleAPI PHP客户端,下面的示例应用程序将帮助您。

http://code.google.com/p/google-api-php-client/source/browse/trunk/examples/customSearch/index.php