# Quick LH (`genuine_scarecrow/quick-lh`) Actor

Google Lighthouse Performance Checker runs comprehensive audits for performance, accessibility, SEO, and best practices. Test on mobile or desktop with customizable scoring thresholds and multiple output formats for automated monitoring and optimization.

- **URL**: https://apify.com/genuine_scarecrow/quick-lh.md
- **Developed by:** [Ankit Pandey](https://apify.com/genuine_scarecrow) (community)
- **Categories:** Developer tools, SEO tools
- **Features:** Full permissions
- **Stats:** 5 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

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 examples already wired to this Actor's own input schema, see the [API](#api) section below.

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`).

# README

## Google Lighthouse Checker

Comprehensive web performance analysis tool powered by Google Lighthouse. Evaluate your website's performance, accessibility, SEO, and best practices with customizable scoring thresholds and multiple output formats.

### Features

#### Core Capabilities

- **Multi-Device Testing**: Run audits on mobile, desktop, or both device types simultaneously
- **Comprehensive Analysis**: Evaluate performance, accessibility, best practices, and SEO
- **Customizable Score Ranges**: Define your own thresholds for excellent, good, and poor scores
- **Multiple Output Formats**: Generate results as tables, graphs, and charts
- **Flexible Timeout Settings**: Configure evaluation timeouts from 30 to 300 seconds
- **Improvement Suggestions**: Optional detailed recommendations for performance optimization

#### Lighthouse Categories

The actor supports four key Lighthouse audit categories:

1. **Performance** - Page load speed, rendering metrics, and resource optimization
2. **Accessibility** - WCAG compliance and usability for users with disabilities
3. **Best Practices** - Modern web development standards and security
4. **SEO** - Search engine optimization and discoverability

### Input Configuration

#### Required Parameters

- **url** (string, required): The URL of the website to audit
  - Example: `https://apify.com`

#### Optional Parameters

- **apiKey** (string, optional): API key for authentication if required

- **outputFormats** (array, optional): Output format preferences
  - Options: `table`, `graphs`, `charts`
  - Default: `["table"]`

- **evaluationTimeoutInSeconds** (integer, optional): Maximum time for Lighthouse evaluation
  - Range: 30-300 seconds
  - Default: `100`

- **deviceType** (string, optional): Device type for audit simulation
  - Options: `mobile`, `desktop`, `both`
  - Default: `"desktop"`

- **lighthouseCategories** (array, optional): Categories to evaluate
  - Options: `performance`, `accessibility`, `best-practices`, `seo`
  - Default: All categories

- **includeImprovements** (boolean, optional): Include improvement suggestions
  - Default: `false`

- **scoreRanges** (object, optional): Custom score thresholds for each category
  - Each category must have: `excellent`, `good`, `poor` (0-100)
  - Must satisfy: `excellent >= good >= poor`
  - Default ranges: excellent ≥ 90, good ≥ 50, poor ≥ 0

### Sample Input

#### Basic Usage

```json
{
  "url": "https://example.com",
  "deviceType": "desktop",
  "outputFormats": ["table"]
}
```

#### Advanced Configuration

```json
{
  "url": "https://apify.com/ideas/google-lighthouse-checker-44d82046",
  "apiKey": "",
  "outputFormats": ["table", "charts", "graphs"],
  "evaluationTimeoutInSeconds": 100,
  "deviceType": "desktop",
  "lighthouseCategories": ["performance", "accessibility", "best-practices", "seo"],
  "includeImprovements": true,
  "scoreRanges": {
    "performance": {
      "excellent": 90,
      "good": 50,
      "poor": 0
    },
    "accessibility": {
      "excellent": 90,
      "good": 50,
      "poor": 0
    },
    "best-practices": {
      "excellent": 90,
      "good": 50,
      "poor": 0
    },
    "seo": {
      "excellent": 90,
      "good": 50,
      "poor": 0
    }
  }
}
```

#### Multi-Device Testing

```json
{
  "url": "https://example.com",
  "deviceType": "both",
  "outputFormats": ["table", "graphs"],
  "lighthouseCategories": ["performance", "seo"]
}
```

#### Custom Score Thresholds

```json
{
  "url": "https://example.com",
  "deviceType": "mobile",
  "scoreRanges": {
    "performance": {
      "excellent": 95,
      "good": 70,
      "poor": 0
    },
    "accessibility": {
      "excellent": 100,
      "good": 80,
      "poor": 0
    }
  }
}
```

### Output Structure

The actor returns a structured output with the following fields:

```typescript
{
  "success": boolean,
  "report": string,
  "message": string,
  "executionTimeInMs": number
}
```

- **success**: Indicates whether the audit completed successfully
- **report**: Formatted report based on selected output formats
- **message**: Status message or error details
- **executionTimeInMs**: Total execution time of the audit

### Score Interpretation

#### Default Score Ranges

| Category | Excellent | Good | Poor |
|----------|-----------|------|------|
| All | ≥ 90 | 50-89 | 0-49 |

#### Custom Score Ranges

You can customize score thresholds for each category independently. This is useful for:

- Setting stricter standards for critical metrics
- Adjusting thresholds based on industry benchmarks
- Creating custom performance targets aligned with business goals

**Validation Rules:**

- All scores must be between 0-100
- `excellent` must be ≥ `good`
- `good` must be ≥ `poor`

### Use Cases

#### Web Development

- Pre-deployment performance checks
- Continuous integration testing
- Performance regression detection

#### SEO Optimization

- Technical SEO audits
- Mobile-friendliness testing
- Core Web Vitals monitoring

#### Accessibility Compliance

- WCAG compliance verification
- Accessibility issue identification
- Regular accessibility audits

#### Competitive Analysis

- Benchmark against competitors
- Industry standard comparison
- Performance gap analysis

### Best Practices

1. **Timeout Configuration**: For complex sites, increase timeout to 150-200 seconds
2. **Device Testing**: Always test both mobile and desktop for responsive sites
3. **Regular Audits**: Schedule periodic audits to track performance trends
4. **Score Ranges**: Adjust thresholds based on your site's baseline performance
5. **Categories**: Focus on relevant categories for your specific use case

### Error Handling

The actor includes robust validation for:

- Invalid URLs
- Malformed score ranges
- Unsupported categories
- Timeout issues

Invalid configurations are automatically corrected with warnings logged to the console.

### Limitations

- Maximum evaluation timeout: 300 seconds
- Supported categories: performance, accessibility, best-practices, seo only
- Score ranges must follow logical ordering (excellent ≥ good ≥ poor)

### Support

For issues, feature requests, or questions:

- Check the Apify documentation
- Review Lighthouse documentation at [web.dev](https://web.dev/lighthouse)
- Contact support through Apify platform

### Version History

#### Latest Version

- Multi-device testing support
- Customizable score ranges
- Multiple output format options
- Enhanced validation and error handling

***

**Note**: This actor uses Google Lighthouse under the hood. Results may vary based on network conditions, server response times, and other environmental factors. For consistent results, run multiple audits and average the scores.

# Actor input Schema

## `url` (type: `string`):

URL to evaluate with Google Lighthouse.

## `apiKey` (type: `string`):

Optional API key for authentication.

## `outputFormats` (type: `array`):

Formats for the output report.

## `evaluationTimeoutInSeconds` (type: `integer`):

Maximum time allowed for Lighthouse evaluation.

## `deviceType` (type: `string`):

Device type for the Lighthouse audit.

## `lighthouseCategories` (type: `array`):

Categories to evaluate. Defaults to all categories if empty.

## `includeImprovements` (type: `boolean`):

Include improvement suggestions in the report.

## `scoreRanges` (type: `object`):

Custom score thresholds for each category. Each range must have excellent >= good >= poor, all between 0-100.

## Actor input object example

```json
{
  "url": "https://apify.com",
  "outputFormats": [
    "table"
  ],
  "evaluationTimeoutInSeconds": 100,
  "deviceType": "desktop",
  "lighthouseCategories": [
    "performance",
    "accessibility",
    "best-practices",
    "seo"
  ],
  "includeImprovements": false,
  "scoreRanges": {
    "performance": {
      "excellent": 90,
      "good": 50,
      "poor": 0
    },
    "accessibility": {
      "excellent": 90,
      "good": 50,
      "poor": 0
    },
    "best-practices": {
      "excellent": 90,
      "good": 50,
      "poor": 0
    },
    "seo": {
      "excellent": 90,
      "good": 50,
      "poor": 0
    }
  }
}
```

# Actor output Schema

## `success` (type: `string`):

No description

## `report` (type: `string`):

No description

## `message` (type: `string`):

No description

## `executionTimeInMs` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "scoreRanges": {
        "performance": {
            "excellent": 90,
            "good": 50,
            "poor": 0
        },
        "accessibility": {
            "excellent": 90,
            "good": 50,
            "poor": 0
        },
        "best-practices": {
            "excellent": 90,
            "good": 50,
            "poor": 0
        },
        "seo": {
            "excellent": 90,
            "good": 50,
            "poor": 0
        }
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("genuine_scarecrow/quick-lh").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "scoreRanges": {
        "performance": {
            "excellent": 90,
            "good": 50,
            "poor": 0,
        },
        "accessibility": {
            "excellent": 90,
            "good": 50,
            "poor": 0,
        },
        "best-practices": {
            "excellent": 90,
            "good": 50,
            "poor": 0,
        },
        "seo": {
            "excellent": 90,
            "good": 50,
            "poor": 0,
        },
    } }

# Run the Actor and wait for it to finish
run = client.actor("genuine_scarecrow/quick-lh").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "scoreRanges": {
    "performance": {
      "excellent": 90,
      "good": 50,
      "poor": 0
    },
    "accessibility": {
      "excellent": 90,
      "good": 50,
      "poor": 0
    },
    "best-practices": {
      "excellent": 90,
      "good": 50,
      "poor": 0
    },
    "seo": {
      "excellent": 90,
      "good": 50,
      "poor": 0
    }
  }
}' |
apify call genuine_scarecrow/quick-lh --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,genuine_scarecrow/quick-lh"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/LsbYfdbQkHcyaOklw/builds/WABfzZHkXEQiWBhja/openapi.json
