Gain webpage performance insights with Google PageSpeed Insights.
See the PageSpeed API reference for a list of optional parameters.
$pagespeed = new \Crgeary\Pagespeed\Service();
$data = $pagespeed->runPagespeed('https://github.com/crgeary/pagespeed', [
'key' => 'your-pagespeed-api-key',
'screenshot' => true
]);
You can then access properties from the response as shown below:
echo $data->responseCode;
If you discover any security issues, please email dev@crgeary.com.
The MIT License (MIT).