logo

Google Redirect (Goto) Link Resolver

View as Markdown

Resolve one Google redirect link to its destination URL

The Google Redirect (Goto) Link Resolver returns the destination URL for one Google /goto or /url redirect link. Use it for a link kept from a Search API response with resolveGoto=false, for Google Lens exact matches returned after the first 50, or for a redirect that the search request could not resolve in time.


Endpoint

GET https://api.scrape.do/plugin/google/goto

Credit cost: 0 credits. The endpoint is included with paid plans and is not available on the free plan.

Request Parameters

Required

ParameterTypeDescription
tokenstringYour Scrape.do API authentication token
urlstringOne URL-encoded Google redirect link. Accepted forms are https://www.google.<tld>/goto?url=<code> and https://www.google.<tld>/url?...&url=<code>&.... Send the code exactly as Google returned it; changing one character can make the link unresolvable

Google ad links such as https://www.google.com/aclk?... are not supported. Relative links such as /goto?url=<code> are rejected, so prefix them with https://www.google.com first (for example, the original_href values in a search response's goto_links). Parameter names are lowercase: URL or TOKEN is treated as a missing parameter.


Example Request

curl -G "https://api.scrape.do/plugin/google/goto" \
  --data-urlencode "token=YOUR_TOKEN" \
  --data-urlencode "url=https://www.google.com/goto?url=CAESYgHrOzAVyuo5c-Uj..."

Response

{
  "url": "https://www.google.com/goto?url=CAESYgHrOzAVyuo5c-Uj...",
  "destination": "https://www.example.com/article",
  "credits_used": 0
}
FieldTypeDescription
urlstringThe Google redirect link sent in the request
destinationstringThe destination URL the link points to
credits_usedintegerCredits charged for this request. This is always 0 and matches the Scrape.do-Request-Cost response header

Error Responses

StatusBodyCause
400{ "error": "token is required" }The token parameter is missing
400{ "error": "url is required" }The url parameter is missing or empty
400{ "error": "url must be a Google redirect link (https://www.google.com/goto?url=...)" }The value is not a supported Google /goto or /url redirect, is an ad link, already includes its destination, or has an invalid code
400{ "error": "invalid url" }The value cannot be read as a URL
400Standard API errorThe account is on the free plan
401Standard API errorThe token is invalid or the account has no credits left
429{ "error": "resolve already in progress", "message": "This link is already being resolved by another request. Wait for that request to finish before sending it again." }Another request is already resolving the same link
429Standard API errorThe plan's concurrency limit has been reached
502{ "error": "resolve failed", "message": "Please try again, and if the issue continues, contact support." }Google did not return a destination, or the link code is no longer accepted

No error response is charged.

Usage Notes

  • The endpoint accepts one link per request. To resolve many links, send different requests in parallel within your plan's concurrency limit. It is not available as an Async API plugin.
  • Send only one request for each link at a time. If the link is already being resolved, wait for the first request to finish instead of resending it.
  • Resolve links soon after the search that returned them because they may stop working over time.
  • A failed lookup returns 502 within about 20 seconds and is not charged.

See SERP API redirect links for automatic redirect resolution in search responses.

On this page