Link to AMP Content

Use the AMP URL API to match URLs to corresponding AMP URLs, and serve the AMP versions instead.

Match URLs to AMP URLs

Request an AMP URL via:


List up to 50 URLs as payload in the request body:

{"urls": [

All requests need to include a development key via X-Authorization header (X-Goog-Api-Key: YOUR-DEVELOPER-KEY). The X-Authorization header value is case sensitive. If you don't have a development key, see Authorization for setup instructions.

Example using curl:

curl -i -s -k -X POST -H "Content-Type: application/json" -H "X-Goog-Api-Key: " -d "{urls: ['']}" ""

Replace URLs with AMP URLs

The batchGet method returns the AMP URL mapping in JSON:

  "ampUrls": [
      "originalUrl": "",
      "ampUrl": "",
  "urlErrors": [
      "errorCode": "NO_AMP_URL",
      "errorMessage": "AMP URL not found.",
      "originalUrl": ""

Both the original AMP URL and the one stored in the Google AMP Cache get returned in the response body. We encourage you to use "cdnAmpUrl", instead of "ampUrl", so that your application can have all the benefits of the Google AMP Cache.

Set up redirects

Any time you move the location of AMP files on your server, set up redirects from old locations to new locations. The Google AMP Cache follows redirects when resolving AMP URLs.

If a URL redirects to another valid AMP URL, the Google AMP Cache returns and caches the content of the resolved redirect.