'An experimental API for testing the mobile-friendliness of a URL'

Method: urlTestingTools.mobileFriendlyTest.run

Stay organized with collections Save and categorize content based on your preferences.

Runs Mobile-Friendly Test for a given URL.

HTTP request

POST https://searchconsole.googleapis.com/v1/urlTestingTools/mobileFriendlyTest:run

(This URI uses URI Template syntax.)

Request body

The request body contains data with the following structure:

JSON representation
{
  "url": string,
  "requestScreenshot": boolean,
}
Fields
url

string

URL for inspection.

requestScreenshot

boolean

Whether or not screenshot is requested. Default is false.

Response body

If successful, the response body contains data with the following structure:

Mobile-friendly test response, including mobile-friendly issues and resource issues.

JSON representation
{
  "testStatus": {
    object(TestStatus)
  },
  "mobileFriendliness": enum(MobileFriendlyTestResult),
  "mobileFriendlyIssues": [
    {
      object(MobileFriendlyIssue)
    }
  ],
  "resourceIssues": [
    {
      object(ResourceIssue)
    }
  ],
  "screenshot": {
    object(Image)
  },
}
Fields
testStatus

object(TestStatus)

Final state of the test, can be either complete or an error.

mobileFriendliness

enum(MobileFriendlyTestResult)

Test verdict, whether the page is mobile friendly or not.

mobileFriendlyIssues[]

object(MobileFriendlyIssue)

List of mobile-usability issues.

resourceIssues[]

object(ResourceIssue)

Information about embedded resources issues.

screenshot

object(Image)

Screenshot of the requested URL.

TestStatus

Final state of the test, including error details if necessary.

JSON representation
{
  "status": enum(TestStatusEnum),
  "details": string,
}
Fields
status

enum(TestStatusEnum)

Status of the test.

details

string

Error details if applicable.

TestStatusEnum

Status enum of the test.

Enums
TEST_STATUS_UNSPECIFIED Internal error when running this test. Please try running the test again.
COMPLETE Inspection has completed without errors.
INTERNAL_ERROR Inspection terminated in an error state. This indicates a problem in Google's infrastructure, not a user error. Please try again later.
PAGE_UNREACHABLE Google cannot access the URL because of a user error such as a robots.txt blockage, a 403 or 500 code etc. Please make sure that the URL provided is accessible by Googlebot and is not password protected.

MobileFriendlyTestResult

Mobile-friendliness test result.

Enums
MOBILE_FRIENDLY_TEST_RESULT_UNSPECIFIED Internal error when running this test. Please try running the test again.
MOBILE_FRIENDLY The page is mobile friendly.
NOT_MOBILE_FRIENDLY The page is not mobile friendly.

MobileFriendlyIssue

Mobile-friendly issue.

JSON representation
{
  "rule": enum(MobileFriendlyRule),
}
Fields
rule

enum(MobileFriendlyRule)

Rule violated.

MobileFriendlyRule

Supported mobile-usability rules.

Enums
MOBILE_FRIENDLY_RULE_UNSPECIFIED Unknown rule. Sorry, we don't have any description for the rule that was broken.
USES_INCOMPATIBLE_PLUGINS Plugins incompatible with mobile devices are being used. Learn more.
CONFIGURE_VIEWPORT Viewport is not specified using the meta viewport tag. Learn more.
FIXED_WIDTH_VIEWPORT Viewport defined to a fixed width. Learn more.
SIZE_CONTENT_TO_VIEWPORT Content not sized to viewport. Learn more.
USE_LEGIBLE_FONT_SIZES Font size is too small for easy reading on a small screen. Learn More.
TAP_TARGETS_TOO_CLOSE Touch elements are too close to each other. Learn more.

ResourceIssue

Information about a resource with an issue.

JSON representation
{
  "blockedResource": {
    object(BlockedResource)
  },
}
Fields
blockedResource

object(BlockedResource)

Describes a blocked resource issue.

BlockedResource

Blocked resource.

JSON representation
{
  "url": string,
}
Fields
url

string

URL of the blocked resource.

Image

Describe image data.

JSON representation
{
  "data": string,
  "mimeType": string,
}
Fields
data

string (bytes format)

Image data in format determined by the MIME type. Currently, the format will always be "image/png", but this might change in the future.

A base64-encoded string.

mimeType

string

The MIME type of the image data.

Try it!