# Lighthouse audit of every page in a sitemap

**Use case:** 

Give a sitemap.xml and run a real Lighthouse audit on its pages: performance, accessibility, best-practices and SEO scores, lab LCP, CLS and TBT, and the top suggested fixes, one row per page. No Google API key needed. $0.02 per audit; failed audits are free. This example audits 5 pages of crawlee.dev on mobile.

## Input

```json
{
  "urls": [
    "https://example.com"
  ],
  "sitemapUrl": "https://crawlee.dev/sitemap.xml",
  "strategies": [
    "mobile"
  ],
  "categories": [
    "performance",
    "accessibility",
    "best-practices",
    "seo"
  ],
  "maxUrls": 5,
  "maxOpportunities": 5,
  "saveFullReport": false,
  "throttlingMethod": "simulate",
  "timeoutSecs": 120
}
```

## Output

```json
{
  "url": {
    "label": "URL",
    "format": "string"
  },
  "strategy": {
    "label": "Device",
    "format": "string"
  },
  "performanceScore": {
    "label": "Performance",
    "format": "integer"
  },
  "lcpMs": {
    "label": "LCP (ms)",
    "format": "integer"
  },
  "cls": {
    "label": "CLS",
    "format": "number"
  },
  "tbtMs": {
    "label": "TBT (ms)",
    "format": "integer"
  },
  "seoScore": {
    "label": "SEO",
    "format": "integer"
  },
  "accessibilityScore": {
    "label": "Accessibility",
    "format": "integer"
  },
  "passedBudgets": {
    "label": "Budgets passed",
    "format": "boolean"
  },
  "errorCode": {
    "label": "Error",
    "format": "string"
  }
}
```

## How it works

### 1. Sign up on Apify or log in

The Bulk Lighthouse & PageSpeed Test: Sitemap, Core Web Vitals Actor is ready to run with the inputs already set for "Lighthouse audit of every page in a sitemap". [Sign up or log in](https://console.apify.com/create-task-from-example/g2grxp7HeJ0ieJNOJ) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Lighthouse audit of every page in a sitemap" task

The Bulk Lighthouse & PageSpeed Test: Sitemap, Core Web Vitals Actor will start running based on the input automatically. You can also change all the input fields, like URLs to audit, sitemap url (optional), and more, to match your specific use case.

### 3. Receive the "Lighthouse audit of every page in a sitemap" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as URL, device, performance, and more.

### 4. Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also [run the "Lighthouse audit of every page in a sitemap" task via API](https://apify.com/datatoolsforall/bulk-lighthouse-pagespeed-audit.md).

## FAQ

### How much does a Lighthouse audit of every page in a sitemap cost?

A Lighthouse audit of every page in a sitemap costs $0.02 per page per device, plus a $0.0001 start fee at the default 2 GB memory. This 5-page mobile example costs about $0.10. Failed audits are free. 'Maximum pages' caps the cost.

### Are these real-user Core Web Vitals?

No. A Lighthouse audit of every page in a sitemap gives lab metrics (LCP, CLS, TBT, FCP, Speed Index, TTFB) from a test browser, not field data from real users. Add your own PageSpeed Insights key to also get CrUX field data.

### Do I need a Google API key?

No. The Lighthouse audit of every page in a sitemap runs Lighthouse inside the actor, with no Google API key or quota. An optional PageSpeed Insights key of your own switches audits to Google's API at $0.003 each.

### Which sitemap formats work?

For a Lighthouse audit of every page in a sitemap, use a sitemap.xml, a sitemap index, an .xml.gz file or a plain-text sitemap. Up to 'Maximum pages from the sitemap' (1 to 1,000) pages are audited.

## About this Actor

This example demonstrates how to use [Bulk Lighthouse & PageSpeed Test: Sitemap, Core Web Vitals](https://apify.com/datatoolsforall/bulk-lighthouse-pagespeed-audit.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/datatoolsforall/bulk-lighthouse-pagespeed-audit.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/datatoolsforall/bulk-lighthouse-pagespeed-audit.md

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).
