We have published first version of our website speed test API, and to make it easier to use we also published simple command line interface tool which uses it.

Source code for AppBeat CLI tool is written in C# on top of cross-platform .NET Core platform and is available on GitHub. Installation instructions are available on our Website Speed Test page.

For example, if you would like to test page speed from Asia you would simply run following AppBeat CLI command:

dotnet AppBeat.CLI.dll page-speed Asia http://www.your-webpage.com

If you are adventurous enough to use our API directly, here is how to do this :)

First, you have to obtain AppBeat API Access Key which you can get for free, but you have to have AppBeat account (Sign Up here).
Then you would have to POST json message (content type should be set to application/json) to https://web1.appbeat.io/API/v1/page-speed or https://web2.appbeat.io/API/v1/page-speed

Posted json message should have following fields:

{ “Secret”: “YOUR_APPBEAT_SECRET_KEY”, “Url”: “URL_YOU_WANT_TO_TEST”, “Location”: “TEST_LOCATION” }

Where TEST_LOCATION should be Europe or NorthAmerica or Asia.

In return you should get json response with unique test id. Then periodically call AppBeat API server (with few seconds in-between) and ask it if results are available. You do this by sending HTTP GET request to https://web1.appbeat.io/API/v1/page-speed?secret=YOUR_APPBEAT_SECRET_KEY&id=SUBMITTED_TEST_ID or https://web2.appbeat.io/API/v1/page-speed?secret=YOUR_APPBEAT_SECRET_KEY&id=SUBMITTED_TEST_ID

Test is completed when Status property in json response is not Submitted or Pending anymore (it can take up to minute or two to start your test from our submitted test que).

You can also check our C# source code of our AppBeat CLI tool which implements this logic. Relevant code is located at:

As always, your feedback, questions and feature requests are welcome! You can contact us here.