API

Pull a grade. Trigger a scan.

An Agency-plan feature: a small JSON API for the sites you watch, so you can show a grade in your own dashboard, or trigger a scan right after a deploy instead of waiting for the weekly one.

Authenticating

Generate a key from your account settings, then send it on every request:

Authorization: Bearer tg_live_...

A key only works while the account is on the Agency plan. Revoking it from your account settings stops it at once.

List your sites

GET https://trackergrade.com/api/v1/sites
{"sites":[{"id":"...","url":"https://example.com","host":"example.com","region":"us","grade":"B−","score":80}]}

One site's current grade and findings

GET https://trackergrade.com/api/v1/sites/:id
{"id":"...","host":"example.com","grade":"B−","score":80,"previousGrade":"A−",
 "reportUrl":"https://trackergrade.com/r/...","latestReportUrl":"https://trackergrade.com/w/...","badgeUrl":"https://trackergrade.com/badge/w/....svg",
 "findings":{"trackersBeforeConsent":["Meta Pixel"],"trackersAfterReject":["Meta Pixel"],
   "cookiesBeforeConsent":["_fbp"],"consent":{"score":62},"scripts":{"score":91,"thirdPartyKb":210,"mostlyUnusedKb":40},
   "fixFirst":[{"title":"...","points":8}],"projectedGrade":"A−"}}

findings comes from the newest finished scan and is null before the first one. latestReportUrl and badgeUrl never go stale: they always show the newest scan.

Scan history

GET https://trackergrade.com/api/v1/sites/:id/history

Add ?format=csv for a CSV instead of JSON.

Trigger a scan now

POST https://trackergrade.com/api/v1/sites/:id/scan

Returns 202 with a scan id, or 409 if that site was scanned within the last hour — the same limit as the "Scan now" button.

Errors

Every error is {"error": "..."} with a plain status code: 401 for a missing or wrong key, 403 if the account isn't on Agency, 404 for a site that isn't yours.