API Reference
Base URL: https://api.thepixelhouse.co.uk
All endpoints require authentication via API key (Bearer token) or session cookie. Responses follow { data: T } for success and { error: { code, message } } for errors.
Authentication
Include your API key in the Authorization header as a Bearer token. API keys are created in your dashboard under Settings. Keys are hashed before storage and shown only once at creation time. Keep your key secure and never commit it to version control.
Authorization: Bearer ak_your_api_key_here
Rate limiting
API requests are rate-limited per account based on your plan. When you exceed your limit, the API returns a 429 Too Many Requests status. Rate limit information is included in every response via headers:
X-RateLimit-Limit— maximum requests per windowX-RateLimit-Remaining— requests remaining in the current windowX-RateLimit-Reset— UTC epoch time when the window resets
Pagination
List endpoints return paginated results using cursor-based pagination. Pass the cursor query parameter to fetch the next page. The default page size is 25 items, configurable up to 100 via the limit parameter.
GET /v1/screenshots?limit=25&cursor=ss_abc123
The response includes a nextCursor field. When this field is null, you have reached the end of the list.
Error codes
Error responses include a machine-readable code and a human-readable message. Common error codes:
| Status | Code | Description |
|---|---|---|
| 400 | validation_error | Request body or query parameters failed validation |
| 401 | unauthorized | Missing or invalid API key |
| 403 | forbidden | API key does not have access to the requested resource |
| 404 | not_found | The requested resource does not exist |
| 429 | rate_limited | Too many requests or monthly screenshot limit reached |
| 500 | internal_error | An unexpected error occurred on our side |
Endpoints
All endpoints use the https://api.thepixelhouse.co.uk base URL. Timestamps are in ISO 8601 UTC format. All IDs are prefixed for type safety: ss_ (screenshot), bl_ (baseline), cmp_ (comparison), mon_ (monitor), prj_ (project).
| Method | Path | Description |
|---|---|---|
| POST | /v1/screenshots | Capture a new screenshot |
| GET | /v1/screenshots | List screenshots for a project |
| GET | /v1/screenshots/:id | Get screenshot metadata |
| GET | /v1/screenshots/:id/image | Get screenshot image (PNG) |
| DELETE | /v1/screenshots/:id | Delete a screenshot |
| POST | /v1/baselines | Create or promote a baseline |
| GET | /v1/baselines | List baselines for a project |
| GET | /v1/baselines/:id | Get baseline metadata |
| PUT | /v1/baselines/:id | Update baseline screenshot |
| DELETE | /v1/baselines/:id | Deactivate a baseline |
| POST | /v1/comparisons | Compare two screenshots |
| GET | /v1/comparisons | List comparisons for a project |
| GET | /v1/comparisons/:id | Get comparison result |
| GET | /v1/comparisons/:id/diff | Get diff overlay image (PNG) |
| POST | /v1/comparisons/:id/approve | Approve changes and update baseline |
| POST | /v1/tests/run | Capture and compare in one call |
| GET | /v1/tests/:id | Get test result |
| POST | /v1/projects | Create a project |
| GET | /v1/projects | List projects |
| GET | /v1/projects/:id | Get project details |
| PUT | /v1/projects/:id | Update project settings |
| DELETE | /v1/projects/:id | Delete a project |
| POST | /v1/monitors | Create a scheduled monitor |
| GET | /v1/monitors | List monitors |
| GET | /v1/monitors/:id | Get monitor details and recent runs |
| PUT | /v1/monitors/:id | Update monitor settings |
| DELETE | /v1/monitors/:id | Delete a monitor |
| POST | /v1/monitors/:id/pause | Pause a monitor |
| POST | /v1/monitors/:id/resume | Resume a monitor |
| POST | /v1/alerts | Create an alert rule |
| GET | /v1/alerts | List alert rules |
| PUT | /v1/alerts/:id | Update an alert rule |
| DELETE | /v1/alerts/:id | Delete an alert rule |
| POST | /v1/api-keys | Create an API key |
| GET | /v1/api-keys | List API keys |
| DELETE | /v1/api-keys/:id | Revoke an API key |
| POST | /v1/billing/checkout | Create Stripe Checkout session |
| POST | /v1/billing/portal | Create Stripe Customer Portal session |
Further reading
- SSIM vs Pixel Diff: A 40-Site Benchmark of Our EngineSSIM is said to eliminate the false positives that plague pixel diffing. We benchmarked both on 40 real sites with our own engine. The result surprised us.
- How Visual Diffing Works: Pixel, SSIM, Perceptual ComparisonThe complete guide to image diffing for visual regression testing: pixel diffs in YIQ, SSIM structural comparison (cited 50,000+ times), perceptual hashing.