Google Customer Search Api

简要描述:

  • Google自定义搜索,为用户提供站内自定义搜索。并提供接口支持,在用户的应用中进行调用,完成站内的搜索过功能。其特点:使用简单,尤其对应用开发人员,无需关心搜索的具体实现。目前Customer Search支持企业级应用,也支持个人应用。

使用步骤:

公开网址方式返回示例

Paste_Image.png

API接口方式返回搜索结果示例

 {
    cursor: {
        currentPageIndex: 0,
        estimatedResultCount: "255",
        moreResultsUrl: "http://www.google.com/cse?oe=utf8&ie=utf8&source=uds&q=123&start=0&cx=016402243527693484754:z8bxbefof6o",
        resultCount: "255",
        searchResultTime: "0.21",
        pages: [
            {
                label: 1,
                start: "0"
            },
            {
                label: 2,
                start: "2"
            },
            {
                label: 3,
                start: "4"
            },
            {
                label: 4,
                start: "6"
            },
            {
                label: 5,
                start: "8"
            },
            {
                label: 6,
                start: "10"
            },
            {
                label: 7,
                start: "12"
            },
            {
                label: 8,
                start: "14"
            },
            {
                label: 9,
                start: "16"
            },
            {
                label: 10,
                start: "18"
            }
        ]
    },
    context: {
        title: "c.mi.com",
        total_results: "64",
        facets: [
            
        ]
    },
    results: [
        {
            GsearchResultClass: "GwebSearch",
            cacheUrl: "http://www.google.com/search?q=cache:Ry2YgNocTkEJ:c.mi.com",
            clicktrackUrl: "https://www.google.com/url?q=http://c.mi.com/in/space-uid-534194697.html&sa=U&ved=0ahUKEwi_6bvGlKTOAhUH_WMKHVA-AxIQFggEMAA&client=internal-uds-cse&usg=AFQjCNGE3VOe4N36-OZxOg-Cw-IXKUigAg",
            content: "Rajesh <b>123</b> Profile ,Mi Community. ... Profile. ID: 534194697. Nickname: Rajesh <b>123</b>. Status: Offline. Gender: Secret. Day of birth: - ...",
            contentNoFormatting: "Rajesh 123 Profile ,Mi Community. ... Profile. ID: 534194697. Nickname: Rajesh 123. Status: Offline. Gender: Secret. Day of birth: - ...",
            formattedUrl: "c.mi.com/in/space-uid-534194697.html",
            title: "Rajesh <b>123</b> Profile - Mi Community",
            titleNoFormatting: "Rajesh 123 Profile - Mi Community",
            unescapedUrl: "http://c.mi.com/in/space-uid-534194697.html",
            url: "http://c.mi.com/in/space-uid-534194697.html",
            visibleUrl: "c.mi.com",
            richSnippet: {
                metatags: {
                    applicationName: "Mi Community",
                    msapplicationTooltip: "Mi Community",
                    msapplicationTask: "name=Forum;action-uri=http://c.mi.com/in/forum.php;icon-uri=http://c.mi.com/in/http://bbs.appmifile.com/in/static/image/common/bbs.ico"
                }
            }
        },
        {
            GsearchResultClass: "GwebSearch",
            cacheUrl: "http://www.google.com/search?q=cache:5s2uT8-PeLYJ:c.mi.com",
            clicktrackUrl: "https://www.google.com/url?q=http://c.mi.com/in/space-uid-1544909598.html&sa=U&ved=0ahUKEwi_6bvGlKTOAhUH_WMKHVA-AxIQFggGMAE&client=internal-uds-cse&usg=AFQjCNFy5-U3EsLYAVTMLO-7iEXMSuHXjg",
            content: "ID: 1544909598. Nickname: Arijit <b>Kundu123</b>. Status: Offline. Real Name: Arijit Kundu. Gender: Male. Education degree: Bachelor. Interests: Playing Pc games.",
            contentNoFormatting: "ID: 1544909598. Nickname: Arijit Kundu123. Status: Offline. Real Name: Arijit Kundu. Gender: Male. Education degree: Bachelor. Interests: Playing Pc games.",
            formattedUrl: "c.mi.com/in/space-uid-1544909598.html",
            title: "Arijit <b>Kundu123</b> Profile - Mi Community",
            titleNoFormatting: "Arijit Kundu123 Profile - Mi Community",
            unescapedUrl: "http://c.mi.com/in/space-uid-1544909598.html",
            url: "http://c.mi.com/in/space-uid-1544909598.html",
            visibleUrl: "c.mi.com",
            richSnippet: {
                metatags: {
                    applicationName: "Mi Community",
                    msapplicationTooltip: "Mi Community",
                    msapplicationTask: "name=Forum;action-uri=http://c.mi.com/in/forum.php;icon-uri=http://c.mi.com/in/http://bbs.appmifile.com/in/static/image/common/bbs.ico"
                }
            }
        }
    ]
}

返回参数说明

|参数名|说明|
|:----- |:-----|----- |
|pages| 分页信息,展示在页脚 |
|results| 搜索到的items |

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 134,869评论 18 139
  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 173,076评论 25 708
  • 发现 关注 消息 iOS 第三方库、插件、知名博客总结 作者大灰狼的小绵羊哥哥关注 2017.06.26 09:4...
    肇东周阅读 12,200评论 4 61
  • Spring Boot 参考指南 介绍 转载自:https://www.gitbook.com/book/qbgb...
    毛宇鹏阅读 46,941评论 6 342
  • 里仁(4.3——4.7) 4.3 子曰:唯仁者能好人,能恶人。 译文:孔子说:有仁心的人,才能真正做到公正待人。 ...
    好家伙迪蒙阅读 240评论 0 1