Public API access is coming soon — interested in early access? Get in touch

API Documentation

The Wallace Web Workers optimization engine is available as a REST API. Register a site to receive an API key, then use it to trigger runs and retrieve reports.

Authentication

All authenticated endpoints require a Bearer token in the Authorization header. Your API key is generated when you register a site and shown once.

Authorization: Bearer wwwk_your_api_key_here

Base URL

https://wallacewebworkers.com/api/v1

Endpoints

POST/api/v1/sitesNo auth required

Register a new site

Creates a site record and returns a one-time API key. Save the key — it is not stored in plaintext.

Request body
{
  "name": "Acme Plumbing",
  "url": "https://acmeplumbing.com",
  "pageCount": 8,
  "tier": "PRO",
  "ownerName": "John Acme",
  "ownerEmail": "john@acmeplumbing.com",
  "businessDescription": "Residential plumbing in Nashville, TN",
  "targetLocation": "Nashville, TN",
  "targetKeywords": ["plumber Nashville", "emergency plumbing", "water heater repair"]
}
Response
{
  "ok": true,
  "data": {
    "site": { "id": "...", "name": "Acme Plumbing", ... },
    "apiKey": "wwwk_...",
    "message": "Site registered. Save your API key — it will not be shown again."
  }
}
GET/api/v1/sites/:id

Get site details

Returns the site record and metadata.

Response
{ "ok": true, "data": { "id": "...", "name": "...", ... } }
PATCH/api/v1/sites/:id

Update site settings

Update any site field: page count, tier, keywords, etc.

Request body
{
  "pageCount": 12,
  "tier": "ENTERPRISE",
  "targetKeywords": ["new keyword"]
}
Response
{ "ok": true, "data": { "id": "...", ... } }
POST/api/v1/sites/:id/analyze

Trigger a manual optimization run

Starts a full optimization pipeline asynchronously. Returns immediately with a run ID.

Response
{
  "ok": true,
  "data": {
    "runId": "...",
    "status": "RUNNING",
    "message": "Optimization run started. Poll GET /api/v1/reports to check progress."
  }
}
GET/api/v1/sites/:id/reports

List optimization reports

Returns paginated list of all runs and their reports for a site.

Response
{
  "ok": true,
  "data": {
    "runs": [ { "id": "...", "status": "COMPLETED", "report": { ... } } ],
    "limit": 20,
    "offset": 0
  }
}
GET/api/v1/sites/:id/vitals

Latest Core Web Vitals

Returns the most recent PageSpeed Insights snapshot for the site.

Response
{
  "ok": true,
  "data": {
    "performanceScore": 87,
    "lcp": 1820,
    "cls": 0.04,
    "fcp": 980,
    ...
  }
}
GET/api/v1/reports/:id

Get a single report (JSON)

Returns the full report including all module results, scores, changes, and recommendations.

Response
{
  "ok": true,
  "data": {
    "id": "...",
    "geoScore": 74,
    "seoScore": 81,
    "performanceScore": 87,
    "summary": "...",
    "changesMade": [...],
    "recommendations": [...],
    "geoOptimization": { ... },
    ...
  }
}
GET/api/v1/reports/:id/pdf

Export report as PDF

Returns a PDF binary of the full report. Content-Disposition is set to attachment.

Response
[PDF binary — application/pdf]

Error Format

All errors return a consistent JSON structure:

{
  "ok": false,
  "error": "Description of what went wrong"
}
400
Bad request
401
Missing/invalid API key
403
Forbidden
404
Not found
422
Validation error
500
Server error