Thordata Docs
简体中文
简体中文
  • 概述
  • 代理
    • 集成教程
      • 住宅代理集成
        • AdsPower
        • BitBrowser
        • ClonBrowser
        • Hubstudio
        • Playwright
        • Puppeteer
        • Selenium
        • Ghost Browser
        • SwitchyOmega
        • FoxyProxy
        • Chrome
        • Edge
        • MuLogin
        • Incogniton
      • ISP代理集成
        • AdsPower
        • BitBrowser
        • ClonBrowser
        • Hubstudio
        • Ghost Browser
        • SwitchyOmega
        • FoxyProxy
        • Chrome
        • Edge
      • 数据中心代理集成
        • AdsPower
        • BitBrowser
        • ClonBrowser
        • Hubstudio
        • Ghost Browser
        • SwitchyOmega
        • FoxyProxy
        • Chrome
        • Edge
      • 无限代理集成
        • AdsPower
        • BitBrowser
        • ClonBrowser
        • Hubstudio
        • Ghost Browser
        • SwitchyOmega
        • FoxyProxy
        • Chrome
        • Edge
    • 住宅代理
      • 入门指南
      • 端点生成器
        • 账密认证
        • IP白名单
          • 国家条目提取
            • 国家/地区入口节点
          • API链接
      • 账户
      • 基本查询
      • 位置设置
        • 国家/地区
        • 城市
        • 州
      • 会话控制
      • 协议
      • 国家/地区列表
      • CDKEY生成与兑换
    • ISP代理
      • 入门指南
    • 数据中心代理
      • 入门指南
    • 无限代理服务器
      • 端点生成器
        • 账密认证
        • IP白名单
          • 国家条目提取
          • API链接
      • 账户
      • 国家/地区列表
  • 爬取
    • SERP API
      • SERP API简介
      • 快速入门
      • 发送您的第一次请求
      • 查询参数
        • 谷歌
        • Bing
        • Yandex
        • DuckDuckGo
      • 解析后的JSON结果
        • 谷歌
        • Bing
        • Yandex
        • DuckDuckGo
      • 常见问题解答
  • WEB Scraper API
    • 入门指南
    • API 请求构建器
    • 抓取参数说明
    • Webhook 集成
    • Amazon S3 集成
  • Universal Scraping API
    • 入门指南
    • 配置
    • 参数说明
  • 免费工具
    • 谷歌扩展程序
      • 使用教程
  • 有用的链接
    • 仪表板中心
  • 常见问题
    • 产品问题
      • 我该如何选择合适的代理套餐?
      • 如何定位特定的国家/地区?
      • 如何定位特定的城市?
      • 什么是无限代理?
      • 为什么在指纹浏览器中使用我们的代理,无法达到您的理想使用效果?
        • 1. 代理完全不生效
        • 2. 您所使用的其他检测渠道检测结果与Thordata后台提取的国家不一致
        • 3. 您所访问的目标网站检测结果与Thordata后台提取的国家不一致
        • 4. 代理生效,但代理的归属地检测结果是随机的
        • 5. 使用白名单的方式,连接失败
    • 付款问题
      • 支持哪些支付方式?
      • 购买错套餐怎么办?
      • 是否提供付费服务退款?
      • 付款后,收到代理余额或激活我的帐户需要多长时间?
  • 支持
    • 联系我们
Powered by GitBook
On this page
  • 本地化
  • 地理位置
  • 搜索类型
  • 分页
  • 高级参数

Was this helpful?

  1. 爬取
  2. SERP API
  3. 查询参数

谷歌

SERP API 谷歌查询参数

使用 Thordata的 SERP API 配置谷歌搜索查询,包括本地化参数、地理位置、分页、以及“高级参数”输出选项。

q,必填,

该参数定义了爬取时的搜索结果,默认值为q= pizza 。您可以输入任意您想要查询的关键词,也可以是任意语言。

代码示例:

curl https://scraperapi.thordata.com/request -H "Content-Type: application/json" -H "Authorization: Bearer xxxxxxxxxxxxxxxx" -d "{\"url\": \"https://www.google.com/search?q=pizza^&json=1\"}"

本地化

domain,自选

该参数定义了爬取时使用的域名,默认值为 google.com 。修或者您可以前往 Google 域名页面https://domains.squarespace.com/,查看受支持的域名完整列表。

示例请求:

curl https://scraperapi.thordata.com/request -H "Content-Type: application/json" -H "Authorization: Bearer xxxxxxxxxxxxxxxx" -d "{\"url\": \"https://www.google.com/search?q=pizza^&json=1\"}"

gl,自选

gl参数用于指定爬取Google搜索结果时按照国家/地区用户的习惯展示,默认值us(美国)。这是一个由两个字母组成的国家/地区代码(例如:us, ru, uk)。

