# W3C Html Reporter (`service-paradis/w3c-html-reporter`) Actor

Get HTML validity reports from various web pages using W3C HTML validator.

- **URL**: https://apify.com/service-paradis/w3c-html-reporter.md
- **Developed by:** [Alexandre Paradis](https://apify.com/service-paradis) (community)
- **Categories:** Developer tools, SEO tools
- **Stats:** 10 total users, 0 monthly users, 100.0% runs succeeded, 2 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## W3C HTML Validity Reporter

The W3C HTML Validity Reporter is an [Apify actor](https://apify.com/actors) that generates reports on the validity of given webpages HTML according to the [W3C HTML Validator](https://validator.w3.org/). The actor takes webpages URL as input and produces reports with detailed information on the validity of the webpages HTML.

### Input

The actor takes the following input:

- `startUrls` (required): The URL of the webpages to validate.
- `proxy` (`Object`): Proxy configuration. You can edit this to use Apify proxy, or provide your own proxy servers. Default value is `{ "useApifyProxy": false }`.
- `debug` (`Boolean`): See detailed logs when activated. Default value is `false`.

### Output

The actor generates a JSON report on the validity of the webpages HTML. The report includes:

- A list of messages given by the validator

### Usage

To use the actor, you'll need an Apify account. If you don't have one, [sign up for free](https://my.apify.com/registrations/start) on the Apify website.

Once you have an account, you can run the actor by creating a new task with the following configuration:

```json
{
  "startUrls": [{
      "url": "https://example.com/"
    }
  ],
  "proxy": {
    "useApifyProxy": false
  },
  "debug": false
}
```

Replace `"https://example.com/"` with the URL of the webpage you want to validate.

Please note that w3c validator use Cloudflare to protect their website against bot. You may need to use Apify proxy in order to use this crawler.

#### Results example

The output from scraping W3C validator is stored in the dataset. Each messsage is stored as an item inside the dataset. After the run is finished, you can download the scraped data onto your computer or export to any web app in various data formats (JSON, CSV, XML, RSS, HTML Table). Here's a few examples of the outputs you can get:

```json
{
  "url": "https://apify.com/",
  "language": "en",
  "severity": "info",
  "lastLine": 10,
  "firstColumn": 301,
  "lastColumn": 357,
  "message": "Trailing slash on void elements has no effect and interacts badly with unquoted attribute values.",
  "markup": "rowser.\"/><meta name=\"twitter:card\" content=\"summary_large_image\"/><meta ",
  "highlightIndex": 10,
  "highlightLength": 57
}
```

```json
{
  "url": "https://apify.com/",
  "language": "en",
  "severity": "warning",
  "firstLine": 614,
  "lastLine": 614,
  "firstColumn": 5684,
  "lastColumn": 5721,
  "message": "Section lacks heading. Consider using “h2”-“h6” elements to add identifying headings to all sections, or else use a “div” element instead for any cases where no heading is needed.",
  "markup": "-0 wwExY\"><section class=\"sc-1913faef-1 jYOdxN\"><div c",
  "highlightIndex": 10,
  "highlightLength": 38
}
```

```json
{
  "url": "https://apify.com/",
  "language": "en",
  "severity": "error",
  "lastLine": 10,
  "firstColumn": 1210,
  "lastColumn": 1272,
  "message": "A “meta” element with an “http-equiv” attribute whose value is “X-UA-Compatible” must have a “content” attribute with the value “IE=edge”.",
  "markup": "ent=\"24\"/><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge,chrome=1\"/><meta ",
  "highlightIndex": 10,
  "highlightLength": 63
}
```

# Actor input Schema

## `startUrls` (type: `array`):

URLs to get W3C HTML validity reports from.

## `proxy` (type: `object`):

You can edit this to use Apify proxy, or provide your own proxy servers.

## `debug` (type: `boolean`):

See detailed logs when activated.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://apify.com/"
    }
  ],
  "proxy": {
    "useApifyProxy": false
  },
  "debug": false
}
```

# 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 = {
    "startUrls": [
        {
            "url": "https://apify.com/"
        }
    ],
    "proxy": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("service-paradis/w3c-html-reporter").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 = {
    "startUrls": [{ "url": "https://apify.com/" }],
    "proxy": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("service-paradis/w3c-html-reporter").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 '{
  "startUrls": [
    {
      "url": "https://apify.com/"
    }
  ],
  "proxy": {
    "useApifyProxy": false
  }
}' |
apify call service-paradis/w3c-html-reporter --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,service-paradis/w3c-html-reporter"
        }
    }
}

```

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/NOOmXbQehTNMgKC2d/builds/U5d2KjOsEDK7TyuAc/openapi.json
