标签: google-custom-search

现在有哪些替代方案已经弃用了Google网络搜索API?

Google Web Search API已弃用,已替换为自定义搜索API(请参阅http://code.google.com/apis/websearch/).

我想搜索整个网络,但看起来新API只能搜索自定义网站.

有没有办法以编程方式搜索整个网络?我能够使用Java程序中的JSON查询旧API.

google-api deprecated google-search google-custom-search

312
推荐指数
6
解决办法
17万
查看次数

使用自定义搜索以Python编程方式在Google中搜索谷歌

我有一段使用pygoogle python模块的代码,它允许我以编程方式在google中搜索某些术语:

 g = pygoogle(search_term)
 g.pages = 1
 results = g.get_urls()[0:10]
Run Code Online (Sandbox Code Playgroud)

我发现不幸的是,这已经停止了,取而代之的是谷歌自定义搜索.我查看了SO上的其他相关问题,但没有发现任何我可以使用的问题.我有两个问题:

1)谷歌自定义搜索是否允许我完成我在上面三行中所做的事情?

2)如果是 - 我在哪里可以找到示例代码来完成我上面所做的事情?如果没有,那么使用pygoogle做什么是替代方案?

python google-custom-search

43
推荐指数
3
解决办法
4万
查看次数

Google自定义搜索排序日期范围标准不起作用

在Google自定义搜索中,我们在sort参数中传递日期范围条件

http://www.example.com/search?cx=xxxxxxxxxxxxxxxxxxxxx:yyyyyy_yyyyy&q=google&sort=date:r:20160304:20160505.
https://developers.google.com/custom-search/docs/structured_search#restrict_to_range
Run Code Online (Sandbox Code Playgroud)

但是我们没有按照日期范围标准获得预期结果.调试代码后,即使我们将sort参数传递给我们的搜索页面网址,也不会将sort参数传递给自定义搜索网址.

Google自定义搜索网址:

https://cse.google.com/cse?q=google&r=m&cx=xxxxxxxxxxxxxxxxxxxxx:yyyyyy_yyyyy&fexp=20606&client=google-coop&hl=en&type=0&oe=UTF-8&ie=UTF-8&format=p4&ad=p4&nocache=1081472127237880&num=0&output=uds_ads_only&source=gcsc&v=3&allwcallad=1&adext=as1%2Csr1%2Cctc1&bsl=10&u_his=50&u_tz=330&dt=1472127237882&u_w=1366&u_h=768&biw=1349&bih=233&psw=1349&psh=233&frm=0&uio=uv3st16sd13sv13lhsl1sr1cc1-&jsv=14100&rurl=http%3A%2F%2Fwww.example.com%2Fsearch%3Fcx%xxxxxxxxxxxxxxxxxxxx_yyyyy%26q%3Dgoogle%26sort%3Ddate%253Ar%253A20160304%253A20160505
Run Code Online (Sandbox Code Playgroud)

但是当我们尝试使用排序日期范围参数访问直接API时,我们得到了预期的结果.

https://www.googleapis.com/customsearch/v1?q=google&cx=xxxxxxxxxxxxxxxxxxxxx:yyyyyy_yyyyy&sort=date%3Ar%3A20160701%3A20160724&key=<APIKEY>
Run Code Online (Sandbox Code Playgroud)

我们正在使用Google自定义搜索V2实施.

谢谢,Anup

javascript api search google-custom-search

29
推荐指数
1
解决办法
772
查看次数

如何从Google自定义搜索中搜索整个网络?

我可以使用Google自定义搜索在网上搜索吗?因为在http://www.google.com/cse中,我必须在"要搜索的网站"中输入网站网址; 我没有任何网址!因为互联网没有任何网址!(我认为!)

你能帮助我吗?

google-custom-search

19
推荐指数
1
解决办法
1万
查看次数

Google Custom Search API - 反向图片搜索

我有一些我缺少信息的图像集合.我希望能够进行谷歌反向图像搜索,以查找名称,关键字,类似图像的链接等.我知道抓取搜索结果页面是针对服务条款,并得到使用自定义的建议搜索API是正确的方法,但我没有在详细说明反向图像搜索的文档中找到任何内容.如果可以使用API​​,是否有人能够指出我正确的方向,或者验证它是否实际上是受支持的?

非常感激!

google-custom-search

19
推荐指数
1
解决办法
3370
查看次数

Google自定义搜索的替代方案

我在客户端网站上使用Google自定义搜索.对于在自己网站上出现赞助商链接的竞争对手公司,他们并不高兴.我知道我们可以使用Google Site Search,但需要支付年费.我一直在寻找谷歌CSE的免费/ OpenSource替代品,但发现我可以使用的很少.有人有什么建议吗?

google-custom-search

17
推荐指数
2
解决办法
2万
查看次数

如何将PHP客户端用于Google自定义搜索引擎

我觉得这对我来说是一个愚蠢的错误,但我无法弄清楚如何使用google-api-php-client进行简单的搜索.我的目标是针对我的网站针对谷歌搜索引擎运行简单的关键字查询.

我已经创建了我的api密钥,一个谷歌搜索引擎并下载了api客户端的版本,但是php客户端的google网站似乎没有任何关于如何使用客户端的文档和我唯一的相关示例到目前为止发现了专门搜索谷歌的图书服务.问题是该示例意味着不同的搜索服务具有不同的搜索结果类型,我找不到任何关于如何从a检索结果的文档Google_Service.

我想我可以设置这样的简单搜索,但我不知道如何实际检索结果.