修改gl参数会影响搜索结果的排序、本地化内容以及语言偏好,例如gl=ru会返回俄语优先的俄罗斯本地化结果,而gl=jp则会显示日语优先的日本地区结果。完整支持的国家/地区代码列表可参考Google国家/地区页面。

示例请求:

curl https://scraperapi.thordata.com/request -H "Content-Type: application/json" -H "Authorization: Bearer xxxxxxxxxxxxxxxx" -d "{\"url\": \"https://www.google.com/search?q=pizza^&gl=au^&json=1\"}"

hl,自选

hl参数用于指定爬取Google搜索结果时使用的界面语言,默认值en(英语)。这是一个由两个字母组成的语言代码(例如:en, ru, es)。

修改hl参数会影响搜索结果的界面语言和部分内容语言,例如hl=es会返回西班牙语界面和西班牙语优先的内容,而hl=zh-CN则会显示简体中文界面和中文优先内容。完整支持的语言代码列表可参考Google语言页面。

示例请求:

curl https://scraperapi.thordata.com/request -H "Content-Type: application/json" -H "Authorization: Bearer xxxxxxxxxxxxxxxx" -d "{"url": "https://www.google.com/search?q=pizza^&json=1^&hl=es\"}"

cr,自选

cr参数参数定义一个或多个国家,以限制搜索范围,|作为分隔符。组合 gl 和 cr 可确保界面与内容语言一致,单独用 gl 仅切换界面语言,严格限制内容语言则优先用 cr(例如,countryFR|countryDE将仅搜索法语和德语页面)。

修改cr参数会强制Google返回符合指定国家/地区来源的网页结果。完整支持的国家/地区代码列表可参考Google国家/地区页面。

示例请求:

curl https://scraperapi.thordata.com/request -H "Content-Type: application/json" -H "Authorization: Bearer xxxxxxxxxxxxxxxx" -d "{"url": "https://www.google.com/search?q=pizza^&json=1^&cr=countryFR|countryDE"}"

lr,自选

参数定义一个或多个语言,以限制搜索范围。它使用lang_XX母语言代码指定语言,|作为分隔符。hl和lr两者可组合使用,但实际效果以 lr 优先。(例如,lang_fr|lang_de将仅搜索法语和德语页面)。

修改后修改lr参数会返回符合指定语言来源的网页结果。例如lr=lang_en|lang_fr会返回英文界面和法语优先的内容,而lr=lang_es|lang_jp则会显示西班牙语和日语内容。

示例请求:

curl https://scraperapi.thordata.com/request -H "Content-Type: application/json" -H "Authorization: Bearer xxxxxxxxxxxxxxxx" -d "{"url": "https://www.google.com/search?q=pizza^&json=1^&lr=lang_en|lang_fr"}"

地理位置

location,自选

该参数定义了爬取时的精准地理位置,用来模拟真实用户的搜索。与uule 参数绑定使用。如果省略 location,搜索可能会采用代理的位置。

代码示例:

curl https://scraperapi.thordata.com/request -H "Content-Type: application/json" -H "Authorization: Bearer xxxxxxxxxxxxxxxx" -d "{"url": "https://www.google.com/search?q=pizza^&json=1^&location=India^&uule=w+CAIQICIFSW5kaWE"}"

uule,自选

该参数通过 Base64 编码 来定义您选择的地理位置,与 location 参数一起使用。

可以在此处下载包含所有可用 uule 值的 CSV: https://developers.google.com/adwords/api/docs/appendix/geotargeting CSV 中“规范名称”列的值可用作 API 的原始字符串 ​代码示例:

curl https://scraperapi.thordata.com/request -H "Content-Type: application/json" -H "Authorization: Bearer xxxxxxxxxxxxxxxx" -d "{"url": "https://www.google.com/search?q=pizza^&json=1^&location=India^&uule=w+CAIQICIFSW5kaWE"}"

搜索类型

tbm,自选

该参数定义了爬取的搜索结果类型。对于常规搜索,无需使用 tbm 参数,而其他类型则有唯一的 tbm 值。 示例: tbm=isch - 图片 tbm=shop - 购物 tbm=nws - 新闻 tbm=vid - 视频

代码示例:

curl https://scraperapi.thordata.com/request -H "Content-Type: application/json" -H "Authorization: Bearer  xxxxxxxxxxxxxxxx" -d "{"url": "https://www.google.com/search?q=pizza^&json=1^&tbm=shop"}"

分页

start,自选

start 参数用于设置搜索结果的起始位置(即跳过的结果数量),默认从第 1 条结果开始。该参数值为整数,例如 start=30 表示跳过前 30 条结果,从第 31 条开始返回搜索结果。

代码示例:

curl https://scraperapi.thordata.com/request -H "Content-Type: application/json" -H "Authorization: Bearer xxxxxxxxxxxxxxx" -d "{\"url\": \"https://www.google.com/search?q=pizza^&json=1^&start=30\"}"

