API Documentation

Go To:   AUTOMATED SCREENSHOT API   |   LIVE TEST API

Using the screenshot API you can build custom scripts to automate screenshot tests, retrieve the results, and display the images to meet the needs of your quality control process. The Live Test API allows you to retrieve a list of available configuration and create custom one-click links to Live Tests. Note: Using the API to resell the services is prohibited.

Automated Screenshot API 

Show Screenshot Tests 

Returns a list of all screenshot tests ran

API Call:
URL: http://crossbrowsertesting.com/api/screenshots/show
HTTP Method: GET or POST
Requires Authentication: true
Parameters:
ParamValueDefaultRequiredDescription
formatxml,jsonxmlfalseThe format of the returned data.
page<integer>1falseSpecify the page of results to return. There are 100 results per page, such that page=3 will return results 200-299.
Examples:
return data as XML using CURL:   curl --user username:password http://crossbrowsertesting.com/api/screenshots/show
return data as JSON using CURL:   curl -d format=json --user username:password http://crossbrowsertesting.com/api/screenshots/show
return data as JSON using HTTP GET method:   http://username:password@crossbrowsertesting.com/api/screenshots/show?format=json&page=2
Sample Result:
<?xml version="1.0" encoding="utf-8" ?>
<tests>
    <test>
        <id>2691</id>
        <url>http://www.google.com/</url>
        <test_api_show_url>http://crossbrowsertesting.com/api/screenshots/2691/show</test_api_show_url>
        <test_date>2009-11-29 11:24:09</test_date>
    </test>
    <test>
        <id>2388</id>
        <url>http://www.yahoo.com/</url>
        <test_api_show_url>http://crossbrowsertesting.com/api/screenshots/2388/show</test_api_show_url>
        <test_date>2009-11-22 10:19:08</test_date>
    </test>
...
</tests>

This api call returns a repeating element of <test> tags, one for each automated screenshot test ran in order of most recent to oldest.

  • <id> - unique ID for this test (needed for additional API calls)
  • <url> - the URL of the page screenshots were requested for
  • <test_api_show_url> - the API URL for retrieving screenshot versions
  • <test_date> - the date/time this test was run

Show Screenshot Test Versions 

Returns a list of versions for an automated screenshot test

API Call:
URL: http://crossbrowsertesting.com/api/screenshots/<test id>/show
HTTP Method: GET or POST
Requires Authentication: true
Parameters:
ParamValueDefaultRequiredDescription
formatxml,jsonxmlfalseThe format of the returned data.
page<integer>1falseSpecify the page of results to return. There are 100 results per page, such that page=3 will return results 200-299.
Examples:
return data as XML using HTTP GET method:   http://username:password@crossbrowsertesting.com/api/screenshots/536/show?format=xml
Sample Result:
<?xml version="1.0" encoding="utf-8" ?>
<test>
    <id>536</id>
    <url>http://www.google.com/</url>
    <test_date>2009-09-26 21:32</test_date>
    <versions>
        <version>
            <version_api_show_url>http://crossbrowsertesting.com/api/screenshots/536/version/936/show</version_api_show_url>
            <version_api_run_url>http://crossbrowsertesting.com/api/screenshots/536/version/936/run</version_api_run_url>
            <version_ui_url>http://crossbrowsertesting.com/users/username/screenshots/536/936</version_ui_url>
            <version_public_url>http://crossbrowsertesting.com/users/123/screenshots/abcdef12345678/public</version_public_url>
            <version_zip>http://crossbrowsertesting.com/users/username/screenshots/536/936/zip</version_zip>
            <id>936</id>
            <version_date>2009-09-26 21:32</version_date>
            <count_successful>10</count_successful>
            <count_not_finished>0</count_not_finished>
            <count_failed>0</count_failed>
            <w3c_html_errors>2</w3c_html_errors>
            <w3c_html_warnings>11</w3c_html_warnings>
            <w3c_css_errors>0</w3c_css_errors>
        </version>
    </versions>
</test>

This api call returns a repeating element of <version> tags, one for each version of an automated screenshot test run on our system, in order of most recent to oldest.

  • <version_api_show_url> - the API URL for retrieving screenshot results for this test version
  • <version_api_run_url> - the API URL for repeating this automated screenshot test version
  • <version_ui_url> - the URL for viewing a web page of the screenshot results for this test version
  • <version_public_url> - the public URL for sharing the screenshot results for this test version
  • <version_zip> - the URL for downloading a zip file of all successful screenshot results from this test version
  • <id> - unique ID of this test version needed for additional API calls
  • <version_date> - the date/time this test version was run
  • <count_successful> - the count of successful screenshots taken during this test
  • <count_not_finished> - the count of screenshots still processing for this test
  • <count_failed> - the count of screenshots that failed to complete for this test
  • <w3c_html_errors> - number of html errors reported by w3c for this url
  • <w3c_html_warnings> - number of html warnings reported by w3c for this url
  • <w3c_css_errors> - number of css errors reported by w3c for this url

