AmputatorBot
AmputatorBot copied to clipboard
URL encoding breaks the API
https://www.amputatorbot.com/api/v1/convert?gac=true&md=3&q=https://amp.cnn.com/cnn/us/live-news/damar-hamlin-collapse-bills-bengals-game-intl-hnk/index.html yields:
[{'amp_canonical': None, 'canonical': {'domain': 'cnn', 'is_alt': False, 'is_amp': False, 'is_cached': None, 'is_valid': True, 'type': 'REL', 'url': 'https://www.cnn.com/us/live-news/damar-hamlin-collapse-bills-bengals-game-intl-hnk/index.html', 'url_similarity': 0.9473684210526315}, 'canonicals': [{'domain': 'cnn', 'is_alt': False, 'is_amp': False, 'is_cached': None, 'is_valid': True, 'type': 'REL', 'url': 'https://www.cnn.com/us/live-news/damar-hamlin-collapse-bills-bengals-game-intl-hnk/index.html', 'url_similarity': 0.9473684210526315}, {'domain': 'cnn', 'is_alt': False, 'is_amp': False, 'is_cached': None, 'is_valid': True, 'type': 'OG_URL', 'url': 'https://www.cnn.com/us/live-news/damar-hamlin-collapse-bills-bengals-game-intl-hnk/index.html', 'url_similarity': 0.9473684210526315}, {'domain': 'cnn', 'is_alt': False, 'is_amp': False, 'is_cached': None, 'is_valid': True, 'type': 'SCHEMA_MAINENTITY', 'url': 'https://www.cnn.com/us/live-news/damar-hamlin-collapse-bills-bengals-game-intl-hnk/index.html', 'url_similarity': 0.9473684210526315}], 'origin': {'domain': 'cnn', 'is_amp': True, 'is_cached': False, 'is_valid': True, 'url': 'https://amp.cnn.com/cnn/us/live-news/damar-hamlin-collapse-bills-bengals-game-intl-hnk/index.html'}}]
whilest https://www.amputatorbot.com/api/v1/convert?gac=True&md=3&q=https%3A%2F%2Famp.cnn.com%2Fcnn%2Fus%2Flive-news%2Fdamar-hamlin-collapse-bills-bengals-game-intl-hnk%2Findex.html yields:
{'error_message': "Error: Entry doesn't meet criteria (no AMP link detected)", 'result_code': 'error_no_amp'}
Yep, ran into this today. Was very confused, because generally the library I'm using for API integrations (Python's requests) Just Does The Right Thing for GET params, but in this case The Right Thing makes the request fail.