响应结构
一次成功的搜索返回 200 和一个 JSON 对象:
{ "search": "mount everest", "page": 1, "knowledgeGraph": { "title": "Mount Everest", "description": "Earth's highest mountain above sea level…", "attributes": { "Elevation": "8,849 m", "First ascent": "1953" } }, "organic": [ { "position": 1, "title": "Mount Everest - Wikipedia", "link": "https://en.wikipedia.org/wiki/Mount_Everest", "snippet": "Mount Everest is Earth's highest mountain…", "sitelinks": [{ "title": "Height", "link": "https://…" }] } ], "ads": [ { "position": 1, "title": "Everest Treks", "link": "https://…", "block": "top" } ], "peopleAlsoAsk": ["How tall is Mount Everest?"], "relatedSearches": [{ "query": "k2 mountain" }], "stats": { "balance": 9988, "cost": 6, "cached": false }}| 字段 | 类型 | 说明 |
|---|---|---|
search | string | 已执行的查询。 |
page | integer | 返回的页码(从 1 开始)。 |
organic | array | 排序后的自然结果。 |
ads | array? | 赞助结果,存在时返回。 |
knowledgeGraph | object? | Google 实体面板,存在时返回。 |
peopleAlsoAsk | string[]? | “大家还在问”问题。 |
relatedSearches | array? | “大家还在搜”。 |
stats | object? | 计费信息 —— 参见 定价。 |
OrganicResult
Section titled “OrganicResult”position、title、link、snippet、可选的 date,以及可选的 sitelinks[] { title, link }。
position、title、link、可选的 displayedLink、可选的 snippet、block("top" 或
"bottom"),以及可选的 sitelinks[]。
KnowledgeGraph
Section titled “KnowledgeGraph”title、可选的 imageUrl、description、descriptionSource、descriptionLink,以及一个
由键/值事实组成的 attributes 映射。
完整、始终最新的架构(包括每种错误结构),参见由 OpenAPI 契约生成的 API 参考。