{
  "openapi": "3.0.1",
  "info": {
    "title": "PageSpeed Insights & Core Web Vitals Bulk Checker",
    "description": "Bulk-check Google PageSpeed Insights for many URLs on mobile and desktop: performance score, Core Web Vitals (LCP, INP, CLS), CrUX real-user data, and alerts plus a webhook when a page gets slower than last run. Uses your own free Google API key. Failed audits are free.",
    "version": "0.1",
    "x-build-id": "3rMqaozgVkDQ71UT1"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/grace_hartwell~pagespeed-cwv-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-grace_hartwell-pagespeed-cwv-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/grace_hartwell~pagespeed-cwv-monitor/runs": {
      "post": {
        "operationId": "runs-sync-grace_hartwell-pagespeed-cwv-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/grace_hartwell~pagespeed-cwv-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-grace_hartwell-pagespeed-cwv-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 audit. Each URL is audited once per selected strategy.",
            "default": [
              {
                "url": "https://example.com/"
              }
            ],
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "apiKey": {
            "title": "Google API key",
            "type": "string",
            "description": "Your own Google Cloud API key with the 'PageSpeed Insights API' (and optionally 'Chrome UX Report API') enabled. Stored encrypted by Apify; never logged. Free quota: 25,000 PSI requests/day, 150 CrUX requests/minute. Without a key, Google allows (almost) no requests: audits are then skipped (free) with status \"skipped_no_api_key\"."
          },
          "strategies": {
            "title": "Strategies",
            "type": "array",
            "description": "mobile and/or desktop.",
            "items": {
              "type": "string",
              "enum": [
                "mobile",
                "desktop"
              ],
              "enumTitles": [
                "Mobile",
                "Desktop"
              ]
            },
            "default": [
              "mobile",
              "desktop"
            ]
          },
          "categories": {
            "title": "Extra Lighthouse categories",
            "type": "array",
            "description": "Performance is always included. Add accessibility, best-practices or seo scores if needed.",
            "items": {
              "type": "string",
              "enum": [
                "accessibility",
                "best-practices",
                "seo"
              ],
              "enumTitles": [
                "Accessibility",
                "Best practices",
                "SEO"
              ]
            },
            "default": []
          },
          "includeCrux": {
            "title": "Add CrUX real-user data (field data)",
            "type": "boolean",
            "description": "Query the Chrome UX Report API for p75 LCP, INP, CLS, FCP, TTFB (URL level, falls back to origin). Requires the API key.",
            "default": true
          },
          "compareWithPrevious": {
            "title": "Compare with previous run",
            "type": "boolean",
            "description": "Load the last result per URL+strategy from the monitor's key-value store and report deltas + regressions.",
            "default": true
          },
          "stateKey": {
            "title": "Monitor name (state key)",
            "type": "string",
            "description": "History is stored in the key-value store cwv-monitor-<name>. Use different names for different projects.",
            "default": "default"
          },
          "thresholds": {
            "title": "Alert thresholds",
            "type": "object",
            "description": "maxScoreDrop (points), maxLcpIncreasePct, maxTbtIncreasePct, maxClsIncrease, maxInpIncreasePct, and optional absolute budgets minPerformanceScore, lcpBudgetMs, clsBudget, inpBudgetMs (0 = off)."
          },
          "webhookUrl": {
            "title": "Alert webhook URL",
            "type": "string",
            "description": "Optional: receives one POST with all alerts of the run (JSON) – e.g. Slack/Make/Zapier/n8n webhook. Sent only if there are alerts."
          },
          "alertOnly": {
            "title": "Only store items with alerts in the dataset",
            "type": "boolean",
            "description": "All URLs are still audited (and charged) and the history is updated.",
            "default": false
          },
          "maxConcurrency": {
            "title": "Parallel audits",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "PSI audits take 10–60 s each. Keep this low to stay within your Google quota.",
            "default": 3
          },
          "requestTimeoutSecs": {
            "title": "API timeout (seconds)",
            "minimum": 30,
            "maximum": 300,
            "type": "integer",
            "description": "Timeout per PageSpeed Insights call.",
            "default": 120
          },
          "maxRetries": {
            "title": "Max retries",
            "minimum": 0,
            "maximum": 8,
            "type": "integer",
            "description": "Retries for rate limits (429), server errors and timeouts, with exponential backoff.",
            "default": 4
          },
          "maxRetryAfterSecs": {
            "title": "Max wait for Retry-After (seconds)",
            "minimum": 0,
            "maximum": 600,
            "type": "integer",
            "description": "When Google answers 429/503 with a Retry-After header (seconds or HTTP date), the Actor waits that long – but at most this many seconds – before retrying. Without the header, exponential backoff is used.",
            "default": 60
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}