Skip to content

最后更新

更新日志

Google API

正常只读

以 JSON 形式返回 Google 搜索结果:任意查询词的网页排名结果和新闻搜索。 来源: www.google.com.

基础 URL
https://api.maviapi.com/v1/sites/google
2
端点
6 min ago
最近验证
6957ms
p50 延迟
1
自动修复 / 累计
GET/search25 credits per call

搜索

Google 网页搜索:按 Google 的排序返回查询的自然搜索结果(每次调用最多 30 条)。每条结果包含排名(position,跨页从 1 开始计数)、稳定的 id、标题、目标 url(url_resolved 表示 url 是页面本身还是 Google 的结果链接)、displayed_url、domain、source(网站名称)、摘要,以及 Google 在摘要前显示的日期(按页面显示原样返回,没有则为 null)。next_start 是下一次调用所用的 start 值。

Bearer auth. Pass your key as Authorization: Bearer <key> on every request.
stringOptionalin query

search query, e.g. "best hiking boots"

integerOptionalin query

how many results to return, 1 to 30; Google shows about 10 per page, so 20 or 30 reads two or three pages

integerOptionalin query

Google result offset: 0 is the first page, 10 the second, and so on (use next_start from the previous call)

stringOptionalin query

interface language of the results, e.g. en, de, fr, pt-BR

stringOptionalin query

country to search from, two-letter code, e.g. us, gb, de

querystringe.g."best hiking boots"
hlstringe.g."en"
glstringe.g."us"
startintegere.g.0
countintegere.g.9
next_startintegere.g.10
resultsobject[]10 fields
positionintegere.g.1
idstringe.g."a9156317db4e4142"
titlestringe.g."Best Hiking Boots of 2026"
urlstringe.g."https://bettertrail.com/outdoor-gear/best-hiking-boots"
url_resolvedbooleane.g.true
displayed_urlstringe.g."https://bettertrail.com › outdoor-gear › best-hiking-boots"
domainstringe.g."bettertrail.com"
sourcestringe.g."Better Trail"
snippetstringe.g."See the best hiking boots of 2026, field-tested by our team of experts, from top brands like Hoka, Merrell, Salomon, La Sportiva, Keen, ..."
datestringe.g."4 days ago"
paginationobject3 fields
countintegere.g.9
has_morebooleane.g.false
next_cursornull
fetched_atstringe.g."2026-11-27T10:20:15.930Z"
ageintegere.g.0
Try itLive
GET
https://api.maviapi.com/v1/sites/google/search?q=best%20hiking%20boots&num=10&start=0&hl=en&gl=us
Request
curl "https://api.maviapi.com/v1/sites/google/search?q=best%20hiking%20boots&num=10&start=0&hl=en&gl=us" \
-H "Authorization: Bearer $MAVI_KEY"
Example823 B
{
  "query": "best hiking boots",
  "hl": "en",
  "gl": "us",
  "start": 0,
  "count": 9,
  "next_start": 10,
  "results": [
    {
      "position": 1,
      "id": "a9156317db4e4142",
      "title": "Best Hiking Boots of 2026",
      "url": "https://bettertrail.com/outdoor-gear/best-hiking-boots",
      "url_resolved": true,
      "displayed_url": "https://bettertrail.com › outdoor-gear › best-hiking-boots",
      "domain": "bettertrail.com",
      "source": "Better Trail",
      "snippet": "See the best hiking boots of 2026, field-tested by our team of experts, from top brands like Hoka, Merrell, Salomon, La Sportiva, Keen, ...",
      "date": "4 days ago"
    }
  ],
  "pagination": {
    "count": 9,
    "has_more": false,
    "next_cursor": null
  },
  "fetched_at": "2026-11-27T10:20:15.930Z",
  "age": 0
}

Get all the data, no code

Collect every page of GET /search into a dataset, for one request or for a whole list of them, then download it as CSV or JSON. A page costs the same as one call of the endpoint; the download is free.

Use Google API from Claude, ChatGPT and your coding tools

Add this URL as a custom connector and sign in to maviapi. Nothing to install.

How to connect
https://mcp.maviapi.com/mcp

Or run it locally, with each endpoint of Google API as its own tool:

claude mcp add maviapi -e MAVIAPI_TOOLS=google -- npx -y '@maviapi/mcp'

