【发布时间】:2016-05-11 20:31:15
【问题描述】:
直到 2 天前我的代码 100% 工作
<?php
echo file_get_contents('http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=Text');
?>
但现在它只显示
{"responseData": null, "responseDetails": "The Google Web Search API is no longer available. Please migrate to the Google Custom Search API (https://developers.google.com/custom-search/)", "responseStatus": 403}
有人知道获得 10 个搜索结果的好方法吗?
我知道它说它不再可用并显示新 api 的链接 .. 但我找不到新 api 的方式来显示旧 API 的结果,只显示来自您的域的结果 我尝试使用 curl 但它不起作用 谢谢!
【问题讨论】:
-
查看响应详细信息,然后按照建议进行操作。 :D
-
我看到了,哈哈……但我没有找到替换代码的好方法……
标签: php search-engine file-get-contents google-search