- 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.retestandpages.retestcost the same astests.start, andreports.resourcewithreport.pdfcosts 0.2 (0.3 full). A free Basic account gets a few one-off credits;status.getshows the balance. - Running a test:
tests.startanswers at once with a queued test. Polltests.getevery few seconds; when the test is done GTmetrix redirects to the report andtests.getreturns the report itself (data.typeisreport). - Files:
reports.resourcereturns the file astext(JSON, HAR) orcontentBase64(images, video, PDF, tar). The documentedresource-summaryis served asresource-summary.json; both names work.analysis-optionsincludes the cookies and HTTP auth the test used. - Lists take
page,pageSize(up to 500),sort(-created) andfilter({ "state": "completed" },{ "created:gt": 1764600000 }). Each answer carriesnext_page, null on the last page. - Risk levels: reads are
read; starting tests, retests, monitoring, alert conditions and tag changes arewrite; deleting reports, pages, tags and alert conditions isdestructive. status.getdropsdata.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.
- 34 typed API operations
- 4 synced entities (
pages,reports,tags,tests) for fast.search()/.list()
Setup
1
Install
2
Add the plugin
corsair.ts
multiTenancy: true, scope calls with corsair.withTenant(id). See Quick start for KEK + Hub keys, and Multi-tenancy for account isolation.3
Choose authentication
- API Key (Recommended)
Store the GTmetrix API key before the first call: More: API Key
pnpm corsair setup --plugin=gtmetrix --tenant=acme api_key=<your-key> (leave out --tenant without multiTenancy), or pass it as key in the plugin options. With Hub, each tenant enters their own key on the connect page. See API key auth.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)Query synced data
Synced entities supporttenant.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.