{
  "openapi": "3.0.1",
  "info": {
    "title": "Bulk PageSpeed / Lighthouse Audit (BYO Google key)",
    "description": "Run Google PageSpeed Insights on many URLs at once. Core Web Vitals, Lighthouse scores, sitemap discovery. Bring your own free Google API key. By Steadfeed.",
    "version": "0.2",
    "x-build-id": "eAAeJkatnh4B1u4xy"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/steadfeed~bulk-pagespeed-audit/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-steadfeed-bulk-pagespeed-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/steadfeed~bulk-pagespeed-audit/runs": {
      "post": {
        "operationId": "runs-sync-steadfeed-bulk-pagespeed-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/steadfeed~bulk-pagespeed-audit/run-sync": {
      "post": {
        "operationId": "run-sync-steadfeed-bulk-pagespeed-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": "URLs to audit",
            "type": "array",
            "description": "1–50 public http(s) page URLs. Combine with sitemapUrls if you want. Duplicate URLs are ignored.",
            "items": {
              "type": "string"
            }
          },
          "sitemapUrls": {
            "title": "Sitemap URLs (optional)",
            "type": "array",
            "description": "Up to 5 public sitemap.xml or sitemap-index URLs. Discovered page URLs are merged with urls (capped by maxUrlsFromSitemap).",
            "items": {
              "type": "string"
            }
          },
          "crawlStartUrls": {
            "title": "Crawl a site from these pages (optional)",
            "type": "array",
            "description": "Up to 5 start pages. The Actor follows same-domain links (breadth-first, honouring robots.txt) to discover more pages to audit, up to Max pages to crawl. Combine with URLs and sitemaps if you like.",
            "items": {
              "type": "string"
            }
          },
          "maxCrawlPages": {
            "title": "Max pages to crawl",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Cap on pages discovered by crawling, including the start pages (1–100). Default 20.",
            "default": 20
          },
          "crawlDepth": {
            "title": "Crawl depth",
            "minimum": 0,
            "maximum": 4,
            "type": "integer",
            "description": "How many link hops from a start page to follow (0–4). Default 2.",
            "default": 2
          },
          "crawlExcludePatterns": {
            "title": "Skip crawled URLs containing…",
            "type": "array",
            "description": "Text fragments (case-insensitive). Crawled URLs containing any of them are skipped, for example /tag/, /cart, ?replytocom.",
            "items": {
              "type": "string"
            }
          },
          "googleApiKey": {
            "title": "Google PageSpeed Insights API key",
            "type": "string",
            "description": "Required for reliable runs. Create a free key in Google Cloud Console with the PageSpeed Insights API enabled. The key is a secret input and is never written to the dataset or logs by this Actor."
          },
          "strategy": {
            "title": "Device strategy",
            "type": "array",
            "description": "Lighthouse strategies to run. Default: mobile only. Each URL × strategy counts as one url-audited event when pricing is enabled.",
            "items": {
              "type": "string",
              "enum": [
                "mobile",
                "desktop"
              ]
            },
            "default": [
              "mobile"
            ]
          },
          "categories": {
            "title": "Lighthouse categories",
            "type": "array",
            "description": "Categories to request from PSI. Default: all four.",
            "items": {
              "type": "string",
              "enum": [
                "performance",
                "accessibility",
                "best-practices",
                "seo"
              ]
            },
            "default": [
              "performance",
              "accessibility",
              "best-practices",
              "seo"
            ]
          },
          "generateReport": {
            "title": "Write summary report",
            "type": "boolean",
            "description": "Save REPORT.md and REPORT.html (score tables, averages, weakest pages, most common opportunities) in the run's key-value store. Default true. No extra charge.",
            "default": true
          },
          "maxUrlsFromSitemap": {
            "title": "Max URLs from sitemaps",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Cap on page URLs discovered from sitemaps (1–100). Default 20.",
            "default": 20
          },
          "maxAudits": {
            "title": "Max audits per run",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Safety cap on URL × device audits in one run (1–500). Default 200. Each successful audit is one url-audited event.",
            "default": 200
          },
          "respectRobotsTxt": {
            "title": "Respect robots.txt when crawling",
            "type": "boolean",
            "description": "Crawling skips pages that robots.txt disallows for this Actor. Default true. (Google fetches the audited pages itself.)",
            "default": true
          },
          "requestIntervalMs": {
            "title": "Min delay between same-host requests (ms)",
            "minimum": 200,
            "maximum": 30000,
            "type": "integer",
            "description": "Polite spacing. 200–30000; default 1000.",
            "default": 1000
          },
          "maxRetries": {
            "title": "Retries for transient PSI failures",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Retries for network errors and 429/5xx. 0–5; default 2.",
            "default": 2
          },
          "dryRun": {
            "title": "Dry run (mock PSI)",
            "type": "boolean",
            "description": "When true, no Google API calls are made; deterministic mock scores are returned. Useful for wiring tests. Default false.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}