{
  "openapi": "3.0.1",
  "info": {
    "title": "PageSpeed Insights API - Core Web Vitals & Lighthouse Bulk",
    "description": "Bulk Core Web Vitals and Lighthouse audits for any list of URLs. Works with no API key: time to first byte, transfer size, render-blocking resources, images without dimensions and caching, charged nothing. Add a free Google key for full Lighthouse scores and CrUX field data.",
    "version": "0.1",
    "x-build-id": "yVN3lKHTHWFM5CqXs"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/lost.fany~pagespeed-insights-core-web-vitals/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-lost.fany-pagespeed-insights-core-web-vitals",
        "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/lost.fany~pagespeed-insights-core-web-vitals/runs": {
      "post": {
        "operationId": "runs-sync-lost.fany-pagespeed-insights-core-web-vitals",
        "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/lost.fany~pagespeed-insights-core-web-vitals/run-sync": {
      "post": {
        "operationId": "run-sync-lost.fany-pagespeed-insights-core-web-vitals",
        "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",
        "required": [
          "urls"
        ],
        "properties": {
          "urls": {
            "title": "URLs to audit",
            "type": "array",
            "description": "Page URLs to run through the PageSpeed Insights API, one per line (https:// is added when missing). Every URL is a separate Lighthouse run of 10-30 seconds, so keep lists realistic: a few dozen URLs per run with your own API key. Pages must be publicly reachable — no logins, no localhost.",
            "items": {
              "type": "string"
            }
          },
          "strategy": {
            "title": "Device",
            "enum": [
              "mobile",
              "desktop",
              "both"
            ],
            "type": "string",
            "description": "Which device Lighthouse emulates. 'Both' audits every URL twice (mobile and desktop) and returns two rows per URL — it also doubles the time and the cost.",
            "default": "mobile"
          },
          "categories": {
            "title": "Lighthouse categories",
            "type": "array",
            "description": "Which Lighthouse categories to score. Each extra category makes the audit slightly slower. PWA was removed in Lighthouse 12 and may be rejected by Google — expect an empty score for it.",
            "items": {
              "type": "string",
              "enum": [
                "performance",
                "accessibility",
                "best-practices",
                "seo",
                "pwa"
              ],
              "enumTitles": [
                "Performance (Core Web Vitals)",
                "Accessibility",
                "Best practices",
                "SEO",
                "PWA (legacy)"
              ]
            },
            "default": [
              "performance",
              "seo"
            ]
          },
          "apiKey": {
            "title": "Google API key (optional - unlocks Lighthouse)",
            "type": "string",
            "description": "Without a key the Actor measures the pages itself: time to first byte, transfer size, render-blocking resources, images without dimensions and caching - those basic rows are never charged. With a free key from Google Cloud (PageSpeed Insights API) you get the full Lighthouse audit: performance, SEO and accessibility scores, lab metrics and CrUX field data."
          },
          "maxConcurrency": {
            "title": "Concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Parallel audits. Google's per-minute quota is the real limit: keep 2-4 without an API key, up to 10 with one.",
            "default": 4
          },
          "requestTimeoutSecs": {
            "title": "Timeout (s)",
            "minimum": 10,
            "maximum": 300,
            "type": "integer",
            "description": "Per API call. A Lighthouse run on a heavy page can take a minute, so values under 60 produce timeouts.",
            "default": 90
          },
          "maxRetries": {
            "title": "Retries",
            "minimum": 0,
            "maximum": 6,
            "type": "integer",
            "description": "Retries with exponential backoff on quota (429), server (5xx) and timeout errors. A 400 on an unreachable page is never retried.",
            "default": 3
          },
          "topOpportunities": {
            "title": "Optimization opportunities per row",
            "minimum": 0,
            "maximum": 20,
            "type": "integer",
            "description": "How many Lighthouse opportunities (biggest estimated savings first) to keep in every row.",
            "default": 5
          },
          "maxItems": {
            "title": "Max rows",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after this many rows (URL + device combinations).",
            "default": 1000
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Optional. Applies to the calls to googleapis.com, not to the audited pages — Google loads those itself. Useful only to spread the keyless quota over several IPs.",
            "default": {
              "useApifyProxy": false
            }
          },
          "dryRun": {
            "title": "Estimate only (no charge)",
            "type": "boolean",
            "description": "Count every result and show what a full run would cost, without charging for it. Only a few sample rows are stored. Use it to check the price before you pay.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}