# Web Platform Baseline & Compatibility API (`runglab/web-platform-baseline-api`) Actor

Query live W3C/Chrome Web Platform Baseline status (Widely/Newly/Limited), browser ship versions across Chrome, Safari, Firefox & Edge, Web Platform Tests pass scores, and real-world usage telemetry for CSS, JS, and Web APIs—MCP-ready, zero keys.

- **URL**: https://apify.com/runglab/web-platform-baseline-api.md
- **Developed by:** [RungLab](https://apify.com/runglab) (community)
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 feature checkeds

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

## Web Platform Baseline & Browser Compatibility API (WebStatus.dev)

Authoritative, real-time **W3C / Chrome Web Platform Baseline & Browser Compatibility** auditing API for **AI coding agents, frontend architects, CI/CD policy gates, and browser-support compliance teams**.

Queries the official **WebStatus.dev v1 API** (`api.webstatus.dev`) directly over HTTPS to return live **Baseline status** (`widely` / `newly` / `limited`), **exact browser ship versions & release dates** across Chrome, Chrome Android, Edge, Firefox, Firefox Android, Safari, and Safari iOS, **Web Platform Tests (WPT) pass scores**, **real-world Chrome page-load usage telemetry**, **official W3C/WHATWG spec links**, and actionable **AI coding guidance** — **zero proxies, zero API keys, 128–256 MB RAM, MCP-ready**.

***

### Why Engineers & AI Coding Agents Use This Actor

- **Stop Browser-Compatibility Hallucinations**: AI coding agents frequently generate modern CSS or Web APIs (such as `anchor-positioning` or `view-transitions`) without checking cross-browser support or fallbacks. Every record returns `baselineStatus`, `policyCompliant`, `blockingBrowsers`, and an actionable `aiCodingGuidance` verdict.
- **Automated CI / Policy Gating (`widely` / `newly` / `none`)**: Set `policyTarget` to `"widely"` (strict production default: 30+ months cross-browser interoperability), `"newly"` (modern evergreen browsers), or `"none"` (informational) to automatically flag non-compliant APIs and list exact blocking browsers.
- **Live Browser Ship Versions & Dates**: Extracts exact ship versions and dates across all 7 Baseline core browser targets (`chrome`, `chrome_android`, `edge`, `firefox`, `firefox_android`, `safari`, `safari_ios`).
- **Web Platform Tests (WPT) & Real-World Usage Telemetry**: Surfaces per-browser stable & experimental WPT interoperability pass scores plus Chrome Platform Status daily page-load adoption percentages (`chromeUsagePct`).
- **Structured WebStatus.dev Search + Deduplication**: Combine explicit `featureIds` with `searchQuery` (supports WebStatus.dev query syntax like `baseline_status:newly`, `group:css`, `anchor positioning`) with automatic pagination and deduplication by `featureId`.
- **Zero-Config Start & Zero-Proxy Speed**: Click **Start** immediately to audit `["grid", "popover", "container-queries", "view-transitions"]` in ~1 second on 128–256 MB memory.

***

### Input Configuration

| Parameter | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| `featureIds` | `array<string>` | `["grid", "popover", "container-queries", "view-transitions"]` | WebStatus.dev feature IDs to audit. Defaults to `["grid", "popover", "container-queries", "view-transitions"]` when omitted and `searchQuery` is empty. Pass `[]` with `searchQuery` to audit only search hits. |
| `searchQuery` | `string` | `""` | Optional WebStatus.dev search query (e.g., `"baseline_status:newly"`, `"popover"`, `"anchor positioning"`, `"group:css"`). |
| `maxSearchResults` | `integer` | `10` | Maximum features returned from `searchQuery` (`1`–`100`), with automatic `page_token` pagination. |
| `policyTarget` | `string` | `"widely"` | Baseline compliance gate: `"widely"`, `"newly"`, or `"none"`. |
| `compactMode` | `boolean` | `false` | Return streamlined, token-efficient JSON optimized for **Apify MCP** and AI coding agents. |
| `timeoutSeconds` | `integer` | `20` | Per-request HTTP timeout in seconds (`3`–`120`). |

#### Copy-Paste JSON Input (Default Showcase)

```json
{
  "featureIds": ["grid", "popover", "container-queries", "view-transitions"],
  "policyTarget": "widely",
  "compactMode": false
}
```

#### Copy-Paste JSON Input (Search Only, MCP Compact Mode)

```json
{
  "featureIds": [],
  "searchQuery": "baseline_status:newly",
  "maxSearchResults": 10,
  "policyTarget": "newly",
  "compactMode": true
}
```

***

### Example Output Record (`popover` under `policyTarget: "widely"`)

```json
{
  "featureId": "popover",
  "name": "Popover",
  "baselineStatus": "newly",
  "baselineLowDate": "2025-01-27",
  "baselineHighDate": null,
  "policyTarget": "widely",
  "policyCompliant": false,
  "blockingBrowsers": [],
  "policyReason": "Fails 'widely' policy: feature is Baseline Newly Available since 2025-01-27 and has not yet reached the 30-month Widely Available threshold.",
  "aiCodingGuidance": "POLICY BLOCKED FOR 'widely' TARGET (Baseline Newly Available since 2025-01-27): Shipped in Chrome 116+, Edge 116+, Firefox 125+, Safari 17+, Safari iOS 18.3+, but under 30 months old. Gate with feature detection (@supports / runtime check) or provide fallback unless targeting modern evergreen browsers.",
  "chromeVersion": "116",
  "edgeVersion": "116",
  "firefoxVersion": "125",
  "safariVersion": "17",
  "safariIosVersion": "18.3",
  "wptStableAvgPct": 84.2,
  "chromeUsagePct": 4.9,
  "primarySpecUrl": "https://html.spec.whatwg.org/multipage/popover.html",
  "webStatusUrl": "https://webstatus.dev/features/popover"
}
```

***

### SDK & AI Agent Integration

#### Python (`apify-client`)

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")

run = client.actor("YOUR_USERNAME/web-platform-baseline-api").call(
    run_input={
        "featureIds": ["grid", "popover", "container-queries", "view-transitions"],
        "policyTarget": "widely",
        "compactMode": False,
    }
)

for feat in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(feat["featureId"], feat["baselineStatus"], feat["policyCompliant"], feat["aiCodingGuidance"])
```

#### Node.js / TypeScript (`apify-client`)

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

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });

const run = await client.actor('YOUR_USERNAME/web-platform-baseline-api').call({
    featureIds: [],
    searchQuery: 'anchor positioning',
    policyTarget: 'newly',
    compactMode: true,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
for (const feat of items) {
    console.log(`${feat.featureId} [${feat.baselineStatus}] compliant=${feat.policyCompliant}`);
}
```

#### MCP Agent Configuration (Claude Code / Cursor / Windsurf via Apify MCP)

Expose this Actor as a live browser-compatibility & Baseline policy check tool inside your AI coding agent:

```json
{
  "mcpServers": {
    "apify-web-baseline": {
      "url": "https://mcp.apify.com/?actors=YOUR_USERNAME/web-platform-baseline-api",
      "headers": {
        "Authorization": "Bearer <YOUR_APIFY_TOKEN>"
      }
    }
  }
}
```

> **Agent Tip:** Pass `"compactMode": true` when calling via MCP to keep payloads token-efficient while preserving `baselineStatus`, `policyCompliant`, `blockingBrowsers`, `aiCodingGuidance`, `browserVersions`, `wptStableAvgPct`, `chromeUsagePct`, and `primarySpecUrl`.

***

### Pay-Per-Event (PPE) Pricing

| Event | Price | Description |
| :--- | :--- | :--- |
| `actor-start` | `$0.003` | Charged once per Actor run start. |
| `feature-checked` | `$0.001` | Charged once per audited Web Platform feature record pushed to the dataset. |

Runs respect your maximum PPE spending limit automatically and halt gracefully if reached, recording exact counts in the `RUN_SUMMARY` Key-Value Store record.

***

### Authoritative Data Source

All data is fetched live over HTTPS from the official **WebStatus.dev REST API** (backed by W3C WebDX `web-features`, MDN `browser-compat-data`, Web Platform Tests `wpt.fyi`, and Chrome Platform Status) with zero scraping and zero proxies:

- **Feature Lookup**: `https://api.webstatus.dev/v1/features/{feature_id}`
- **Feature Search & Pagination**: `https://api.webstatus.dev/v1/features?q=...&page_size=...&page_token=...`

# Actor input Schema

## `featureIds` (type: `array`):

List of WebStatus.dev / web-features IDs (e.g. 'grid', 'popover', 'container-queries', 'view-transitions', 'anchor-positioning'). Defaults to \['grid', 'popover', 'container-queries', 'view-transitions'] when omitted and searchQuery is empty. Pass \[] with a searchQuery to audit only search results.

## `searchQuery` (type: `string`):

Optional WebStatus.dev query string supporting keywords and structured filters, e.g., 'baseline_status:newly', 'popover', 'anchor positioning', or 'group:css'. Matching features are deduplicated and merged with featureIds.

## `maxSearchResults` (type: `integer`):

Maximum number of features to return from searchQuery (handles API pagination automatically).

## `policyTarget` (type: `string`):

Minimum Web Platform Baseline tier required for policyCompliant=true: 'widely' (Widely Available), 'newly' (Newly or Widely Available), or 'none' (no Baseline gate; informational only).

## `compactMode` (type: `boolean`):

When enabled, emits a streamlined, token-efficient JSON payload ideal for AI coding agents calling this Actor via Apify MCP.

## `timeoutSeconds` (type: `integer`):

Per-request HTTP timeout in seconds for api.webstatus.dev requests.

## Actor input object example

```json
{
  "featureIds": [
    "grid",
    "popover",
    "container-queries",
    "view-transitions"
  ],
  "searchQuery": "",
  "maxSearchResults": 10,
  "policyTarget": "widely",
  "compactMode": false,
  "timeoutSeconds": 20
}
```

# Actor output Schema

## `overview` (type: `string`):

Table view of audited web features with Baseline status, policy compliance, blocking browsers, desktop/mobile ship versions, WPT pass score, and AI coding guidance.

## `browserMatrix` (type: `string`):

Detailed matrix showing Chrome, Edge, Firefox, Safari, and Safari iOS versions, WPT interoperability scores, real-world Chrome usage percentage, and W3C/WHATWG spec URLs.

## `allRecords` (type: `string`):

Full structured JSON dataset including nested per-browser implementation dates, stable/experimental WPT breakdowns, vendor positions, and developer signals.

## `runSummary` (type: `string`):

Policy pass/fail counts, Baseline status breakdown, search diagnostics, and execution stats stored in the Key-Value Store.

# 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 = {
    "featureIds": [
        "grid",
        "popover",
        "container-queries",
        "view-transitions"
    ],
    "searchQuery": ""
};

// Run the Actor and wait for it to finish
const run = await client.actor("runglab/web-platform-baseline-api").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 = {
    "featureIds": [
        "grid",
        "popover",
        "container-queries",
        "view-transitions",
    ],
    "searchQuery": "",
}

# Run the Actor and wait for it to finish
run = client.actor("runglab/web-platform-baseline-api").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 '{
  "featureIds": [
    "grid",
    "popover",
    "container-queries",
    "view-transitions"
  ],
  "searchQuery": ""
}' |
apify call runglab/web-platform-baseline-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,runglab/web-platform-baseline-api"
        }
    }
}
```

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/FN4DLpzurN5ppyEco/builds/mUBQh6MlCwQW2rhlv/openapi.json
