Foghorn finds performance, accessibility, and SEO issues across your entire site — automatically. Point it at a domain, and it crawls every page, runs Lighthouse audits, and reports what needs fixing. Use the REST API directly from your AI agent to monitor site health and act on issues without leaving the loop.
Install the Foghorn skill to use the API directly from Claude Code, Cursor, Gemini CLI, or any agent that supports the Agent Skills spec:
npx skills add https://github.com/artmann/foghorn-apiOnce installed, ask your agent to check a site's performance and it will handle authentication, setup, and issue retrieval for you.
Walk through the end-to-end flow: create an account, set up a team, add a site, and check for issues.
curl -X POST https://foghorn-api.artgaard.workers.dev/auth/sign-up \
-H "Content-Type: application/json" \
-d '{"email": "user@example.com", "password": "securepassword"}'Creates your account and returns your user ID.
curl -X POST https://foghorn-api.artgaard.workers.dev/auth/sign-in \
-H "Content-Type: application/json" \
-d '{"email": "user@example.com", "password": "securepassword"}'Returns a JWT token (valid for 24 hours). Use it as a Bearer token in all
subsequent requests.
curl -X POST https://foghorn-api.artgaard.workers.dev/teams \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"name": "My Team"}'Returns the team object including its id. You are automatically added as a
member.
curl -X POST https://foghorn-api.artgaard.workers.dev/sites \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"teamId": "<team-id>", "domain": "www.example.com"}'Returns the site object including its id. Foghorn will begin crawling the
sitemap and running Lighthouse audits.
curl https://foghorn-api.artgaard.workers.dev/issues?siteId=<site-id> \
-H "Authorization: Bearer <token>"Returns audit failures grouped by audit ID, sorted by the number of affected pages. Each issue includes the list of pages where the audit fails.
The API supports two authentication methods via Bearer token:
- JWT tokens - Returned from
/auth/sign-in, expires in 24 hours - API keys - Created via
/api-keys, prefixed withfh_
# Using JWT
curl -H "Authorization: Bearer <jwt-token>" https://foghorn-api.artgaard.workers.dev/sites
# Using API key
curl -H "Authorization: Bearer fh_abc123..." https://foghorn-api.artgaard.workers.dev/sitesPOST /auth/sign-up
{
"email": "user@example.com",
"password": "securepassword"
}POST /auth/sign-in
{
"email": "user@example.com",
"password": "securepassword"
}Returns a JWT token and its expiry.
All API key endpoints require authentication.
POST /api-keys
{
"name": "My Key",
"expiresAt": "2025-12-31T00:00:00Z"
}expiresAt is optional. The full key value is only returned once on creation.
GET /api-keys
DELETE /api-keys/:id
All team endpoints require authentication.
POST /teams
{
"name": "My Team"
}The creator is automatically added as a member.
GET /teams
GET /teams/:id
PUT /teams/:id
{
"name": "New Name"
}DELETE /teams/:id
POST /teams/:id/members
{
"userId": "user-id-here"
}GET /teams/:id/members
DELETE /teams/:id/members/:userId
All site endpoints require authentication. You must be a member of the site's team.
POST /sites
{
"teamId": "team-id-here",
"domain": "www.example.com",
"sitemapPath": "/sitemap.xml"
}sitemapPath is optional and defaults to /sitemap.xml.
GET /sites?teamId=team-id-here
GET /sites/:id
PUT /sites/:id
{
"domain": "new-domain.com",
"sitemapPath": "/custom-sitemap.xml"
}Both fields are optional.
DELETE /sites/:id
All page endpoints require authentication. You must be a member of the page's site's team.
GET /pages?siteId=site-id-here&search=keyword
Both query parameters are optional. If siteId is provided, returns pages for
that site. Otherwise, returns pages across all sites you have access to.
search filters pages where the URL or path matches the term
(case-insensitive).
GET /pages/:id
All issue endpoints require authentication.
GET /issues?siteId=site-id-here&category=accessibility
Both query parameters are optional. If siteId is provided, returns issues for
that site. Otherwise, returns issues across all sites you have access to.
category filters to a single Lighthouse category: performance,
accessibility, bestPractices, or seo.
Returns audit failures grouped by audit ID across all pages. Each issue includes the list of pages where the audit fails, sorted by score ascending (worst first). Issues are sorted by number of affected pages descending.
GET /
GET /openapi