{
  "openapi": "3.1.0",
  "info": {
    "title": "analyser.dev API",
    "version": "1.0.0",
    "description": "Scan web pages for performance, SEO and AI-search readiness, and read results for your tracked sites. Guide: https://analyser.dev/docs/api",
    "contact": {
      "email": "support@analyser.dev",
      "url": "https://analyser.dev/docs/api"
    }
  },
  "servers": [
    {
      "url": "https://analyser.dev/api/v1"
    }
  ],
  "security": [
    {
      "apiKey": []
    }
  ],
  "tags": [
    {
      "name": "Scans",
      "description": "Scan any public URL. A scan takes about a minute and checks mobile and desktop. Start one, poll it until status is done or failed, then read the scores or the full report."
    },
    {
      "name": "Team",
      "description": "An API key belongs to one team and acts with admin rights on it."
    },
    {
      "name": "Sites and tracked pages",
      "description": "Sites and tracked pages are on paid plans. Tracked pages are scanned on a schedule; you can also scan one now."
    },
    {
      "name": "Alerts"
    },
    {
      "name": "Indexing",
      "description": "Send pages to search engines. IndexNow needs the site's key file verified; Search Console needs a linked property (both set up in the app)."
    }
  ],
  "paths": {
    "/scans": {
      "post": {
        "tags": [
          "Scans"
        ],
        "summary": "Start a scan",
        "description": "Queues a scan of a public URL for your team. If the same URL was scanned in the last few minutes, that scan is returned (cached: true) and doesn't count against limits.",
        "operationId": "postScans",
        "responses": {
          "200": {
            "description": "OK. Every response is wrapped in {\"data\": …}.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ScanResponse"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Scan limit for your plan reached; Retry-After says when to try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "example": "https://example.com/pricing"
                  },
                  "device": {
                    "type": "string",
                    "enum": [
                      "both",
                      "mobile",
                      "desktop"
                    ],
                    "description": "Default both."
                  }
                },
                "required": [
                  "url"
                ]
              }
            }
          }
        }
      }
    },
    "/scans/{id}": {
      "get": {
        "tags": [
          "Scans"
        ],
        "summary": "Get a scan",
        "description": "Status, scores and headline metrics. Poll every few seconds until status is done or failed.",
        "operationId": "getScansId",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK. Every response is wrapped in {\"data\": …}.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ScanResponse"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Scan limit for your plan reached; Retry-After says when to try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/scans/{id}/report": {
      "get": {
        "tags": [
          "Scans"
        ],
        "summary": "Get the full report",
        "description": "Every finding with its evidence and fix, per category, plus details such as the request waterfall, AI-crawler access and structured data. Returns 409 until the scan is done. Top-level keys include scores, metrics, findings (each with id, category, severity, title, message, fix and evidence), top_fixes, and per-category details under performance, seo and geo.",
        "operationId": "getScansIdReport",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK. Every response is wrapped in {\"data\": …}.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Scan limit for your plan reached; Retry-After says when to try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/teams/{teamId}/scans": {
      "get": {
        "tags": [
          "Scans"
        ],
        "summary": "List your team's scans",
        "operationId": "getTeamsTeamIdScans",
        "parameters": [
          {
            "name": "teamId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "From GET /teams."
          },
          {
            "name": "page_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Filter by URL substring."
          },
          {
            "name": "before",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "For paging: created_at of the last scan you have."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK. Every response is wrapped in {\"data\": …}.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Scan"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Scan limit for your plan reached; Retry-After says when to try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/teams": {
      "get": {
        "tags": [
          "Team"
        ],
        "summary": "Get your team",
        "description": "With an API key, returns the key's team: use its id in the paths below.",
        "operationId": "getTeams",
        "responses": {
          "200": {
            "description": "OK. Every response is wrapped in {\"data\": …}.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Team"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Scan limit for your plan reached; Retry-After says when to try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/teams/{teamId}/sites": {
      "get": {
        "tags": [
          "Sites and tracked pages"
        ],
        "summary": "List sites",
        "description": "Each site with its latest homepage scores, page count, open alerts and indexing setup.",
        "operationId": "getTeamsTeamIdSites",
        "parameters": [
          {
            "name": "teamId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "From GET /teams."
          }
        ],
        "responses": {
          "200": {
            "description": "OK. Every response is wrapped in {\"data\": …}.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Site"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Scan limit for your plan reached; Retry-After says when to try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/teams/{teamId}/sites/{siteId}": {
      "get": {
        "tags": [
          "Sites and tracked pages"
        ],
        "summary": "Get a site",
        "operationId": "getTeamsTeamIdSitesSiteId",
        "parameters": [
          {
            "name": "teamId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "From GET /teams."
          },
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK. Every response is wrapped in {\"data\": …}.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Scan limit for your plan reached; Retry-After says when to try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/teams/{teamId}/sites/{siteId}/pages": {
      "get": {
        "tags": [
          "Sites and tracked pages"
        ],
        "summary": "List tracked pages",
        "description": "Each page with its latest finished scan per device.",
        "operationId": "getTeamsTeamIdSitesSiteIdPages",
        "parameters": [
          {
            "name": "teamId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "From GET /teams."
          },
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK. Every response is wrapped in {\"data\": …}.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Page"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Scan limit for your plan reached; Retry-After says when to try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Sites and tracked pages"
        ],
        "summary": "Track a page",
        "operationId": "postTeamsTeamIdSitesSiteIdPages",
        "parameters": [
          {
            "name": "teamId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "From GET /teams."
          },
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK. Every response is wrapped in {\"data\": …}.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Page"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Scan limit for your plan reached; Retry-After says when to try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "Must be on the site's origin."
                  },
                  "frequency": {
                    "type": "string",
                    "enum": [
                      "hourly",
                      "daily",
                      "weekly"
                    ],
                    "description": "Plan-limited; default daily."
                  },
                  "devices": {
                    "type": "array",
                    "description": "Default [\"mobile\",\"desktop\"].",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "url"
                ]
              }
            }
          }
        }
      }
    },
    "/teams/{teamId}/sites/{siteId}/pages/{pageId}/scan": {
      "post": {
        "tags": [
          "Sites and tracked pages"
        ],
        "summary": "Scan a tracked page now",
        "description": "Counts against the same limits as other scans. Returns the queued scan(s).",
        "operationId": "postTeamsTeamIdSitesSiteIdPagesPageIdScan",
        "parameters": [
          {
            "name": "teamId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "From GET /teams."
          },
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK. Every response is wrapped in {\"data\": …}.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Scan"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Scan limit for your plan reached; Retry-After says when to try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/teams/{teamId}/sites/{siteId}/pages/{pageId}/history": {
      "get": {
        "tags": [
          "Sites and tracked pages"
        ],
        "summary": "Score and metric history",
        "operationId": "getTeamsTeamIdSitesSiteIdPagesPageIdHistory",
        "parameters": [
          {
            "name": "teamId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "From GET /teams."
          },
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "device",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "mobile",
                "desktop"
              ],
              "default": "mobile"
            }
          },
          {
            "name": "days",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 30
            },
            "description": "Up to your plan's history."
          }
        ],
        "responses": {
          "200": {
            "description": "OK. Every response is wrapped in {\"data\": …}.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/HistoryPoint"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Scan limit for your plan reached; Retry-After says when to try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/teams/{teamId}/alerts": {
      "get": {
        "tags": [
          "Alerts"
        ],
        "summary": "List alerts",
        "operationId": "getTeamsTeamIdAlerts",
        "parameters": [
          {
            "name": "teamId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "From GET /teams."
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "resolved"
              ]
            }
          },
          {
            "name": "site_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK. Every response is wrapped in {\"data\": …}.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Alert"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Scan limit for your plan reached; Retry-After says when to try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/teams/{teamId}/sites/{siteId}/indexnow/submit": {
      "post": {
        "tags": [
          "Indexing"
        ],
        "summary": "Submit URLs to IndexNow",
        "description": "Sends the given URLs (or, with no body, all tracked pages) to Bing, Yandex, Naver and Seznam.",
        "operationId": "postTeamsTeamIdSitesSiteIdIndexnowSubmit",
        "parameters": [
          {
            "name": "teamId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "From GET /teams."
          },
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK. Every response is wrapped in {\"data\": …}.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Scan limit for your plan reached; Retry-After says when to try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "urls": {
                    "type": "array",
                    "description": "URLs on the site; optional.",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/teams/{teamId}/sites/{siteId}/gsc/sitemaps": {
      "post": {
        "tags": [
          "Indexing"
        ],
        "summary": "Resubmit the sitemap to Search Console",
        "operationId": "postTeamsTeamIdSitesSiteIdGscSitemaps",
        "parameters": [
          {
            "name": "teamId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "From GET /teams."
          },
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK. Every response is wrapped in {\"data\": …}.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Scan limit for your plan reached; Retry-After says when to try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "sitemap_url": {
                    "type": "string",
                    "description": "Default: the sitemap auto-indexing found, else /sitemap.xml."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/teams/{teamId}/sites/{siteId}/indexing": {
      "get": {
        "tags": [
          "Indexing"
        ],
        "summary": "Auto-indexing status",
        "description": "Daily sitemap watch, recent new and updated pages, and where they were submitted.",
        "operationId": "getTeamsTeamIdSitesSiteIdIndexing",
        "parameters": [
          {
            "name": "teamId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "From GET /teams."
          },
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK. Every response is wrapped in {\"data\": …}.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Scan limit for your plan reached; Retry-After says when to try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Create a key in the app: Team settings → API keys. Keys start with ak_."
      }
    },
    "schemas": {
      "Scan": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "scn_y3t4kdcfz4oasqmcpjsj"
          },
          "team_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "page_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Set when the scan belongs to a tracked page."
          },
          "url": {
            "type": "string"
          },
          "final_url": {
            "type": "string",
            "description": "After redirects."
          },
          "device": {
            "type": "string",
            "enum": [
              "both",
              "mobile",
              "desktop"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "done",
              "failed"
            ]
          },
          "stage": {
            "type": "string",
            "description": "Progress while running, e.g. \"lighthouse\"."
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "shared": {
            "type": "boolean",
            "description": "Whether the report is public at https://analyser.dev/r/{id}."
          },
          "scores": {
            "type": "object",
            "description": "0–100 per category; null when not scored.",
            "properties": {
              "overall": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "performance": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "seo": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "geo": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "best_practices": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "accessibility": {
                "type": [
                  "integer",
                  "null"
                ]
              }
            }
          },
          "metrics": {
            "type": "object",
            "description": "Lab metrics from the scan (mobile unless stated); field_* come from Chrome UX Report when available.",
            "properties": {
              "lcp_ms": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "cls": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "tbt_ms": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "fcp_ms": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "si_ms": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "ttfb_ms": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "field_lcp_ms": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "field_inp_ms": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "field_cls": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "page_bytes": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "requests": {
                "type": [
                  "integer",
                  "null"
                ]
              }
            }
          },
          "desktop": {
            "type": "object",
            "description": "For device \"both\": desktop performance, accessibility and metrics.",
            "properties": {
              "performance": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "accessibility": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "metrics": {
                "type": "object",
                "description": "Lab metrics from the scan (mobile unless stated); field_* come from Chrome UX Report when available.",
                "properties": {
                  "lcp_ms": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "cls": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "tbt_ms": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "fcp_ms": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "si_ms": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "ttfb_ms": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "field_lcp_ms": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "field_inp_ms": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "field_cls": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "page_bytes": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "requests": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  }
                }
              }
            }
          },
          "fail_count": {
            "type": "integer"
          },
          "warn_count": {
            "type": "integer"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "finished_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "ScanResponse": {
        "type": "object",
        "properties": {
          "scan": {
            "$ref": "#/components/schemas/Scan"
          },
          "view": {
            "type": "string",
            "enum": [
              "full",
              "summary"
            ]
          },
          "cached": {
            "type": "boolean",
            "description": "A very recent scan of the same URL was reused."
          },
          "queue_position": {
            "type": "integer"
          }
        }
      },
      "Team": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "tm_8f3k2m1q9x"
          },
          "name": {
            "type": "string"
          },
          "plan": {
            "type": "string",
            "enum": [
              "free",
              "pro",
              "business"
            ]
          }
        }
      },
      "Site": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "origin": {
            "type": "string",
            "example": "https://example.com"
          },
          "name": {
            "type": "string"
          },
          "verified_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "gsc_property": {
            "type": "string",
            "description": "Linked Search Console property, or empty."
          },
          "indexnow_verified_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "page_count": {
            "type": "integer"
          },
          "open_alerts": {
            "type": "integer"
          },
          "latest_scores": {
            "type": "object",
            "description": "0–100 per category; null when not scored.",
            "properties": {
              "overall": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "performance": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "seo": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "geo": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "best_practices": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "accessibility": {
                "type": [
                  "integer",
                  "null"
                ]
              }
            }
          },
          "last_scan_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "Page": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "site_id": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "frequency": {
            "type": "string",
            "enum": [
              "hourly",
              "daily",
              "weekly"
            ]
          },
          "devices": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "active": {
            "type": "boolean"
          },
          "next_run_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "HistoryPoint": {
        "type": "object",
        "properties": {
          "scan_id": {
            "type": "string"
          },
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "scores": {
            "type": "object",
            "description": "0–100 per category; null when not scored.",
            "properties": {
              "overall": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "performance": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "seo": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "geo": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "best_practices": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "accessibility": {
                "type": [
                  "integer",
                  "null"
                ]
              }
            }
          },
          "metrics": {
            "type": "object",
            "description": "Lab metrics from the scan (mobile unless stated); field_* come from Chrome UX Report when available.",
            "properties": {
              "lcp_ms": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "cls": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "tbt_ms": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "fcp_ms": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "si_ms": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "ttfb_ms": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "field_lcp_ms": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "field_inp_ms": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "field_cls": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "page_bytes": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "requests": {
                "type": [
                  "integer",
                  "null"
                ]
              }
            }
          },
          "fail_count": {
            "type": "integer"
          }
        }
      },
      "Alert": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "site_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "page_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "kind": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "detail": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "resolved"
            ]
          },
          "opened_at": {
            "type": "string",
            "format": "date-time"
          },
          "resolved_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              },
              "code": {
                "type": "string",
                "description": "For 429s: UPGRADE_FOR_MORE or RATE_LIMITED."
              }
            }
          }
        }
      }
    }
  }
}
