Developer API Docs

MachMetrics allows premium users to access their data via a REST API. This gives you the ability to analyze your data using other tools/services, as well as integrate with 3rd party reporting tools such as Klipfolio or Cyfe. Please provide the following documention to your developers for any custom integrations.


Authentication

Send an email to support to be assigned an API key. This key is per account. The 'apikey' must be provided as a GET parameter in all endpoints below.


Endpoints

All methods in version 1 of the API have the base url of https://machmetrics.cloud.tyk.io/api/v1/
Simply append the method name, a slash, and a query string. Each method below has sample requests to clarify further.


Method: averages

Purpose: Get average metrics for multiple urls across entire time period. This is ideal for showing overall performance of many urls.

ParameterDescriptionRequired?Example
apikeyThe api key assigned to you when you upgraded your account.Yesapikey=77963b7a931377ad4ab5ad6a9cd7
formatThe format you want result data returned in.
Possible values: csv
Yesformat=csv
urlidsThe ids of the desired urls. This is the same urlid in the query string of a url while looking at a specific report inside your account. Separate multiple with commas.
Default if omitted is to include all urls in account.
Optionalurlids=123,128
daysHow many days from today to look back. If today is January 15, a value of 10 will give you data from Jan 5 - Jan 15. A value of 1 will give you today only.
Default if omitted is 30, minimum 1, maximum 365.
Optionaldays=14
metricsWhat metrics to return. Separate multiple with commas.
Possible values: ttfb,docload,doccomplete,speedindex,resourcecount,totalkb. Default if omitted is 'doccomplete'.
Optionalmetrics=ttfb,docload,doccomplete
regionsWhat test regions to filter by. Separate multiple with commas.
Possible values: us-east,us-west,europe,australia,japan. Default if omitted is to return data from all regions.
Optionalregions=us-east,us-west
deviceWhat test device to filter by. Specify one value only.
Possible values: desktop or mobile. Default if omitted is to return data from all device types.
Optionaldevice=desktop
viewWhat test view to filter by. Specify one value only.
Possible values: first or repeat. Default if omitted is to return data from all view types.
Optionalview=first

Sample Request:

https://machmetrics.cloud.tyk.io/api/v1/averages/?apikey=XXX&format=csv&days=7&metrics=ttfb,speedindex
				

Sample Response:

"Url Name",ttfb,speedindex
"MachMetrics Home",0.243,1.494
"MachMetrics Home SECURE",0.302,1.037
"MachMetrics Blog",0.421,1.232
"MachMetrics Blog SECURE",0.378,1.13

Method: metric-daily

Purpose: Get average metric value per day for multiple urls. This is ideal for showing performance of one aspect of performance over time across many urls.

ParameterDescriptionRequired?Example
apikeyThe api key assigned to you when you upgraded your account.Yesapikey=77963b7a931377ad4ab5ad6a9cd7
formatThe format you want result data returned in.
Possible values: csv
Yesformat=csv
urlidsThe ids of the desired urls. This is the same urlid in the query string of a url while looking at a specific report inside your account. Separate multiple with commas.
Default if omitted is to include all urls in account.
Optionalurlids=123,128
daysHow many days from today to look back. If today is January 15, a value of 10 will give you data from Jan 5 - Jan 15. A value of 1 will give you today only.
Default if omitted is 30, minimum 1, maximum 365.
Optionaldays=14
metricWhat metric to return. Specify only one.
Possible values: ttfb or docload or doccomplete or speedindex or resourcecount or totalkb. Default if omitted is 'doccomplete'.
Optionalmetric=speedindex
regionsWhat test regions to filter by. Separate multiple with commas.
Possible values: us-east,us-west,europe,australia,japan. Default if omitted is to return data from all regions.
Optionalregions=us-east,us-west
deviceWhat test device to filter by. Specify one value only.
Possible values: desktop or mobile. Default if omitted is to return data from all device types.
Optionaldevice=desktop
viewWhat test view to filter by. Specify one value only.
Possible values: first or repeat. Default if omitted is to return data from all view types.
Optionalview=first

Sample Request:

https://machmetrics.cloud.tyk.io/api/v1/metric-daily/?apikey=XXX&format=csv&urlid=s2,5&days=7&metric=ttfb
				

Sample Response:

Date,MachMetrics,"MachMetrics Blog"
2017-11-02,0.258,0.386
2017-11-03,0.292,0.627
2017-11-04,0.265,0.614
2017-11-05,0.271,0.604
2017-11-06,0.276,0.399
2017-11-07,0.273,0.617
2017-11-08,0.269,0.616
2017-11-09,0.256,0.775

Method: url-daily

Purpose: Get average test result data per day for a specific url. This is ideal for showing multiple aspects of performance over time on one url.

ParameterDescriptionRequired?Example
apikeyThe api key assigned to you when you upgraded your account.Yesapikey=77963b7a931377ad4ab5ad6a9cd7
formatThe format you want result data returned in.
Possible values: csv
Yesformat=csv
urlidThe id of the desired url. This is the same urlid in the query string of a url while looking at a specific report inside your account.Yesurlid=123
daysHow many days from today to look back. If today is January 15, a value of 10 will give you data from Jan 5 - Jan 15. A value of 1 will give you today only.
Default if omitted is 30, minimum 1, maximum 365.
Optionaldays=14
metricsWhat metrics to return. Separate multiple with commas.
Possible values: ttfb,docload,doccomplete,speedindex,resourcecount,totalkb. Default if omitted is 'doccomplete'.
Optionalmetrics=ttfb,docload,doccomplete
regionsWhat test regions to filter by. Separate multiple with commas.
Possible values: us-east,us-west,europe,australia,japan. Default if omitted is to return data from all regions.
Optionalregions=us-east,us-west
deviceWhat test device to filter by. Specify one value only.
Possible values: desktop or mobile. Default if omitted is to return data from all device types.
Optionaldevice=desktop
viewWhat test view to filter by. Specify one value only.
Possible values: first or repeat. Default if omitted is to return data from all view types.
Optionalview=first

