{
  "openapi": "3.0.1",
  "info": {
    "title": "PageSpeed Insights Bulk Audit — Lighthouse & Core Web Vitals",
    "description": "Audit many URLs with Google's official PageSpeed Insights API: Lighthouse scores, real-user Core Web Vitals (CrUX) next to lab metrics, mobile and desktop in one row, ranked fix suggestions, sitemap input and change tracking. Pay per audit plus a small start fee, no platform fees.",
    "version": "1.0",
    "x-build-id": "QoCOmJd92iNHXlUsW"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/aaronoptimus~pagespeed-insights-bulk-audit/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-aaronoptimus-pagespeed-insights-bulk-audit",
        "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/aaronoptimus~pagespeed-insights-bulk-audit/runs": {
      "post": {
        "operationId": "runs-sync-aaronoptimus-pagespeed-insights-bulk-audit",
        "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/aaronoptimus~pagespeed-insights-bulk-audit/run-sync": {
      "post": {
        "operationId": "run-sync-aaronoptimus-pagespeed-insights-bulk-audit",
        "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": "Pages to audit, one per line. A bare domain like example.com is read as https://example.com/. Duplicates are skipped.",
            "items": {
              "type": "string"
            }
          },
          "sitemapUrls": {
            "title": "Sitemaps (optional)",
            "type": "array",
            "description": "Audit the pages listed in a sitemap. Accepts sitemap.xml, sitemap indexes, .xml.gz files, robots.txt or just the site's home page (its robots.txt or /sitemap.xml is used). Reading sitemaps is free.",
            "items": {
              "type": "string"
            }
          },
          "maxUrlsFromSitemaps": {
            "title": "Max pages from sitemaps",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Stop collecting sitemap pages after this many (all sitemaps together).",
            "default": 100
          },
          "apiKey": {
            "title": "Google API key (optional for up to 25 pages)",
            "type": "string",
            "description": "Leave empty for small runs: the shared built-in key audits up to 25 pages per run. For more, add your own free PageSpeed Insights key (about 2 minutes): open developers.google.com/speed/docs/insights/v5/get-started, click \"Get a Key\", sign in, copy the key (starts with AIza) and paste it here. It gives you your own daily quota. Apify stores it encrypted; this Actor never logs or saves it. Tip: save it in an Apify Task so you only paste it once."
          },
          "devices": {
            "title": "Devices",
            "enum": [
              "both",
              "mobile",
              "desktop"
            ],
            "type": "string",
            "description": "Mobile uses a mid-range phone on a slow 4G connection, desktop a fast connection, exactly like pagespeed.web.dev. Each device is one audit.",
            "default": "both"
          },
          "categories": {
            "title": "Lighthouse categories",
            "type": "array",
            "description": "Scores to compute. All four cost the same; fewer can be a little faster. Lab metrics and fix suggestions need Performance. Real-user (Core Web Vitals) data is always included when Google has it.",
            "items": {
              "type": "string",
              "enum": [
                "performance",
                "accessibility",
                "best-practices",
                "seo"
              ],
              "enumTitles": [
                "Performance",
                "Accessibility",
                "Best practices",
                "SEO"
              ]
            },
            "default": [
              "performance",
              "accessibility",
              "best-practices",
              "seo"
            ]
          },
          "locale": {
            "title": "Report language",
            "type": "string",
            "description": "Language of the audit titles and display values, e.g. en, de, fr, es, pt-BR, ja.",
            "default": "en"
          },
          "maxOpportunities": {
            "title": "Fix suggestions per audit",
            "minimum": 0,
            "maximum": 50,
            "type": "integer",
            "description": "How many improvement suggestions (with estimated time savings) to include per page and device, biggest first. 0 leaves them out.",
            "default": 10
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "perUrl",
              "perDevice"
            ],
            "type": "string",
            "description": "One row per page with mobile and desktop side by side, or one row per page and device (easier to filter and chart).",
            "default": "perUrl"
          },
          "trackChanges": {
            "title": "Compare with the previous run",
            "type": "boolean",
            "description": "For scheduled monitoring: remembers each page's scores in a named storage in your Apify account and adds a \"change\" object (score and metric differences) plus regressed: true when a score drops 10+ points or Core Web Vitals go from passed to failed.",
            "default": false
          },
          "historyStoreName": {
            "title": "History storage name",
            "type": "string",
            "description": "Name of the key-value store that keeps the previous scores. Use a different name per client or schedule to keep their histories apart.",
            "default": "pagespeed-audit-history"
          },
          "saveFullReports": {
            "title": "Save full Lighthouse reports",
            "type": "boolean",
            "description": "Also store the complete PageSpeed Insights JSON for every audit in the run's key-value store; each row gets a fullReportUrl. Useful for custom analysis; makes runs a little slower.",
            "default": false
          },
          "maxUrls": {
            "title": "Max pages per run",
            "minimum": 1,
            "type": "integer",
            "description": "Optional cap on the number of pages audited in this run (typed URLs first, then sitemap pages). Leave empty for no cap."
          },
          "maxConcurrency": {
            "title": "Parallel audits",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many audits run at the same time. Each audit takes 10–30 seconds, so 8 parallel audits are fast and stay well inside Google's per-minute limit. If Google reports its per-minute limit, all audits pause briefly and continue.",
            "default": 8
          },
          "maxRetries": {
            "title": "Retries per audit",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Retries when Google's server errors or a page loads unreliably (for example the page painted nothing). Permanent problems such as DNS failures or 404 pages are not retried.",
            "default": 2
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}