WebPagetest Forums
How to get Custom Metrics using WPT API - Printable Version

+- WebPagetest Forums (https://www.webpagetest.org/forums)
+-- Forum: WebPagetest (/forumdisplay.php?fid=7)
+--- Forum: General Discussion (/forumdisplay.php?fid=25)
+--- Thread: How to get Custom Metrics using WPT API (/showthread.php?tid=13544)



How to get Custom Metrics using WPT API - pganti - 02-17-2015 05:32 PM

I want to programatically get the value for RUM First Paint or other customer metrics you display in detail via an API.

For example if you look at http://www.webpagetest.org/result/150217_5E_6KZ/1/details/ and say I want the values for primaryStart and primaryEnd, whats the best way?


RE: How to get Custom Metrics using WPT API - rviscomi - 02-17-2015 05:54 PM

Custom metrics are included in the API response. For example: http://www.webpagetest.org/result/150217_5E_6KZ/?f=json

You could get primaryStart one of two ways: data.runs[1].firstView['userTime.primaryStart'] or data.runs[1].firstView.userTimes.primaryStart