Sample Request:

https://machmetrics.cloud.tyk.io/api/v1/url-daily/?apikey=XXX&format=csv&urlid=2&days=7&metrics=ttfb,speedindex
				

Sample Response:

Date,ttfb,speedindex
2017-11-02,0.261,0.556
2017-11-03,0.55,0.83
2017-11-04,0.269,0.534
2017-11-05,0.237,0.512
2017-11-06,0.279,0.534
2017-11-07,0.309,0.615
2017-11-08,0.408,0.73
2017-11-09,0.315,0.613

Method: url-raw

Purpose: Get all test result data for a specific url. If you want to export all tests results for analysis in another tool, this is what you're looking for.

ParameterDescriptionRequired?Example
apikeyThe api key assigned to you when you upgraded your account.Yesapikey=77963b7a931377ad4ab5ad6a9cd7
formatThe format you want result data returned in.
Possible values: csv
Yesformat=csv
urlidThe id of the desired url. This is the same urlid in the query string of a url while looking at a specific report inside your account.Yesurlid=123
daysHow many days from today to look back. If today is January 15, a value of 10 will give you data from Jan 5 - Jan 15. A value of 1 will give you today only.
Default if omitted is 30, minimum 1, maximum 365.
Optionaldays=14
metricsWhat metrics to return. Separate multiple with commas.
Possible values: ttfb,docload,doccomplete,speedindex,resourcecount,totalkb. Default if omitted is 'doccomplete'.
Optionalmetrics=ttfb,docload,doccomplete
regionsWhat test regions to filter by. Separate multiple with commas.
Possible values: us-east,us-west,europe,australia,japan. Default if omitted is to return data from all regions.
Optionalregions=us-east,us-west
deviceWhat test device to filter by. Specify one value only.
Possible values: desktop or mobile. Default if omitted is to return data from all device types.
Optionaldevice=desktop
viewWhat test view to filter by. Specify one value only.
Possible values: first or repeat. Default if omitted is to return data from all view types.
Optionalview=first

Sample Request:

https://machmetrics.cloud.tyk.io/api/v1/url-raw/?apikey=XXX&format=csv&urlid=2&days=2
				

Sample Response:

Date,Device,View,Region,doccomplete
2017-10-17T00:09:58-07:00,Desktop,First,US-West,1.375
2017-10-17T00:09:58-07:00,Desktop,Repeat,US-West,0.658
2017-10-17T00:10:01-07:00,Desktop,First,US-East,2.027
2017-10-17T00:10:01-07:00,Desktop,Repeat,US-East,0.79
2017-10-17T00:10:02-07:00,Desktop,First,Europe,1.771
2017-10-17T00:10:08-07:00,Mobile,First,US-West,1.3
2017-10-17T00:10:08-07:00,Mobile,Repeat,US-West,0.649
2017-10-17T00:10:11-07:00,Mobile,First,US-East,1.357
2017-10-17T00:10:11-07:00,Mobile,Repeat,US-East,0.66
2017-10-17T00:10:14-07:00,Mobile,First,Europe,1.652
2017-10-18T00:09:31-07:00,Desktop,First,US-East,1.388
2017-10-18T00:09:31-07:00,Desktop,Repeat,US-East,0.794
2017-10-18T00:09:42-07:00,Mobile,First,US-East,1.461
2017-10-18T00:09:42-07:00,Mobile,Repeat,US-East,0.718
2017-10-18T00:09:57-07:00,Desktop,First,Europe,1.753
2017-10-18T00:09:57-07:00,Desktop,Repeat,Europe,1.084
2017-10-18T00:10:08-07:00,Mobile,First,Europe,1.647
2017-10-18T00:10:08-07:00,Mobile,Repeat,Europe,0.87
2017-10-18T00:10:42-07:00,Desktop,First,US-West,1.41
2017-10-18T00:10:42-07:00,Desktop,Repeat,US-West,0.723
2017-10-18T00:10:52-07:00,Mobile,First,US-West,1.252
2017-10-18T00:10:52-07:00,Mobile,Repeat,US-West,0.692
2017-10-19T00:09:22-07:00,Desktop,First,US-East,1.341
2017-10-19T00:09:22-07:00,Desktop,Repeat,US-East,0.653
2017-10-19T00:09:32-07:00,Mobile,First,US-East,1.324
2017-10-19T00:09:32-07:00,Mobile,Repeat,US-East,0.702
2017-10-19T00:10:11-07:00,Desktop,First,US-West,1.336
2017-10-19T00:10:11-07:00,Desktop,Repeat,US-West,0.66
2017-10-19T00:10:22-07:00,Mobile,First,US-West,1.234
2017-10-19T00:10:22-07:00,Mobile,Repeat,US-West,0.713
2017-10-19T00:11:23-07:00,Desktop,First,Europe,1.921
2017-10-19T00:11:23-07:00,Desktop,Repeat,Europe,1.136
2017-10-19T00:11:34-07:00,Mobile,First,Europe,1.65
2017-10-19T00:11:34-07:00,Mobile,Repeat,Europe,1.086

Fact: 50% of people expect a site to load in less than 2 seconds.

Your site's load time could be the difference between keeping visitors on your site or losing them to a competitor.

Create Account

30 day free trial. No credit card required.