Skip to Main Content
Using WebPageTest
book

Using WebPageTest

by Rick Viscomi, Andy Davies, Marcel Duran
October 2015
Beginner content levelBeginner
214 pages
4h 30m
English
O'Reilly Media, Inc.
Content preview from Using WebPageTest

Chapter 9. WebPageTest API

The WebPageTest API is RESTful, meaning that commands with parameters are submitted by either sending a POST or 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.

Getting Started

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.

Requesting a Key

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 /runtest.php.

Public instance

For the public instance, a trial key can be obtained by filling out a form at http://www.webpagetest.org/getkey.php.

Tip

Agreeing with the terms of service is required as the ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Reducing MTTD for High-Severity Incidents

Reducing MTTD for High-Severity Incidents

Tammy Bütow, Michael Kehoe, Jay Holler, Rodney Lester, Ramin Keene, Jordan Pritchard

Publisher Resources

ISBN: 9781491902783Errata Page