Skip to main content
Use GTmetrix through Corsair: one client, typed API calls, local DB sync. Get a key at https://gtmetrix.com/dashboard/account (API Usage > Generate API Key). The key is the HTTP Basic username; the password is empty.
  • Credits: tests spend API credits. A Lighthouse report costs 1, a legacy PageSpeed/YSlow report 0.7, both 1.1 and a metrics-only report (report: "none") 0.6; video adds 0.9 and longer retention up to 1.8. reports.retest and pages.retest cost the same as tests.start, and reports.resource with report.pdf costs 0.2 (0.3 full). A free Basic account gets a few one-off credits; status.get shows the balance.
  • Running a test: tests.start answers at once with a queued test. Poll tests.get every few seconds; when the test is done GTmetrix redirects to the report and tests.get returns the report itself (data.type is report).
  • Files: reports.resource returns the file as text (JSON, HAR) or contentBase64 (images, video, PDF, tar). The documented resource-summary is served as resource-summary.json; both names work. analysis-options includes the cookies and HTTP auth the test used.
  • Lists take page, pageSize (up to 500), sort (-created) and filter ({ "state": "completed" }, { "created:gt": 1764600000 }). Each answer carries next_page, null on the last page.
  • Risk levels: reads are read; starting tests, retests, monitoring, alert conditions and tag changes are write; deleting reports, pages, tags and alert conditions is destructive.
  • status.get drops data.id, which GTmetrix fills with the API key. With a database, tests, reports, pages and tags are kept in their own tables; report files never are.
What you get:
  • 34 typed API operations
  • 4 synced entities (pages, reports, tags, tests) for fast .search() / .list()

Setup

1

Install

2

Add the plugin

corsair.ts
With multiTenancy: true, scope calls with corsair.withTenant(id). See Quick start for KEK + Hub keys, and Multi-tenancy for account isolation.
3

Choose authentication

4

Connect a tenant

Mint a connect link and send the tenant to it. Hub hosts the page and delivers the result to your app — see Connect / OAuth.

Example API calls

Read a report (grade, scores, Core Web Vitals)
Test a page (metrics only, 0.6 credits)
See the full list on the API page.

Query synced data

Synced entities support tenant.gtmetrix.db.<entity>.search() and .list(): pages, reports, tags, tests. See Database for filters and operators.

What’s next

API reference

Every gtmetrix.api.* operation with input and output types.

Database

Synced entities, search filters, and operators.

Connect / OAuth

createLink, Hub delivery, and tenant connect flows.

Use with agents

Expose this plugin’s operations as MCP tools.