Show Screenshot Test Version Results 

Returns a list of screenshot results from a single version of an automated test

API Call:
URL: http://crossbrowsertesting.com/api/screenshots/<test id>/version/<version id>/show
HTTP Method: GET or POST
Requires Authentication: true
Parameters:
ParamValueDefaultRequiredDescription
formatxml,jsonxmlfalseThe format of the returned data.
page<integer>1falseSpecify the page of results to return. There are 100 results per page, such that page=3 will return results 200-299.
Examples:
return data as XML using HTTP GET method:   http://username:password@crossbrowsertesting.com/api/screenshots/536/version/321/show
Sample Result:
...
<result>
    <id>6772</id>
    <start_date>2009-09-26 21:32:55</start_date>
    <finished_date>2009-09-26 21:33</finished_date>
    <status>complete</status>
    <os>Mac OSX 10.5.8</os>
    <browser>Safari 4</browser>
    <resolution>1024x768</resolution>
    <live_test_url>http://crossbrowsertesting.com/console.php?tloid=6772</live_test_url>
    <windowed_thumb>http://media.crossbrowsertesting.com/users/1/screenshots/window/thumbs/zc154fb5f8fb267d278a.png</windowed_thumb>
    <windowed>http://media.crossbrowsertesting.com/users/1/screenshots/window/zc154fb5f8fb267d278a.png</windowed>
    <full_page_thumb>http://media.crossbrowsertesting.com/users/1/screenshots/full/thumbs/zc154fb5f8fb267d278a.png</full_page_thumb>
    <full_page>http://media.crossbrowsertesting.com/users/1/screenshots/full/zc154fb5f8fb267d278a.png</full_page>
</result>
...

This api call returns a repeating element of <result> tags, one for each OS, browser, resolution requested for this screenshot test.

  • <id> - unique ID for this screenshot result
  • <start_date> - date/time screenshot started
  • <finished_date> - date/time screenshot finished
  • <status> - current status of the screenshot
  • <os> - operating system
  • <browser> - browser
  • <resolution> - resolution
  • <live_test_url> - URL for viewing the page in a Live Test session
  • <windowed_thumb> - thumbnail of the windowed screenshot
  • <windowed> - windowed screenshot
  • <full_page_thumb> - thumbnail of the full page screenshot
  • <full_page> - full page screenshot

Run Automated Screenshots 

Run a new version of an existing screenshot test. This new screenshot test is based on a previous manually run test. To decide what browsers to run, manually create a screenshot test and select the browsers and resolutions. You can then use the Run Automated Screenshot test method below to either repeat this test, or run a new test based on these browsers / resolutions by specifying the url.

API Call:
URL: http://crossbrowsertesting.com/api/screenshots/<test id>/version/<version id>/run
HTTP Method: GET or POST
Requires Authentication: true
Parameters:
ParamValueDefaultRequiredDescription
formatxml,jsonxmlfalseThe format of the returned data.
urlhttp://www.yourdomain.com<original url>falseIf not supplied, repeats test on same URL. If supplied, performs same browser tests across new URL.
Examples:
repeat test:   http://crossbrowsertesting.com/api/screenshots/1234/version/123456/run
repeat test on new URL:   http://crossbrowsertesting.com/api/screenshots/1234/version/123456/run?url=http://www.domain.com/newpage
Sample Result:
<result>
	<status>ok</status>
	<test_id>536</test_id>
	<version_id>936</version_id>
	<result_api_url>http://crossbrowsertesting.com/api/screenshots/536/version/936/show</result_api_url>
	<result_ui_url>http://crossbrowsertesting.com/users/username/screenshots/536/936</result_ui_url>
        <result_ui_share_url>http://crossbrowsertesting.com/users/123/screenshots/abcdef12345678/public</result_ui_share_url>
        <status_message>Test initiated</status_message>
</result>

This api call returns a <result> element for the initiated screenshot test indicating it's status and link to URL's for the results. If the call fails, only an error message is returned.

  • <status> - status of request. Always "ok" for successful screenshots.
  • <test_id> - the unique id of the test. Remains the same for tests on the same URL, but is updated if a new URL is provided.
  • <version_id> - the unique version id for this test.
  • <result_api_url> - the API URL for retrieving screenshot results for this test version
  • <result_ui_url> - the URL for viewing screenshot results for this test version
  • <result_ui_share_url> - the public URL for sharing screenshot results for this test version
  • <status_message> - Verbose status of the test requested.

