{
  "openapi": "3.0.1",
  "info": {
    "title": "Core Web Vitals Monitor: CrUX + Lighthouse, Trends & Alerts",
    "description": "Bulk Core Web Vitals for whole sites: real-user CrUX field data (URL with origin fallback), Lighthouse lab audits, 40-week trends and regression alerts between scheduled runs. Sitemap-driven sampling per page template. Bring your own Google API key for unlimited volume.",
    "version": "0.1",
    "x-build-id": "3DsNu2a2KPuf0cHTw"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/benexe~core-web-vitals-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-benexe-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/benexe~core-web-vitals-monitor/runs": {
      "post": {
        "operationId": "runs-sync-benexe-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/benexe~core-web-vitals-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-benexe-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": "URLs",
            "type": "array",
            "description": "Pages to check. Provide URLs, sitemaps, or both.",
            "items": {
              "type": "string"
            }
          },
          "sitemapUrls": {
            "title": "Sitemaps",
            "type": "array",
            "description": "XML sitemap or sitemap index URLs (gzip supported). URLs are grouped by page template (WordPress core, Yoast and Rank Math sitemap names are recognised) and sampled.",
            "items": {
              "type": "string"
            }
          },
          "samplesPerTemplate": {
            "title": "Samples per template",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "URLs tested per template (per site) when using sitemaps. Selection is deterministic: the same URLs are re-tested on every run.",
            "default": 3
          },
          "templateRules": {
            "title": "Template rules (optional)",
            "type": "array",
            "description": "Override template detection. Items: {\"name\": \"product\", \"pattern\": \"/shop/\"} (regex tested on the URL)."
          },
          "maxUrls": {
            "title": "Max URLs per run",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Hard cap after sampling.",
            "default": 100
          },
          "formFactors": {
            "title": "Devices",
            "type": "array",
            "description": "PHONE and/or DESKTOP (applies to field and lab data).",
            "items": {
              "type": "string",
              "enum": [
                "PHONE",
                "DESKTOP"
              ],
              "enumTitles": [
                "Mobile",
                "Desktop"
              ]
            },
            "default": [
              "PHONE"
            ]
          },
          "includeField": {
            "title": "Field data (CrUX, real users)",
            "type": "boolean",
            "description": "28-day p75 LCP, INP, CLS, FCP, TTFB from the Chrome UX Report. Falls back to origin-level data when the URL has too little traffic.",
            "default": true
          },
          "includeLab": {
            "title": "Lab audit (Lighthouse via PageSpeed Insights)",
            "type": "boolean",
            "description": "Performance score, lab metrics and top 5 opportunities. Turn off for cheap scheduled monitoring (field-only).",
            "default": true
          },
          "includeHistory": {
            "title": "Trends (CrUX History)",
            "type": "boolean",
            "description": "Weekly p75 series for one representative URL per site and template (origin fallback) and a trend label.",
            "default": false
          },
          "historyPeriods": {
            "title": "Trend length (weeks)",
            "minimum": 1,
            "maximum": 40,
            "type": "integer",
            "description": "Number of weekly collection periods (1–40).",
            "default": 25
          },
          "monitorId": {
            "title": "Monitor ID (for regression alerts)",
            "type": "string",
            "description": "Set a name (letters, digits, hyphens) to compare each run with the previous one and flag regressions. The snapshot is stored in your account in the key-value store \"cwv-monitor-<id>\"."
          },
          "regressionThresholds": {
            "title": "Regression thresholds",
            "type": "object",
            "description": "p75IncreasePct: flag when a field p75 worsens by more than this % (default 10). labScoreDrop: flag when the lab score drops by more than this many points (default 15). A field metric moving to a worse category is always flagged."
          },
          "googleApiKey": {
            "title": "Your Google API key (optional, recommended for large runs)",
            "type": "string",
            "description": "Google Cloud API key with \"Chrome UX Report API\" and \"PageSpeed Insights API\" enabled. Removes the free-plan lab limit and uses your own Google quota. Stored encrypted; never logged."
          },
          "healthCheck": {
            "title": "Health check mode",
            "type": "boolean",
            "description": "Internal: runs a fixed known-good input and validates the output. Never charged.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}