The WebPageTest API is RESTful, meaning that commands with parameters are submitted by either sending a
GET request to WebPageTest server PHP endpoints.
The API is not fully normalized; output formats vary from endpoint to endpoint. The vast majority output JSON/JSONP and XML, but some output CSV, TSV, HTML, and plain text.
The WebPageTest UI uses its API, so every command and option found on the user interface has a correspondent in the API.
In this chapter you will learn how to programatically run tests and fetch results from WebPageTest in both public and private instances. This will allow integration with an existing web development pipeline, as well as the automation of the whole process of running a test and reading its results once the test is complete.
Before getting ready to start using the WebPageTest API, you will need direct access to either the public instance of the WebPageTest server at www.webpagetest.org or a private instance of WebPageTest, covered in Chapter 11.
An API key is required for using the public instance at www.webpagetest.org. It’s generally not necessary for private instances of WebPageTest unless required by its administrator. The API key is only used by the run-test endpoint
For the public instance, a trial key can be obtained by filling out a form at http://www.webpagetest.org/getkey.php.
Agreeing with the terms of service is required as the ...