num,自选

该参数定义了搜索结果每页返回的最大数。

示例: num=20(默认) - 返回 20 条结果 num=50 - 返回 50 条结果,以此类推

代码示例:

curl https://scraperapi.thordata.com/request -H "Content-Type: application/json" -H "Authorization: Bearer xxxxxxxxxxxxxx" -d "{\"url\": \"https://www.google.com/search?q=pizza^&json=1^&num=20\"}"

safe,自选

该参数用于控制是否过滤成人内容,可选值为 active(启用安全搜索)或 off(关闭安全搜索)。默认情况下,Google 会对露骨内容进行模糊处理。 可选值说明: safe=active – 严格过滤成人内容 safe=off – 不过滤成人内容

代码示例:

curl https://scraperapi.thordata.com/request -H "Content-Type: application/json" -H "Authorization: Bearer xxxxxxxxxxxxxxx" -d "{"url": "https://www.google.com/search?q=pizza^&json=1^&safe=active"}"

高级参数

ludocid,自选

该参数用于触发特定知识图谱(Knowledge Graph)数据的渲染,通常与搜索关键词(q 参数)配合使用。其值为 Google 内部的知识图谱实体 ID(如 ludocid=14389889685039125943),可精确返回结构化信息(如企业详情、地点数据等)

代码示例:

curl https://scraperapi.thordata.com/request -H "Content-Type: application/json" -H "Authorization: Bearer ab4a6ab147570ba7c5ea6f59990a458a" -d "{"url": "https://www.google.com/search?q=谷歌^&json=1^&ludocid=14389889685039125943"}"

kgmid,自选

该参数用于直接调用 Google 知识图谱(Knowledge Graph)中的特定条目,返回结构化数据而非常规搜索结果。通过指定条目的加密标识符(如 /m/0d6lp 对应旧金山),可精准获取企业、地点、人物等实体的详细信息。 核心特性: 覆盖常规搜索:直接返回知识图谱数据,忽略普通网页结果 结构化输出:包含标准化字段(如描述、图片、评分等) 需精确匹配:仅对有效 kgmid 标识符生效 使用示例: kgmid=/m/0d6lp → 旧金山知识图谱数据 kgmid=/m/025s2q3 → 谷歌公司信息 代码示例:

curl https://scraperapi.thordata.com/request -H "Content-Type: application/json" -H "Authorization: Bearer xxxxxxxxxxxxxxxx" -d "{"url": "https://www.google.com/search?q=谷歌^&json=1^&kgmid=/m/0d6lp"}"

ibp,自选

该参数用于控制 Google 搜索结果的特殊渲染模式,可激活扩展搜索功能或增强知识图谱(Knowledge Graph)的展示效果。通常需配合 ludocid 等参数使用,以获取更丰富的结构化数据。 典型值示例: ibp=new → 启用新版渲染逻辑 代码示例:

curl https://scraperapi.thordata.com/request -H "Content-Type: application/json" -H "Authorization: Bearer xxxxxxxxxxxxxxxx" -d "{"url": "https://www.google.com/search?q=pizza^&json=1^&ibp=new"}"

tbs,自选

该参数用于对搜索结果进行高级筛选,支持多种时间范围和内容类型的限定条件,通过特定语法组合实现精准过滤。 示例: (1)时间范围筛选 qdr:h → 过去1小时 qdr:d → 过去24小时 qdr:w → 过去7天 qdr:m → 过去1个月 qdr:y → 过去1年 (2)内容类型筛选 sur:f → 仅显示图片结果 sur:fc → 仅显示可免费商用的图片 sbd:1 → 按日期排序(最新优先)

代码示例:

curl https://scraperapi.thordata.com/request -H "Content-Type: application/json" -H "Authorization: Bearer xxxxxxxxxxxxxxxx" -d "{"url": "https://www.google.com/search?q=pizza^&json=1^&tbs=sur:f"}"

nfpr,自选

是否禁用自动纠正拼写,比如:nfpr=1 ,搜索“googl”不自动纠正为“google” 代码示例:

curl https://scraperapi.thordata.com/request -H "Content-Type: application/json" -H "Authorization: Bearer xxxxxxxxxxxxxxxx" -d "{"url": "https://www.google.com/search?q=pizza^&json=1^&nfpr=1"}"

filter,自选

结果去重,“1”为启用过滤器、“0”为禁用过滤器

代码示例:

curl https://scraperapi.thordata.com/request -H "Content-Type: application/json" -H "Authorization: Bearer xxxxxxxxxxxxxxxx" -d "{\"url\": \"https://www.google.com/search?q=pizza^&json=1^&filter=1\"}"

如果您需要更多帮助,请通过邮箱support@thordata.com联系我们。

Previous查询参数NextBing

Last updated 4 days ago

Was this helpful?