---
name: seo-audit-pagespeed
description: Test website performance using Google PageSpeed Insights API. Gets Lighthouse scores (performance, accessibility, SEO, best practices) and Core Web Vitals (LCP, CLS, FCP, TBT) for mobile and desktop. No MCP server needed — uses the free public API.
disable-model-invocation: true
allowed-tools: Bash
argument-hint: "[url1] [url2] [url3] ..."
---

# SEO Audit: PageSpeed Insights (Core Web Vitals)

Test each provided URL against the Google PageSpeed Insights API for both mobile and desktop.

## For each URL:

### 1. Run mobile test
```bash
curl -s "https://www.googleapis.com/pagespeedonline/v5/runPagespeed?url=URL_HERE&strategy=mobile&category=performance&category=accessibility&category=best-practices&category=seo&key=YOUR_API_KEY"
```

### 2. Run desktop test
```bash
curl -s "https://www.googleapis.com/pagespeedonline/v5/runPagespeed?url=URL_HERE&strategy=desktop&category=performance&category=accessibility&category=best-practices&category=seo&key=YOUR_API_KEY"
```

## Setup

Get a free API key from Google Cloud Console:
1. Go to https://console.cloud.google.com/apis/credentials
2. Create a new API key
3. Enable the "PageSpeed Insights API"
4. Replace `YOUR_API_KEY` in the commands above

## Collect from the response:

### Lighthouse Scores (0-100)
- Performance score
- Accessibility score
- Best Practices score
- SEO score

### Core Web Vitals
- **LCP** (Largest Contentful Paint) — Good: ≤ 2.5s
- **CLS** (Cumulative Layout Shift) — Good: ≤ 0.1
- **FCP** (First Contentful Paint) — Good: ≤ 1.8s
- **TBT** (Total Blocking Time) — proxy for INP
- **Speed Index**
- **Time to Interactive**

## Output:
Save a structured report with all scores and metrics per URL, per strategy (mobile/desktop).

## Important:
- Always test mobile AND desktop — scores can differ significantly
- Flag any metric that fails the "Good" threshold
- Note whether CrUX field data is available (real user data) vs lab-only
- The API has rate limits — add a short delay between requests if testing multiple URLs
