{
  "openapi": "3.0.1",
  "info": {
    "title": "Core Web Vitals & PageSpeed Monitor – CrUX & Lighthouse",
    "description": "Bulk Core Web Vitals & PageSpeed Insights monitor powered by Google's Chrome UX Report (CrUX) API, 25-week CrUX History and Lighthouse. Track LCP, INP, CLS, FCP and TTFB across URLs and sitemaps with regression alerts and Slack digests.",
    "version": "0.1",
    "x-build-id": "3Srh2qSWVfOjzOufh"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/datarelay~core-web-vitals-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-datarelay-core-web-vitals-monitor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/datarelay~core-web-vitals-monitor/runs": {
      "post": {
        "operationId": "runs-sync-datarelay-core-web-vitals-monitor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/datarelay~core-web-vitals-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-datarelay-core-web-vitals-monitor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "urls": {
            "title": "Page URLs",
            "type": "array",
            "description": "List of page URLs to check (e.g. `https://www.wikipedia.org/`). Redirects (`http://` → `https://www.`) are resolved automatically before querying CrUX so redirected URLs do not return false 404s. Give at least one URL in `urls` or one domain in `domains`.",
            "items": {
              "type": "string"
            }
          },
          "domains": {
            "title": "Domains (origins)",
            "type": "array",
            "description": "List of domains or origins (e.g. `wikipedia.org`, `https://shopify.com`). Checks each domain's homepage and origin-level Core Web Vitals; enable `fromSitemap` to also discover and check pages from each domain's sitemap.",
            "items": {
              "type": "string"
            }
          },
          "fromSitemap": {
            "title": "Discover pages from sitemap",
            "type": "boolean",
            "description": "For each entry in `domains`, read `/robots.txt` and `/sitemap.xml` (including `<sitemapindex>`) and check up to `maxPagesPerDomain` URLs.",
            "default": false
          },
          "maxPagesPerDomain": {
            "title": "Max pages per domain (from sitemap)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum number of URLs to take from each domain in `domains` when `fromSitemap` is enabled.",
            "default": 50
          },
          "mode": {
            "title": "Check mode",
            "enum": [
              "field",
              "audit"
            ],
            "type": "string",
            "description": "`field` (default, fast and cheap): real Chrome user metrics from the Chrome UX Report (CrUX) API + weekly trend from CrUX History API. `audit`: adds a Google PageSpeed Insights (Lighthouse) lab audit with 4 category scores, lab metrics and actionable optimization recommendations.",
            "default": "field"
          },
          "devices": {
            "title": "Devices (form factors)",
            "type": "array",
            "description": "Devices to check per page (`phone`, `desktop`, and in `field` mode optionally `tablet`). Each `(page, device)` pair produces one dataset row.",
            "items": {
              "type": "string",
              "enum": [
                "phone",
                "desktop",
                "tablet"
              ],
              "enumTitles": [
                "Phone (mobile)",
                "Desktop",
                "Tablet (field mode only)"
              ]
            },
            "default": [
              "phone",
              "desktop"
            ]
          },
          "includeHistory": {
            "title": "Include CrUX weekly trend (History API)",
            "type": "boolean",
            "description": "Fetch weekly historical p75 series (up to 40 weeks) from the CrUX History API and compute the trend direction (`improving`, `stable`, `worsening`) from the very first run.",
            "default": true
          },
          "historyWeeks": {
            "title": "History window (weeks)",
            "minimum": 1,
            "maximum": 40,
            "type": "integer",
            "description": "Number of weekly collection periods to request from the CrUX History API (1–40; Google's default is 25).",
            "default": 25
          },
          "syncKey": {
            "title": "Monitoring sync key",
            "type": "string",
            "description": "Name of the monitoring memory kept in your account (key-value store `cwv-monitor-sync-<key>`). Compares each page × device against its previous check, flags `changeType` (`first-check`, `worse`, `better`, `unchanged`) and generates regression alerts on stable CrUX metrics. Note: CrUX updates once daily (~04:00 UTC), so schedule runs daily or weekly."
          },
          "onlyChanges": {
            "title": "Deliver only changed pages",
            "type": "boolean",
            "description": "Monitoring: omit unchanged pages from the dataset so your integration receives only `first-check`, `worse` or `better` rows (unchanged checks are billed at the lower `monitor-check-unchanged` rate).",
            "default": false
          },
          "syncReset": {
            "title": "Reset monitoring memory",
            "type": "boolean",
            "description": "Clear the saved state of `syncKey` before this run so all pages are treated as `first-check`.",
            "default": false
          },
          "minChangePercent": {
            "title": "Alert threshold: min p75 change (%)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Minimum percentage worsening in p75 (LCP, INP, CLS, FCP, TTFB) between runs (or across the history window) to flag a metric as changed/degraded, even if its good/needs-improvement/poor rating stayed the same.",
            "default": 10
          },
          "lcpGoodMs": {
            "title": "LCP good threshold (ms)",
            "minimum": 100,
            "maximum": 30000,
            "type": "integer",
            "description": "Largest Contentful Paint p75 threshold for `good` (Google default: 2500 ms).",
            "default": 2500
          },
          "lcpPoorMs": {
            "title": "LCP poor threshold (ms)",
            "minimum": 100,
            "maximum": 60000,
            "type": "integer",
            "description": "Largest Contentful Paint p75 threshold above which a page is rated `poor` (Google default: 4000 ms).",
            "default": 4000
          },
          "inpGoodMs": {
            "title": "INP good threshold (ms)",
            "minimum": 10,
            "maximum": 10000,
            "type": "integer",
            "description": "Interaction to Next Paint p75 threshold for `good` (Google default: 200 ms).",
            "default": 200
          },
          "inpPoorMs": {
            "title": "INP poor threshold (ms)",
            "minimum": 10,
            "maximum": 20000,
            "type": "integer",
            "description": "Interaction to Next Paint p75 threshold above which a page is rated `poor` (Google default: 500 ms).",
            "default": 500
          },
          "clsGood": {
            "title": "CLS good threshold",
            "type": "string",
            "description": "Cumulative Layout Shift p75 threshold for `good` (Google default: `0.1`).",
            "default": "0.1"
          },
          "clsPoor": {
            "title": "CLS poor threshold",
            "type": "string",
            "description": "Cumulative Layout Shift p75 threshold above which a page is rated `poor` (Google default: `0.25`).",
            "default": "0.25"
          },
          "slackWebhookUrl": {
            "title": "Slack webhook URL",
            "type": "string",
            "description": "Send the CWV alert digest to Slack via an incoming webhook (`https://hooks.slack.com/services/…`). In monitoring mode, sent only when at least one page degraded or improved. Stored encrypted."
          },
          "googleApiKey": {
            "title": "Custom Google Cloud API key (optional)",
            "type": "string",
            "description": "Optional: use your own Google Cloud API key (with Chrome UX Report API and, for `audit` mode, PageSpeed Insights API enabled). Recommended when auditing more than ~200 pages in `audit` mode so your run uses your own 30 queries/min PageSpeed Insights project quota. Sent via the `X-goog-api-key` header and never logged."
          },
          "maxPages": {
            "title": "Max pages per run",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of unique URLs to check in this run (each checked across the selected `devices`). 0 = up to 2,000 pages.",
            "default": 200
          },
          "maxRunSecs": {
            "title": "Max run time (seconds)",
            "minimum": 0,
            "type": "integer",
            "description": "Stop starting new checks after this many seconds and keep what was already delivered. 0 = until the run timeout.",
            "default": 0
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}