Comparisons
API endpoints for visual comparisons — the core of UI Inspect.
Comparisons are the fundamental unit of visual testing. Each comparison represents a screenshot compared against a baseline image.
comparison.list
List comparisons with optional filtering.
| Type | Query |
| Auth | Protected |
Input:
{
status?: "pending" | "resolved" | "archived";
projectId?: string;
}comparison.byId
Get a single comparison with full details.
| Type | Query |
| Auth | Protected |
Input: { id: string }
comparison.create
Create a single comparison.
| Type | Mutation |
| Auth | Protected |
Input:
{
projectId: string;
componentName: string;
viewport?: string;
diffsFound?: number;
diffsFixed?: number;
confidence?: number;
designImageUrl?: string;
implementationImageUrl?: string;
analysisData?: object; // Smart diff results
a11yData?: object; // Accessibility audit
contrastData?: object; // Contrast check results
}comparison.batchCreate
Create multiple comparisons at once. Used by the CLI during builds.
| Type | Mutation |
| Auth | Protected |
Input:
{
projectId: string;
buildId?: string;
comparisons: Array<{
componentName: string;
viewport?: string;
diffsFound?: number;
diffsFixed?: number;
confidence?: number;
designImageUrl?: string;
implementationImageUrl?: string;
analysisData?: object;
}>;
}comparison.updateStatus
Update the status of a comparison.
| Type | Mutation |
| Auth | Protected |
Input:
{
id: string;
status: "pending" | "resolved" | "archived";
}comparison.batchUpdateStatus
Update status of multiple comparisons at once.
| Type | Mutation |
| Auth | Protected |
Input:
{
ids: string[];
status: "pending" | "resolved" | "archived";
}comparison.updateIgnoreRegions
Define regions to ignore during comparison.
| Type | Mutation |
| Auth | Protected |
Input:
{
id: string;
regions: Array<{
x: number;
y: number;
width: number;
height: number;
label?: string;
}>;
}comparison.applyFix
Mark specific diffs as fixed within a comparison.
| Type | Mutation |
| Auth | Protected |
Input:
{
id: string;
diffIds: number[];
}comparison.catalog
Get a catalog of all unique components across comparisons.
| Type | Query |
| Auth | Protected |
| Input | None |
Response:
Array<{
name: string;
latestStatus: string;
latestConfidence: number;
totalComparisons: number;
totalDiffs: number;
totalFixed: number;
projects: string[];
fixRate: number;
}>;comparison.weeklyStats
Get comparison counts grouped by day for the current week.
| Type | Query |
| Auth | Protected |
| Input | None |
Response:
Array<{
day: string; // "Mon", "Tue", etc.
date: string; // ISO date
comparisons: number;
}>;comparison.trendStats
Get trend data over a configurable time range.
| Type | Query |
| Auth | Protected |
Input:
{
days?: number; // 7-365, default: 30
}Response:
Array<{
date: string;
comparisons: number;
diffs: number;
fixed: number;
resolved: number;
regressionRate: number;
}>;comparison.reportStats
Get aggregate report statistics.
| Type | Query |
| Auth | Protected |
| Input | None |
Response:
{
totalComparisons: number;
totalDiffs: number;
totalFixed: number;
fixRate: number;
projectStats: Array<{
projectId: string;
projectName: string;
comparisons: number;
diffs: number;
fixed: number;
}>;
}