# Get the target of a Google redirect link

`POST https://api.answerline.dev/v1/monitor/google/goto`

Returns the destination URL of a single Google redirect link. Pass the `redirectLink` value that accompanies each resolved link in a Google Search or AI Mode response; the reply contains the URL it leads to.

Free of charge. One link is resolved per request, and Google is given up to 10 seconds to respond.

## Body

- `url` (string, required): Absolute URL of a Google redirect link that you want resolved. It must point to `google.com` or `www.google.com` and use a path of `/goto` or `/url`, which is the form returned as `redirectLink` alongside each resolved link in AI Mode, Google Search and Google News responses.

## Returns

- `url` (string, required): Target URL that the redirect link leads to

## Responses

- 200: Target URL that the redirect link leads to
- 400: Bad Request - url is absent, badly formed, or not a /goto or /url link on google.com
- 401: Unauthorized - API key absent or not valid
- 429: Too Many Requests - the call could not start now (`CONCURRENT_LIMIT_EXCEEDED`), or the service dropped the request because it was overloaded (`SERVICE_OVERLOADED`); that case returns `Retry-After` without any limit headers. `RATE_LIMIT_EXCEEDED`, with `Retry-After`, is sent only when one address presented too many unknown keys
- 500: Internal Server Error
- 502: Bad Gateway - Google's reply was not a redirect, or calling Google failed

## Request

curl:

```bash
curl -X POST "https://api.answerline.dev/v1/monitor/google/goto" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://www.google.com/goto?url=CAESaQHrOzAVqzmLoOGwx_6OnzSPRKSyqmXD3yEDa0VIkUCfa5RKEaB9eIJOYz_M1y_VwKrr5jrSlrFlZlBUbe9DQXMPRUiSOrjBMQ78vpRZtXEhawDDabM58DDRHnv2f-XOQAWw-nwkup9ptQ"}'
```


## Example responses

200:

```json
{
  "url": "https://www.youtube.com/watch?v=pma08NXw8Ts&t=541"
}
```

400:

```json
{
  "success": false,
  "error": "Request validation failed",
  "details": [
    {
      "field": "prompt",
      "message": "Prompt must not be empty"
    }
  ]
}
```

502:

```json
{
  "error": {
    "code": "EXTERNAL_SERVICE_ERROR",
    "message": "External service error: the service failed",
    "details": {
      "service": "CHATGPT"
    },
    "timestamp": "2025-01-15T12:00:00.000Z"
  }
}
```

