2024年Mobile-Friendly Test API是否可用?调用遇404问题求助
问题解答
- 核心结论:Google的Mobile-Friendly Test API已在2024年正式停止服务,同时被下线的还有配套的Mobile Usability报告和Mobile-Friendly Test在线工具。
你遇到的404错误正是因为该API的端点已被移除,并非请求代码存在问题。目前已有大量开发者反馈过相同的情况,和你搜索到的信息一致——Google官方确实下架了这些服务。
你的请求代码示例:
$request = new Request('POST', 'https://searchconsole.googleapis.com/v1/urlTestingTools/mobileFriendlyTest:run?key='.$api_key, $headers, $body);
收到的404错误响应:
Client error: POST https://searchconsole.googleapis.com/v1/urlTestingTools/mobileFriendlyTest:run?key=xxxxx resulted in a 404 Not Found response: { "error": { "code": 404, "message": "Requested entity was not found.", "status": "NOT_FOUND" } }
替代方案
如果需要获取页面移动端相关的体验数据,可以使用PageSpeed Insights API,它涵盖了移动端性能、可用性等多维度指标,能满足大部分原Mobile-Friendly Test API的使用需求。
内容的提问来源于stack exchange,提问作者Sam
相关产品推荐
相关产品推荐

