【问题标题】:How can i remake the return from Google search api?我怎样才能从谷歌搜索 api 重新获得回报?
【发布时间】:2012-01-05 06:00:20
【问题描述】:

我如何使用 Google 搜索 api 在 google 引擎、网站标题、简短描述和 URL 上获得喜欢。可能吗? 我尝试了 api,但它只给了我一些没有网址或网站标题的信息。

【问题讨论】:

    标签: api web


    【解决方案1】:

    使用 Google 购物 API,您可以检索标题、简短描述和网址。我在一个 c# 应用程序中实现了这一点,它从下面的 url 返回一个 json 文件并对其进行解析。

    您需要一个apiId 才能开始。

    使用这个url,你可以在q之后添加搜索参数,在这个例子中只是搜索数码相机。

    https://www.googleapis.com/shopping/search/v1/public/products?key=key&country=US&q=digital+camera
    

    http://code.google.com/apis/shopping/search/v1/getting_started.html 更多详情

    【讨论】:

    • 我会试试的,我还有另一个idee,我昨晚开始工作了,比google api更好。我用于搜索的 url 是 ajax[dot]googleapis[dot]com/ajax/services/search 但知道当我运行它给我的脚本时: object(stdClass)#23 (3) { ["responseData"]=> NULL ["responseDetails"]=> string(65 ) "配额超出。请参阅code.google.com/apis/websearch" ["responseStatus"]=> int(403) } object 。我正在考虑将推荐人发送给 google,但我会尝试 googleapis.com/shopping,我会返回答案。谢谢。
    • code.google.com/apis/websearch 已弃用,因此这可能是您无法使用它的原因,并且仅限于一些回复,“Google Web Search API 已于 11 月 1 日正式弃用, 2010"
    【解决方案2】:

    我不确定我是否有足够的信息,但我发现 Google 自定义搜索 API 参考页面有参考 JSON/ATOM 示例:
    https://code.google.com/apis/customsearch/v1/reference.html

    此查询将帮助您入门:
    https://www.googleapis.com/customsearch/v1?key={YOURAPIKEY}&cx={cx?}&cref={cref?}&q=st%20olaf

    这能让你开始吗?

    保重! 速度

    【讨论】:

    • 我在发布问题之前已经看过它,谷歌返回的结果限制是 10。例如,如果我搜索 php 手册,它只会给我这个:Php Manual 2011 和更多这样,没有网址,没有描述,没有网站的标题。也许我不知道t use it how it needs,but this is what i am getting and it doesnt 帮了我很多
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-09-25
    • 2013-11-09
    • 1970-01-01
    • 2017-08-12
    • 2011-06-04
    相关资源
    最近更新 更多