Michael
Michael

Reputation: 11

AMP URL API not returning valid AMP page

The AMP URL API is not returning an AMP URL despite having a live valid AMP page. The AMP page has been live for 1+ months and serves to Google Search.

Canonical URL: https://www.zales.com/rings

AMP URL: https://www.zales.com/amp/rings

Example

Request:

https://content-acceleratedmobilepageurl.googleapis.com/v1/ampUrls:batchGet?alt=json&key=API_KEY

Request payload:

{"urls":["https://www.zales.com/rings"]}

Response:

{
  "urlErrors": [
    {
      "errorCode": "NO_AMP_URL",
      "errorMessage": "No AMP URL for the request URL.",
      "originalUrl": "https://www.zales.com/rings"
    }
  ]
}

Upvotes: 1

Views: 334

Answers (1)

James Ives
James Ives

Reputation: 3365

I don't think there's any issue with how you're calling the API at all, according to their documentation this should work correctly. I've even tried running the ampbyexample.com site through the validator, and several of my own AMP pages, and all return the same error, with and without a lookup strategy.

{
  "urlErrors": [
    {
      "errorCode": "NO_AMP_URL",
      "errorMessage": "No AMP URL for the request URL.",
      "originalUrl": "https://ampbyexample.com/"
    }
  ]
}

Another sample:

{
  "urls": [
    "https://jamesiv.es/python/2017/07/18/discord-wow-bot"
  ],
  "lookupStrategy": "FETCH_LIVE_DOC"
}

With the same error despite there being a valid document:

{
  "urlErrors": [
    {
      "errorCode": "NO_AMP_URL",
      "errorMessage": "No AMP URL for the request URL.",
      "originalUrl": "https://jamesiv.es/python/2017/07/18/discord-wow-bot"
    }
  ]
}

It might be worth posting a bug report for this on Github incase someone from Google's AMP team doesn't see this.

Upvotes: 1

Related Questions