Live Test API 

List Test Configurations 

Access a list of available configurations for Live Tests.

API Call:
URL: http://crossbrowsertesting.com/api/livetests/configs
HTTP Method: GET or POST
Requires Authentication: false
Returns: a list of configurations for OS/Browser combinations
Parameters:
ParamValueDefaultRequiredDescription
formatxml,jsonxmlfalseThe format of the returned data.
Examples:
return data as XML:   http://crossbrowsertesting.com/api/livetests/configs
return data as JSON:   http://crossbrowsertesting.com/api/livetests/configs?format=json
Sample Result:
<?xml version="1.0" encoding="utf-8" ?>
<configs>
    ...
    <config config_id="17" device="desktop" type="Microsoft" version="Windows XP Service Pack 3" name="Windows XP SP3">
        <browsers>
            <browser browser_id="308" type="Firefox" version="4" name="Firefox 4" default="false" />
            <browser browser_id="276" type="Firefox" version="5" name="Firefox 5" default="false" />
            <browser browser_id="291" type="Chrome" version="13" name="Google Chrome 13" default="false" />
            <browser browser_id="137" type="Internet Explorer" version="8" name="Internet Explorer 8" default="true" />
            <browser browser_id="219" type="Opera" version="10.60" name="Opera 10.60" default="false" />
            <browser browser_id="218" type="Safari" version="5" name="Safari 5" default="false" />
        </browsers>
        <other_software>
            <software type="Adobe Reader" version="X" name="Adobe Reader X" />
            <software type="Firebug" version=" " name="Firebug" />
            <software type="Flash" version="10" name="Flash 10" />
            <software type="Silverlight" version="4" name="Silverlight 4" />
        </other_software>
        <resolutions>
            <resolution res_id="7" width="800" height="600" default="false">800x600</resolution>
            <resolution res_id="8" width="1024" height="768" default="true">1024x768</resolution>
            <resolution res_id="29" width="1152" height="864" default="false">1152x864</resolution>
            <resolution res_id="33" width="1280" height="960" default="false">1280x960</resolution>
            <resolution res_id="37" width="1280" height="1024" default="false">1280x1024</resolution>
            <resolution res_id="41" width="1400" height="1050" default="false">1400x1050</resolution>
            <resolution res_id="211" width="1440" height="900" default="false">1440x900</resolution>
            <resolution res_id="9" width="1600" height="1200" default="false">1600x1200</resolution>
        </resolutions>
    </config>
    ...
</configs>

Using this XML model, you can build links for quick access to test a URL on a browser.

Build Live Test Links 

Build links for launching Live Test configurations to a URL. Using the "List Test Configurations" API call, you have access to the id's of the configurations. The following details the structure of the hyperlinks for quick access to Live Tests. This is not an API call itself.

Hyperlink Syntax:
Base URL: http://crossbrowsertesting.com/console.php
HTTP Method: GET or POST
Requires Authentication: true
Parameters:
ParamRequiredDescription
useroptionalThe account username or email.
passoptionalThe account password.
urloptionalThe page to launch in the requested browser
browser_idoptionalThe unique reference to a browser.
config_idoptionalThe unique reference to a configuration. If used in place of browser_id, the default browser for the configuration is launched.
res_idoptionalThe resolution for the live test display. If not provided, the default resolution is launched (1024x768 for desktops).

Notes:

  • Special characters should be encoded, most notably the "url" parameter.
  • Login credentials can be provided, but are not necessary on browsers already signed in to the website. Alternatively, the user will be prompted for username and password if credentials are not provided and the user is not already signed in.
  • If the "user" parameter is provided with no password, the username is pre-filled. This can be used to ensure the user signs in with a specific account and only needs to enter a password.

Examples:
launch yahoo.com on Windows XP / Internet Explorer 8:   http://crossbrowsertesting.com/console.php?browser_id=137&url=http%3A%2F%2Fwww.yahoo.com
launch at 1600x1800:   http://crossbrowsertesting.com/console.php?browser_id=83&res_id=9&url=http%3A%2F%2Fwww.yahoo.com
launch with automatic sign-in:   http://crossbrowsertesting.com/console.php?browser_id=83&url=http%3A%2F%2Fwww.yahoo.com&user=tester&pass=123
launch with config_id:   http://crossbrowsertesting.com/console.php?config_id=17&url=http%3A%2F%2Fwww.yahoo.com