include_once __DIR__ . '/vendor/autoload.php';
...
public function __construct($searchTerm) {
    $client = new Google_Client();
    $client->setApplicationName("My_First_Search");
    $client->setDeveloperKey(self::GCSE_API_KEY);
    $service = new Google_Service($client);
    $optParams = array('filter' => $searchTerm);
    $results = $service->???
Run Code Online (Sandbox Code Playgroud)

文档必须在那里,但它不在任何明显的地方....

更新(1/14/17):

(更新1/21/17:实际上,这些文档对我没什么帮助,但我会把它们留给我们)

我使用phpdoc为google生成api文档apiclient.我做了一个回购,把phpdoc和libary放在github上.该phpdocs是可浏览这里.

所以希望这会对某人有所帮助.不幸的是,即使使用文档,我也无法解开正确的用法.我还没有为google apiclient-services软件包生成文档,因为它们很大,但我可以在必要时这样做(取决于github页面上的磁盘限制).

php api client-library google-custom-search

15
推荐指数
2
解决办法
7150
查看次数

带自定义搜索框和按钮的Google自定义搜索?

我正在尝试进行谷歌自定义搜索(我只需要在我的网站上使用某种搜索引擎),我需要制作它以便我可以使用自己的搜索框(输入字段).我需要它的大小.我还需要能够自己创建按钮进行搜索.我将需要能够更改搜索按钮的大小和背景.我还不完全确定,但我可能真的需要它成为一个普通的img.

有谁知道如何做到这一点?

如果你不能用Google做到这一点,你知道另一种方法吗?

如果除了使用自己的搜索引擎之外没有别的办法,我可以获得一个关于如何创建自己的简化教程的链接.我愿意投入额外的工作来学习,但我尝试了一下,在看了三个不同的啧啧之后,我放弃了,因为它们非常漫长而令人困惑.我希望我只是在错误的地方寻找.

input google-search google-custom-search

14
推荐指数
2
解决办法
3万
查看次数

ModuleNotFoundError:没有名为“ google.appengine”的模块

我想在Windows上的python3中进行Google搜索。谷歌的说明说,他们支持python3并键入“ gcloud topic init”以获取详细信息-但这未能说明没有python2.7的解释器。我是否必须安装python2.7才能了解如何使其在python3上正常工作?

在python3上,我收到如下错误消息。我已经设置了API密钥和自定义搜索引擎。我做了“ pip install google-api-python-client”。我下载并运行了GoogleCloudSDKInstaller。这是错误:

from googleapiclient.discovery import build
service = build("customsearch", "v1", developerKey="xxxxxx")
Run Code Online (Sandbox Code Playgroud)

我得到:

[googleapiclient.discovery_cache:WARNING]:file_cache is unavailable when using oauth2client >= 4.0.0 or google-auth (__init__.py:44, time=Apr-07 17:25) Traceback (most recent call last):   File "C:\Users\simon\Anaconda3\lib\site-packages\googleapiclient\discovery_cache\__init__.py", line 36, in autodetect
    from google.appengine.api import memcache ModuleNotFoundError: No module named 'google.appengine'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):   File "C:\Users\simon\Anaconda3\lib\site-packages\googleapiclient\discovery_cache\file_cache.py", line 33, in <module>
    from oauth2client.contrib.locked_file import LockedFile ModuleNotFoundError: No module named 'oauth2client' …
Run Code Online (Sandbox Code Playgroud)

python google-app-engine google-search-api python-3.x google-custom-search

13
推荐指数
1
解决办法
2100
查看次数

谷歌customsearch返回不同的结果?

我正在尝试google customsearch api来搜索图片,但奇怪的是我通过api搜索返回的结果与通过浏览器的常规搜索不同.例如

from apiclient.discovery import build
import pprint
import sys
api_key='xxxxxxx'
service = build('customsearch', 'v1', developerKey=api_key)
request=service.cse()
query=request.list(cx='xxxx:xxxxx',q='dogs and cats',searchType='image',imgType='photo')
result=query.execute()
pprint.pprint(result)
for i in result.get('items',[]):
    print (i['link'])
Run Code Online (Sandbox Code Playgroud)

运行此代码会产生完全不同的结果,这是运行上面代码的结果

https://s.yimg.com/ny/api/res/1.2/tarWzt2ZXfPOEg8oQVlOWw--/YXBwaWQ9aGlnaGxhbmRlcjtzbT0xO3c9ODAw/http://media.zenfs.com/en-US/homerun/people_218/4d82a5fa19dd37247717704975fdf602
https://www.google.com/about/main/machine-learning-qa/img/cat-dog-flow-horizontal.gif
https://www.google.com/trends/2014/static/images/pets-snapshot-reveal-1920.jpg
https://www.google.com/trends/2014/static/images/pets-share.png
https://www.google.com/about/main/machine-learning-qa/img/cat-dog-flow-vertical.gif
https://s.yimg.com/uu/api/res/1.2/YQWuQgTnzQuwXjYzX.QrWg--~B/aD0xMzMzO3c9MjAwMDtzbT0xO2FwcGlkPXl0YWNoeW9u/http://media.zenfs.com/en-US/homerun/people_218/4d82a5fa19dd37247717704975fdf602
https://www.google.com/trends/2014/static/images/pets-video-1080.jpg
https://www.google.com/trends/2014/static/images/pets-video-320.jpg
https://www.google.com/maps/d/thumbnail?mid=1hO0YkGLATyy-ZI9JxX1lbv-wK1M&hl=en_US
Run Code Online (Sandbox Code Playgroud)

这是Chrome浏览器的谷歌搜索快照 在此输入图像描述 查询相同,有谁知道为什么?

python search google-api python-3.x google-custom-search

12
推荐指数
3
解决办法
813
查看次数