最后更新
更新日志/search25 credits per call搜索
Google 网页搜索:按 Google 的排序返回查询的自然搜索结果(每次调用最多 30 条)。每条结果包含排名(position,跨页从 1 开始计数)、稳定的 id、标题、目标 url(url_resolved 表示 url 是页面本身还是 Google 的结果链接)、displayed_url、domain、source(网站名称)、摘要,以及 Google 在摘要前显示的日期(按页面显示原样返回,没有则为 null)。next_start 是下一次调用所用的 start 值。
Authorization: Bearer <key> on every request.Parameters
search query, e.g. "best hiking boots"
how many results to return, 1 to 30; Google shows about 10 per page, so 20 or 30 reads two or three pages
Google result offset: 0 is the first page, 10 the second, and so on (use next_start from the previous call)
interface language of the results, e.g. en, de, fr, pt-BR
country to search from, two-letter code, e.g. us, gb, de
Response fields
querye.g."best hiking boots"hle.g."en"gle.g."us"starte.g.0counte.g.9next_starte.g.10results
positione.g.1ide.g."a9156317db4e4142"titlee.g."Best Hiking Boots of 2026"urle.g."https://bettertrail.com/outdoor-gear/best-hiking-boots"url_resolvede.g.truedisplayed_urle.g."https://bettertrail.com › outdoor-gear › best-hiking-boots"domaine.g."bettertrail.com"sourcee.g."Better Trail"snippete.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, ..."datee.g."4 days ago"pagination
counte.g.9has_moree.g.falsenext_cursorfetched_ate.g."2026-11-27T10:20:15.930Z"agee.g.0curl "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"
{
"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.
https://mcp.maviapi.com/mcpOr 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 importPaste 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 /searchGoogle 网页搜索:按 Google 的排序返回查询的自然搜索结果(每次调用最多 30 条)。每条结果包含排名(position,跨页从 1 开始计数)、稳定的 id、标题、目标 url(url_resolved 表示 url 是页面本身还是 Google 的结果链接)、displayed_url、domain、source(网站名称)、摘要,以及 Google 在摘要前显示的日期(按页面显示原样返回,没有则为 null)。next_start 是下一次调用所用的 start 值。
GET /search 的参数和响应字段
请求参数 名称 类型 / 位置 必填 说明 q string / query 否 search query, e.g. "best hiking boots" num integer / query 否 how many results to return, 1 to 30; Google shows about 10 per page, so 20 or 30 reads two or three pages start integer / query 否 Google result offset: 0 is the first page, 10 the second, and so on (use next_start from the previous call) hl string / query 否 interface language of the results, e.g. en, de, fr, pt-BR gl string / query 否 country to search from, two-letter code, e.g. us, gb, de 响应字段 字段 类型 说明 query string hl string gl string start integer count integer next_start integer results object[] results[].position integer results[].id string results[].title string results[].url string results[].url_resolved boolean results[].displayed_url string results[].domain string results[].source string results[].snippet string results[].date string pagination object pagination.count integer pagination.has_more boolean pagination.next_cursor null fetched_at string age integer - 新闻
GET /news按搜索查询返回近期的 Google News 文章,排序与 Google News 一致(最多 100 条)。每篇文章包含排名、Google News id、标题、来源名称、来源网站和域名、Google News 文章链接,以及 published_at(UTC,ISO 8601)。
GET /news 的参数和响应字段
请求参数 名称 类型 / 位置 必填 说明 q string / query 否 search query, e.g. "renewable energy" when string / query 否 only articles from the last hour, day, week, month or year: 1h, 1d, 7d, 30d or 1y; leave out for any time hl string / query 否 interface language of the results, e.g. en, de, fr, pt-BR gl string / query 否 country to search from, two-letter code, e.g. us, gb, de 响应字段 字段 类型 说明 query string when null hl string gl string count integer articles object[] articles[].position integer articles[].id string articles[].headline string articles[].source string articles[].source_url string articles[].domain string articles[].url string articles[].published_at string pagination object pagination.count integer pagination.has_more boolean pagination.next_cursor null fetched_at string age integer
将 Google 数据导出为 CSV
下面的每个列表都可以下载为 CSV 文件,每条记录一行。用上方控制台下面的 "Get all the data, no code" 卡片把列表收集到数据集中。数据集会逐页读取列表,之后可下载为 CSV、JSON 或 JSONL。
| 列表 | CSV 列 |
|---|---|
搜索GET /search | position, id, title, url, url_resolved, displayed_url, domain, source, snippet, date |
新闻GET /news | position, 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 '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 API 集成吗?
不会。您正在使用的端点,其结构永远不会改变:新的字段、可选参数和端点只会加在旁边,会破坏调用的变更则作为新端点发布。请忽略您不认识的响应字段,新内容请关注更新日志。
相关 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…