Skip to Content
Using WebPageTest
book

Using WebPageTest

by Rick Viscomi, Andy Davies, Marcel Duran
October 2015
Beginner
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.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

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