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
Show Screenshot Test Versions
Show Screenshot Test Version Results
Run Automated Screenshots
Show Screenshot Tests
Returns a list of all screenshot tests ran
API Call:http://crossbrowsertesting.com/api/screenshots/showHTTP Method:
GET or POSTRequires Authentication:
true
| Param | Value | Default | Required | Description |
|---|---|---|---|---|
format | xml,json | xml | false | The format of the returned data. |
page | <integer> | 1 | false | Specify the page of results to return. There are 100 results per page, such that page=3 will return results 200-299. |
curl --user username:password http://crossbrowsertesting.com/api/screenshots/showreturn data as JSON using CURL:
curl -d format=json --user username:password http://crossbrowsertesting.com/api/screenshots/showreturn data as JSON using HTTP GET method:
http://username:password@crossbrowsertesting.com/api/screenshots/show?format=json&page=2
<?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:http://crossbrowsertesting.com/api/screenshots/<test id>/showHTTP Method:
GET or POSTRequires Authentication:
true
| Param | Value | Default | Required | Description |
|---|---|---|---|---|
format | xml,json | xml | false | The format of the returned data. |
page | <integer> | 1 | false | Specify the page of results to return. There are 100 results per page, such that page=3 will return results 200-299. |
http://username:password@crossbrowsertesting.com/api/screenshots/536/show?format=xml
<?xml version="1.0" encoding="utf-8" ?>
<test>
<id>536</id>
<url>http://www.vmware.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_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>
</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_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 taken during this test that were unsuccessful
Show Screenshot Test Version Results
Returns a list of screenshot results from a single version of an automated test
API Call:http://crossbrowsertesting.com/api/screenshots/<test id>/version/<version id>/showHTTP Method:
GET or POSTRequires Authentication:
true
| Param | Value | Default | Required | Description |
|---|---|---|---|---|
format | xml,json | xml | false | The format of the returned data. |
page | <integer> | 1 | false | Specify the page of results to return. There are 100 results per page, such that page=3 will return results 200-299. |
http://username:password@crossbrowsertesting.com/api/screenshots/536/version/321/show
...
<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:http://crossbrowsertesting.com/api/screenshots/<test id>/version/<version id>/runHTTP Method:
GET or POSTRequires Authentication:
true
| Param | Value | Default | Required | Description |
|---|---|---|---|---|
format | xml,json | xml | false | The format of the returned data. |
url | http://www.yourdomain.com | <original url> | false | If not supplied, repeats test on same URL. If supplied, performs same browser tests across new URL. |
http://crossbrowsertesting.com/api/screenshots/1234/version/123456/runrepeat test on new URL:
http://crossbrowsertesting.com/api/screenshots/1234/version/123456/run?url=http://www.domain.com/newpage
<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> <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
- <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:http://crossbrowsertesting.com/api/livetests/configsHTTP Method:
GET or POSTRequires Authentication:
trueReturns: a list of configurations for OS/Browser combinations
| Param | Value | Default | Required | Description |
|---|---|---|---|---|
format | xml,json | xml | false | The format of the returned data. |
http://username:password@crossbrowsertesting.com/api/screenshots/showreturn data as JSON:
http://username:password@crossbrowsertesting.com/api/screenshots/show?format=json
<?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:http://crossbrowsertesting.com/console.phpHTTP Method:
GET or POSTRequires Authentication:
true
| Param | Required | Description |
|---|---|---|
user | optional | The account username or email. |
pass | optional | The account password. |
url | optional | The page to launch in the requested browser |
browser_id | optional | The unique reference to a browser. |
config_id | optional | The unique reference to a configuration. If used in place of browser_id, the default browser for the configuration is launched. |
res_id | optional | The 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.
http://crossbrowsertesting.com/console.php?browser_id=137&url=http%3A%2F%2Fwww.yahoo.comlaunch at 1600x1800:
http://crossbrowsertesting.com/console.php?browser_id=83&res_id=9&url=http%3A%2F%2Fwww.yahoo.comlaunch with automatic sign-in:
http://crossbrowsertesting.com/console.php?browser_id=83&url=http%3A%2F%2Fwww.yahoo.com&user=tester&pass=123launch with config_id:
http://crossbrowsertesting.com/console.php?config_id=17&url=http%3A%2F%2Fwww.yahoo.com