Import Google API into Postman and other tools

How to import

Paste a link into Postman, Insomnia, an agent framework or a no-code tool to get every endpoint with its parameters and response fields. The link always serves the current endpoints, so importing it again picks up new ones.

  • OpenAPI 3.1
    https://api.maviapi.com/v1/apis/google/openapi.json
  • Postman
    https://api.maviapi.com/v1/apis/google/postman.json

The Postman collection sends the shared demo key until you put your own key in its maviapi_key variable.

使用 Google API 进行开发

这是数据形式的 Google 搜索:/search 返回一个查询的自然搜索结果及其排名,包含位置、标题、URL、Google 显示的网址、网站名称、摘要和日期;/news 返回最新的新闻,包含标题、来源和发布时间。语言(hl)和国家(gl)都是参数,因此一个密钥就能读取德国或巴西的搜索者会看到的结果。

可以用它做什么

排名跟踪
每天用固定的 hl 和 gl 查询一次您的关键词,并保存您域名的排名位置。
为 AI 回答提供依据
获取一个问题的前几条结果,把标题、摘要和 URL 作为来源交给模型。
新闻监测
用 when=1h 或 when=1d 对某个公司名称调用 /news,保留之前没见过的文章。

调用前须知

  • 一次 /search 调用最多返回 30 条结果。要取后面的结果,把 data.next_start 作为 start 传入。
  • 每个新闻查询 Google 最多返回 100 篇文章:用 when 时间窗口缩小范围。
  • 结果均为自然搜索结果。图片和地点请使用 Google Images 和 Google Maps API。

选择一个端点开始

  • 搜索 GET /search

    Google 网页搜索:按 Google 的排序返回查询的自然搜索结果(每次调用最多 30 条)。每条结果包含排名(position,跨页从 1 开始计数)、稳定的 id、标题、目标 url(url_resolved 表示 url 是页面本身还是 Google 的结果链接)、displayed_url、domain、source(网站名称)、摘要,以及 Google 在摘要前显示的日期(按页面显示原样返回,没有则为 null)。next_start 是下一次调用所用的 start 值。

    GET /search 的参数和响应字段
    请求参数
    名称类型 / 位置必填说明
    qstring / query否search query, e.g. "best hiking boots"
    numinteger / query否how many results to return, 1 to 30; Google shows about 10 per page, so 20 or 30 reads two or three pages
    startinteger / query否Google result offset: 0 is the first page, 10 the second, and so on (use next_start from the previous call)
    hlstring / query否interface language of the results, e.g. en, de, fr, pt-BR
    glstring / query否country to search from, two-letter code, e.g. us, gb, de
    响应字段
    字段类型说明
    querystring
    hlstring
    glstring
    startinteger
    countinteger
    next_startinteger
    resultsobject[]
    results[].positioninteger
    results[].idstring
    results[].titlestring
    results[].urlstring
    results[].url_resolvedboolean
    results[].displayed_urlstring
    results[].domainstring
    results[].sourcestring
    results[].snippetstring
    results[].datestring
    paginationobject
    pagination.countinteger
    pagination.has_moreboolean
    pagination.next_cursornull
    fetched_atstring
    ageinteger
  • 新闻 GET /news

    按搜索查询返回近期的 Google News 文章,排序与 Google News 一致(最多 100 条)。每篇文章包含排名、Google News id、标题、来源名称、来源网站和域名、Google News 文章链接,以及 published_at(UTC,ISO 8601)。

    GET /news 的参数和响应字段
    请求参数
    名称类型 / 位置必填说明
    qstring / query否search query, e.g. "renewable energy"
    whenstring / query否only articles from the last hour, day, week, month or year: 1h, 1d, 7d, 30d or 1y; leave out for any time
    hlstring / query否interface language of the results, e.g. en, de, fr, pt-BR
    glstring / query否country to search from, two-letter code, e.g. us, gb, de
    响应字段
    字段类型说明
    querystring
    whennull
    hlstring
    glstring
    countinteger
    articlesobject[]
    articles[].positioninteger
    articles[].idstring
    articles[].headlinestring
    articles[].sourcestring
    articles[].source_urlstring
    articles[].domainstring
    articles[].urlstring
    articles[].published_atstring
    paginationobject
    pagination.countinteger
    pagination.has_moreboolean
    pagination.next_cursornull
    fetched_atstring
    ageinteger

