Created
May 21, 2016 15:21
-
-
Save adewale/125f0cb2cb46b6af916a2178064efcc8 to your computer and use it in GitHub Desktop.
How to use the Google AMP URL API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -X POST -H "Content-Type: application/json" -H "X-Goog-Api-Key: FAKE_API_KEY" -d "{urls: ['http://www.theguardian.com/artanddesign/2010/oct/26/eames-furniture-team-charles-ray', 'http://www.theguardian.com/artanddesign/2015/aug/09/millennium-mills-docklands-london-developers-catch-up-last-relic', 'http://www.buzzfeed.com/alexfinnis/places-in-london-every-instagram-lover-needs-to-visit', 'http://www.buzzfeed.com/christinalan/come-eat-dessert-with-me-forever-and-ever', 'http://www.theverge.com/2015/7/20/9002721/the-mobile-web-sucks', 'http://www.theverge.com/2016/5/20/11720352/netflix-gilmore-girls-new-episodes-title-poster', 'http://www.bbc.co.uk/news/election-us-2016-35694116', 'http://www.bbc.com/news/business-36301378']}" "https://acceleratedmobilepageurl.googleapis.com/v1/ampUrls:batchGet" | |
{ | |
"ampUrls": [ | |
{ | |
"originalUrl": "http://www.bbc.com/news/business-36301378", | |
"ampUrl": "http://www.bbc.co.uk/news/amp/36301378", | |
"cdnAmpUrl": "https://cdn.ampproject.org/c/www.bbc.co.uk/news/amp/36301378" | |
}, | |
{ | |
"originalUrl": "http://www.theverge.com/2016/5/20/11720352/netflix-gilmore-girls-new-episodes-title-poster", | |
"ampUrl": "http://www.theverge.com/platform/amp/2016/5/20/11720352/netflix-gilmore-girls-new-episodes-title-poster", | |
"cdnAmpUrl": "https://cdn.ampproject.org/c/www.theverge.com/platform/amp/2016/5/20/11720352/netflix-gilmore-girls-new-episodes-title-poster" | |
}, | |
{ | |
"originalUrl": "http://www.theverge.com/2015/7/20/9002721/the-mobile-web-sucks", | |
"ampUrl": "http://www.theverge.com/platform/amp/2015/7/20/9002721/the-mobile-web-sucks", | |
"cdnAmpUrl": "https://cdn.ampproject.org/c/www.theverge.com/platform/amp/2015/7/20/9002721/the-mobile-web-sucks" | |
}, | |
{ | |
"originalUrl": "http://www.theguardian.com/artanddesign/2015/aug/09/millennium-mills-docklands-london-developers-catch-up-last-relic", | |
"ampUrl": "https://amp.theguardian.com/artanddesign/2015/aug/09/millennium-mills-docklands-london-developers-catch-up-last-relic", | |
"cdnAmpUrl": "https://cdn.ampproject.org/c/s/amp.theguardian.com/artanddesign/2015/aug/09/millennium-mills-docklands-london-developers-catch-up-last-relic" | |
} | |
], | |
"urlErrors": [ | |
{ | |
"errorCode": "NO_AMP_URL", | |
"errorMessage": "AMP URL not found.", | |
"originalUrl": "http://www.buzzfeed.com/christinalan/come-eat-dessert-with-me-forever-and-ever" | |
}, | |
{ | |
"errorCode": "NO_AMP_URL", | |
"errorMessage": "AMP URL not found.", | |
"originalUrl": "http://www.bbc.co.uk/news/election-us-2016-35694116" | |
}, | |
{ | |
"errorCode": "NO_AMP_URL", | |
"errorMessage": "AMP URL not found.", | |
"originalUrl": "http://www.theguardian.com/artanddesign/2010/oct/26/eames-furniture-team-charles-ray" | |
}, | |
{ | |
"errorCode": "INPUT_URL_NOT_FOUND", | |
"errorMessage": "URL not found.", | |
"originalUrl": "http://www.buzzfeed.com/alexfinnis/places-in-london-every-instagram-lover-needs-to-visit" | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment