---
title: "Compare Archives"
method: POST
path: "/compare"
---

# Compare Archives

`POST /compare`

## Request

- Base URL: `https://api.colourmemory.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.colourmemory.com/compare`
- Auth: none declared

Find the closest match to a colour from each archive independently.

Accepts ONE of: hex value, colour name, or free-text query.
Returns n_per_archive results from each available archive side by side.

Useful for:
  - "How does the China archive describe this blue vs the Pigment archive?"
  - "What pigment name matches this British heritage colour?"
  - "Show me how all three archives see #2030A0"

Examples:
    {"hex": "#2030A0", "n_per_archive": 2}
    {"name": "Jingtai Blue", "n_per_archive": 3}
    {"query": "the colour of autumn wheat fields", "n_per_archive": 2}

## Request body

- CompareRequest
  - `hex_a` string
  - `hex_b` string
  - `hex` string, nullable
  - `name` string, nullable
  - `query` string, nullable
  - `n_per_archive` integer

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/colourmemory/apis/colour-memory-api.md) · [All operations](https://skmtc.dev/colourmemory/apis/colour-memory-api/llms.txt) · [OpenAPI document](https://skmtc.dev/colourmemory/apis/colour-memory-api/revisions/4ba028f64042?raw)
