Download the PHP package smnandre/pagespeed-api without Composer
On this page you can find all versions of the php package smnandre/pagespeed-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download smnandre/pagespeed-api
More information about smnandre/pagespeed-api
Files in smnandre/pagespeed-api
Package pagespeed-api
Short Description PageSpeed Insight PHP Api Client 🚀 Analyse web pages for performances metrics, core web vitals...
License MIT
Informations about the package pagespeed-api
🚀 PageSpeed PHP API Client
This PHP library offers an effortless way to leverage Google's PageSpeed Insights API.
Analyze your web pages for performance metrics, get detailed reports, and optimize your site with ease. 🚀
Installation
Usage
Initialize the API
Run analysis
Parameters
| Parameter | Description | Default |
|---|---|---|
url |
The URL of the page to analyze. | - |
strategy |
The analysis strategy to use. Possible values are mobile or desktop. |
mobile |
locale |
The locale to use for the analysis. | en |
categories |
The categories to analyze. If not specified, all categories will be analyzed. | - |
Report
A display-ready view of an analysis: category scores and Core Web Vitals reached by property, serialisable to array or JSON.
Scores (performance, accessibility, bestPractices, seo) expose value (0-100),
rating (a Rating following the Score Evaluation thresholds), and
category (Category). Metrics (lcp, cls, inp, fcp, fid, ttfb) expose value,
unit, and rating (a Bucket: Fast, Average or Slow). Any property is null when
the underlying data is absent.
Audit Scores
Audit categories
| # | Category | Description |
|---|---|---|
| ⚡ | Performance | Measures how quickly the content on your page loads and becomes interactive. |
| 🌍 | Accessibility | Evaluates how accessible your page is to users, including those with disabilities. |
| 🏆 | Best Practices | Assesses your page against established web development best practices. |
| ⚓ | SEO | Analyzes your page's search engine optimization, ensuring it follows SEO guidelines. |
Score Evaluation
| Min | Max | ⬜️ | Description |
|---|---|---|---|
| 0 | 49 | 🟥🟥🟥🟥🟥⬜️⬜️⬜️⬜️⬜️ | Poor |
| 50 | 89 | 🟧🟧🟧🟧🟧🟧🟧🟧🟧️⬜️️ | Needs improvement |
| 90 | 100 | 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 | Good |
Core Web Vitals
Loading Metrics
Main Metrics
| Abbr | Metric | Description |
|---|---|---|
| FCP | First Contentful Paint | Time taken for the first piece of content to appear on the screen. |
| SI | Speed Index | How quickly the contents of a page are visibly populated. |
| FID | First Input Delay | Time from a user's first interaction to when the browser can respond. |
| CLS | Cumulative Layout Shift | Measure of visual stability; the sum of all individual layout shift scores. |
| LCP | Largest Contentful Paint | Time taken for the largest content element to appear. |
| INP | Interaction to Next Paint | Time from a user interaction to the next visual update in response. |
Contributing
Contributions are welcome! If you would like to contribute, please fork the repository and submit a pull request.
License
The MIT License (MIT). Please see License File for more information.
All versions of pagespeed-api with dependencies
symfony/http-client Version ^7.0 || ^8.0
webmozart/assert Version ^1.11 || ^2.0