Accelerated Mobile Pages (AMP) URL API . ampUrls

Instance Methods

batchGet(body=None, x__xgafv=None)

Returns AMP URL(s) and equivalent [AMP Cache URL(s)](/amp/cache/overview#amp-cache-url-format).

close()

Close httplib2 connections.

Method Details

batchGet(body=None, x__xgafv=None)
Returns AMP URL(s) and equivalent [AMP Cache URL(s)](/amp/cache/overview#amp-cache-url-format).

Args:
  body: object, The request body.
    The object takes the form of:

{ # AMP URL request for a batch of URLs.
  "lookupStrategy": "A String", # The lookup_strategy being requested.
  "urls": [ # List of URLs to look up for the paired AMP URLs. The URLs are case-sensitive. Up to 50 URLs per lookup (see [Usage Limits](/amp/cache/reference/limits)).
    "A String",
  ],
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Batch AMP URL response.
  "ampUrls": [ # For each URL in BatchAmpUrlsRequest, the URL response. The response might not be in the same order as URLs in the batch request. If BatchAmpUrlsRequest contains duplicate URLs, AmpUrl is generated only once.
    { # AMP URL response for a requested URL.
      "ampUrl": "A String", # The AMP URL pointing to the publisher's web server.
      "cdnAmpUrl": "A String", # The [AMP Cache URL](/amp/cache/overview#amp-cache-url-format) pointing to the cached document in the Google AMP Cache.
      "originalUrl": "A String", # The original non-AMP URL.
    },
  ],
  "urlErrors": [ # The errors for requested URLs that have no AMP URL.
    { # AMP URL Error resource for a requested URL that couldn't be found.
      "errorCode": "A String", # The error code of an API call.
      "errorMessage": "A String", # An optional descriptive error message.
      "originalUrl": "A String", # The original non-AMP URL.
    },
  ],
}
close()
Close httplib2 connections.