---
title: "Goto"
description: "当结果的 url 仍是 Google 链接时，获取该链接指向的地址。"
---

> Every apinoa docs page as markdown: https://apinoa.com/llms.txt (all in one file: https://apinoa.com/llms-full.txt; this API family in one file: https://apinoa.com/docs/serp/llms.txt)

```http
GET | POST /v1/google/goto
```

参数可以用 `GET` 的查询字符串发送，也可以用 `POST` 的 JSON 请求体发送，两者等价。

Google 对部分结果链接要等待片刻才放行。搜索、[AI 概览](/docs/api-reference/google-aio/answer)和 [AI Mode](/docs/api-reference/google-ai-mode/answer) 的回答不会等待这些链接：尚未放行的链接，其结果的 `url` 是 Google 自己的链接（`https://www.google.com/goto?url=…`）。把该链接发到这里，即可得到它指向的地址。

等待从返回结果时就已开始，因此几秒后再请求通常会立即得到答复。如果本次调用已等到上限而 Google 仍未放行，会以 `429` 和 `Retry-After` 答复：请在相应秒数后再次请求。

此调用免费。

## 请求

```bash tab="cURL"
curl "https://gateway.apinoa.com/v1/google/goto" \
  -H "x-api-key: $APINOA_API_KEY" \
  -H "content-type: application/json" \
  -d '{"url": "https://www.google.com/goto?url=CAESeAHrOzAV..."}'
```

```js tab="JavaScript"
const res = await fetch("https://gateway.apinoa.com/v1/google/goto", {
  method: "POST",
  headers: { "x-api-key": process.env.APINOA_API_KEY, "content-type": "application/json" },
  body: JSON.stringify({ url: "https://www.google.com/goto?url=CAESeAHrOzAV..." }),
});
const { success, data, error } = await res.json();
```

```python tab="Python"
import os

import requests

res = requests.post(
    "https://gateway.apinoa.com/v1/google/goto",
    json={"url": "https://www.google.com/goto?url=CAESeAHrOzAV..."},
    headers={"x-api-key": os.environ["APINOA_API_KEY"]},
)
body = res.json()
```

## 参数

| Parameter | Type | Required | Notes |
|---|---|---|---|
| `url` | string | yes | A result's `url` that is still a Google link (`https://www.google.com/goto?url=…`), as a search, an AI Overview or AI Mode returned it. |

The same parameters, and every response type, are in the OpenAPI document: https://apinoa.com/openapi.json

## 响应

在 `data` 中返回 [`ResolvedLink`](/docs/api-reference/serp/response-schema#resolvedlink)：你发送的链接，以及它指向的地址。

```json
{
  "success": true,
  "data": {
    "engine": "google",
    "link": "https://www.google.com/goto?url=CAESeAHrOzAV...",
    "url": "https://www.merriam-webster.com/dictionary/hello"
  }
}
```

## 错误

| 状态 | 代码 | 含义 |
|---|---|---|
| 400 | `INVALID_PARAMS` | `url` 不是 Google 结果链接（`https://www.google.com/goto?url=…`）。 |
| 401 | `UNAUTHORIZED` | 缺少 `x-api-key` 请求头，或密钥已吊销或未知。 |
| 429 | `UPSTREAM_RATE_LIMITED` | Google 尚未放行该链接。请等待 `Retry-After` 秒后再次请求。 |
| 503 | `SERVICE_UNAVAILABLE` | 临时故障。请退避后重试。 |

全部错误代码见 [Errors](/docs/errors)。

## 价格

**Price** 0 credits per call. [Plans and credits](https://apinoa.com/en/pricing).