将 Google 数据导出为 CSV

下面的每个列表都可以下载为 CSV 文件,每条记录一行。用上方控制台下面的 "Get all the data, no code" 卡片把列表收集到数据集中。数据集会逐页读取列表,之后可下载为 CSV、JSON 或 JSONL。

列表CSV 列
搜索GET /searchposition, id, title, url, url_resolved, displayed_url, domain, source, snippet, date
新闻GET /newsposition, id, headline, source, source_url, domain, url, published_at

嵌套的值(列表或对象)以 JSON 写入同一个单元格。 数据集和导出如何工作

Google API 常见问题

能获取什么数据、费用多少、如何调用。

Google 有官方 API 吗?

有,Google 提供自己的 API:Custom Search JSON API(核实日期:2026-11-25)。本页的 Google API 与它无关,是非官方 API:它是 maviapi 针对 google.com 上的公开数据提供的独立托管 API,并非由 Google 开发、认可或支持。

Google API 可以获取哪些数据?

Google API 有 2 个端点。每个端点都返回 JSON,参数和字段见上方的文档:

  • GET /search: Google 网页搜索:按 Google 的排序返回查询的自然搜索结果(每次调用最多 30 条)。
  • GET /news: 按搜索查询返回近期的 Google News 文章,排序与 Google News 一致(最多 100 条)。

Google API 的价格是多少?

调用用您 maviapi 套餐中的积分支付,只有成功的调用才会计费。各端点每次调用消耗 5 到 25 个积分,每个端点的价格都标在上方。在 Hobby 套餐下(每月 $49,含 250,000 个积分),1,000 次调用约 $0.98 到 $4.90,视端点而定。失败的调用不收费。Free 套餐每月提供 1,000 个积分,无需信用卡。超出部分请查看套餐和积分价格。

如何调用 Google API?

向端点发送 HTTPS 请求,并在 Authorization 请求头中带上您的 API 密钥。例如 GET /search:

cURL
curl 'https://api.maviapi.com/v1/sites/google/search' \
  -H "Authorization: Bearer $MAVI_KEY"

在您的 API 密钥页面创建密钥,或者先在上方的控制台中用免费测试密钥试用任意端点。

以 JSON 获取 Google 数据有哪些方式?

以 JSON 获取 Google 数据的每种方式适合不同的需求:

  • Custom Search JSON API: 需要写入权限、账号数据或与 Google 签订协议时更合适。
  • 自己写爬虫: 完全由自己掌控,不依赖任何服务商,但解析、被拦截的请求以及 google.com 每次改版后的修复都要自己负责。更适合从很少变化的页面一次性获取数据。
  • Apify: 一个 Actor 市场,Actor 由您自己运行,输入、输出和价格由各个 Actor 决定。当已有 Actor 能返回您需要的数据,或者您想托管自己的代码时更合适。参见maviapi 与 Apify 的对比。
  • RapidAPI: 一个汇集了众多提供方 API 的平台,用一个 RapidAPI 密钥调用,每个 API 单独定价。当您已经在使用该平台,并且其中某个 API 能满足需求时更合适。来源:RapidAPI docs。
  • maviapi: 本页的 Google API:2 个带文档的端点、公开的响应结构,以及一个可用于整个目录的密钥。当这些数据是您产品的一部分,而您不想维护爬虫时更合适。

google.com 改版后会怎样?

您的代码不需要改动。google.com 修改页面时,maviapi 会让 Google API 保持可用,您继续调用同样的端点,并得到本页文档所述结构的 JSON。它当前的运行状况见状态页,变更记录见它的更新日志。

更新会破坏我的 Google API 集成吗?

不会。您正在使用的端点,其结构永远不会改变:新的字段、可选参数和端点只会加在旁边,会破坏调用的变更则作为新端点发布。请忽略您不认识的响应字段,新内容请关注更新日志。

  • Google Maps API

    来自 maps.google.com 的结构化数据。

  • Google Images API

    来自 images.google.com 的结构化数据。

  • Hürriyet API

    来自 Hürriyet 的最新土耳其新闻:汇总各栏目(gündem、ekonomi、dünya、spor 等)、按时间从新到旧排列的综合新闻流,包含标题、摘要、图片、栏目、发布时间、作者、URL…