{
  "openapi": "3.1.0",
  "info": {
    "title": "Mrs Font API",
    "version": "1.0.0",
    "summary": "Identify fonts in images, font files, PDFs and websites; find free alternatives and pairings.",
    "description": "Mrs Font names the fonts in pictures, font files, PDFs and live websites, lists free fonts first, and finds free look-alikes and pairings.\n\n## Free scans\nCalls that run on our servers count as **scans**: image, font file and PDF identification and website scans (a site scanned in the last day answers from the cache and costs nothing). Every network gets **10 free scans**. After that, a scan needs `Authorization: Bearer <token>` with an API token of an approved account:\n\n1. Request access at https://mrsfont.web.app/access?for=api (the owner approves requests by hand).\n2. Once approved, sign in at https://mrsfont.web.app/account and create a token. It is shown once.\n3. Send it on every call. Revoke it on the same page.\n\nCatalogue lookups, alternatives and pairings are free and need no token.\n\n## Errors\nErrors are JSON: `{ \"error\": { \"code\", \"message\", ... } }`. The message is a sentence you can show to a person.\n- `access_required` (401, or 403 for an account that isn't approved): the free scans are used up. The body has `requestAccess`, `account` and `docs` links.\n- `invalid_token` (401): the token was revoked, expired or mistyped.\n- `rate_limited` (429): too many calls; wait `retryAfter` seconds (also the `Retry-After` header).\n- `bad_request` (400), `not_found` (404), `too_large` (413), `unsupported` (415).\n\n## MCP\nThe same tools are an MCP server at https://mrsfont.web.app/mcp (Streamable HTTP; send the token as the same header). Guide: https://mrsfont.web.app/developers",
    "termsOfService": "https://mrsfont.web.app/terms",
    "contact": {
      "name": "Request access",
      "url": "https://mrsfont.web.app/access?for=api"
    }
  },
  "externalDocs": {
    "description": "Developer guide, MCP setup and examples",
    "url": "https://mrsfont.web.app/developers"
  },
  "servers": [
    {
      "url": "https://mrsfont.web.app/api/v1"
    }
  ],
  "security": [
    {},
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Identify",
      "description": "Fonts in pictures, font files and PDFs. Each call is a scan."
    },
    {
      "name": "Websites",
      "description": "Fonts a public website draws text with."
    },
    {
      "name": "Catalogue",
      "description": "Free fonts, their details and free alternatives to any font. Free."
    },
    {
      "name": "Pairing",
      "description": "Fonts that go together. Free."
    },
    {
      "name": "Access",
      "description": "Free scans left and requests for access."
    }
  ],
  "paths": {
    "/image/identify": {
      "post": {
        "tags": [
          "Identify"
        ],
        "operationId": "identifyImage",
        "summary": "Identify the fonts in an image",
        "description": "Send the picture itself (`image`) or a public link to it (`imageUrl`, fetched by us; private and internal addresses are refused). PNG, JPEG or WebP, at most 8 MB. Returns one group per distinct text style, each with up to 12 candidate fonts, free first. Counts as one scan: 10 free per network, then an approved account’s API token is needed (see Free scans).",
        "parameters": [
          {
            "$ref": "#/components/parameters/ScanId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImageIdentifyRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImageIdentifyResult"
                }
              }
            },
            "headers": {
              "X-Free-Scans-Left": {
                "$ref": "#/components/headers/X-Free-Scans-Left"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "413": {
            "$ref": "#/components/responses/E413"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        },
        "x-mrsfont-scan": true
      }
    },
    "/fontfile/inspect": {
      "post": {
        "tags": [
          "Identify"
        ],
        "operationId": "inspectFontFile",
        "summary": "Read a font file",
        "description": "Names, licence, metrics, axes, features and scripts of a TTF, OTF, WOFF or WOFF2 file (at most 10 MB), the catalogue match and free alternatives. The file is read in memory and discarded. Counts as one scan: 10 free per network, then an approved account’s API token is needed (see Free scans).",
        "parameters": [
          {
            "$ref": "#/components/parameters/ScanId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "file"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "description": "The font file as a data: URL (base64)."
                  },
                  "filename": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FontFileResult"
                }
              }
            },
            "headers": {
              "X-Free-Scans-Left": {
                "$ref": "#/components/headers/X-Free-Scans-Left"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "413": {
            "$ref": "#/components/responses/E413"
          },
          "415": {
            "$ref": "#/components/responses/E415"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        },
        "x-mrsfont-scan": true
      }
    },
    "/pdf/identify": {
      "post": {
        "tags": [
          "Identify"
        ],
        "operationId": "identifyPdf",
        "summary": "List the fonts in a PDF",
        "description": "Fonts named in a PDF (at most 15 MB), with how much each is used, whether it's embedded, its licence and free alternatives. Counts as one scan: 10 free per network, then an approved account’s API token is needed (see Free scans).",
        "parameters": [
          {
            "$ref": "#/components/parameters/ScanId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "pdf"
                ],
                "properties": {
                  "pdf": {
                    "type": "string",
                    "description": "The PDF as a data: URL (base64)."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PdfResult"
                }
              }
            },
            "headers": {
              "X-Free-Scans-Left": {
                "$ref": "#/components/headers/X-Free-Scans-Left"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "413": {
            "$ref": "#/components/responses/E413"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        },
        "x-mrsfont-scan": true
      }
    },
    "/scan-run": {
      "post": {
        "tags": [
          "Websites"
        ],
        "operationId": "scanWebsite",
        "summary": "Scan a website for its fonts",
        "description": "Opens the page in headless Chromium and reports the fonts it actually draws text with: share of the text, roles, weights, sizes, licence, where each is served from, and free alternatives for paid fonts. Public http(s) addresses on ports 80 and 443 only. A scan of the same page from the last 24 hours is returned at once (`cached: true`) and costs nothing. Otherwise it takes 10 to 50 seconds. Counts as one scan: 10 free per network, then an approved account’s API token is needed (see Free scans).",
        "parameters": [
          {
            "$ref": "#/components/parameters/ScanId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "The page, such as https://stripe.com or stripe.com.",
                    "maxLength": 2048
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteScan"
                }
              }
            },
            "headers": {
              "X-Free-Scans-Left": {
                "$ref": "#/components/headers/X-Free-Scans-Left"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        },
        "x-mrsfont-scan": true
      }
    },
    "/scan/{domain}": {
      "get": {
        "tags": [
          "Websites"
        ],
        "operationId": "getSiteScan",
        "summary": "The last scan of a website",
        "description": "The stored scan of a domain, however old. Free. The page for people is /site/{domain}, and /site/{domain}.md is the same in Markdown.",
        "parameters": [
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "stripe.com"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteScan"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/fonts/search": {
      "get": {
        "tags": [
          "Catalogue"
        ],
        "operationId": "searchFonts",
        "summary": "Search the free font catalogue",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "A font name or part of one.",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "At most 20.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 20,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "results": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/FontRef"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/fonts/{id}": {
      "get": {
        "tags": [
          "Catalogue"
        ],
        "operationId": "getFont",
        "summary": "A free font’s details",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The catalogue id, such as playfair-display (Fontshare fonts: fontshare-<name>).",
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9-]{0,79}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "font": {
                      "$ref": "#/components/schemas/FontDetails"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/fonts/{id}/alternatives": {
      "get": {
        "tags": [
          "Catalogue"
        ],
        "operationId": "getAlternatives",
        "summary": "Free alternatives to a font",
        "description": "Free look-alikes, open licences first. `id` is a catalogue id or the slug of a paid or system font we know (proxima-nova, helvetica, gotham), in which case `font` describes it.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "A catalogue id or a font name as a slug.",
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9-]{0,79}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "At most 20.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 20,
              "default": 8
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "font": {
                      "type": "object",
                      "description": "Set for paid and system fonts.",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "foundry": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "category": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    },
                    "alternatives": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Alternative"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/pairings": {
      "get": {
        "tags": [
          "Pairing"
        ],
        "operationId": "suggestPairings",
        "summary": "Fonts that pair with a font",
        "description": "`role` is what the anchor font is used for; the suggestions fill the other role. Each comes with its reasons.",
        "parameters": [
          {
            "name": "anchor",
            "in": "query",
            "required": true,
            "description": "A catalogue id, such as playfair-display.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "role",
            "in": "query",
            "required": false,
            "description": "The anchor’s role.",
            "schema": {
              "type": "string",
              "enum": [
                "heading",
                "body"
              ],
              "default": "heading"
            }
          },
          {
            "name": "license",
            "in": "query",
            "required": false,
            "description": "free: open or free with limits; open: open licences only; any: also fonts that need a licence.",
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "free",
                "any"
              ],
              "default": "free"
            }
          },
          {
            "name": "script",
            "in": "query",
            "required": false,
            "description": "A subset the fonts must cover, such as latin or devanagari.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "exclude",
            "in": "query",
            "required": false,
            "description": "Catalogue ids to leave out, comma separated (at most 30).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "At most 20.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 20,
              "default": 8
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PairingSuggestions"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/pairings/shuffle": {
      "get": {
        "tags": [
          "Pairing"
        ],
        "operationId": "shufflePair",
        "summary": "A new heading and body pair",
        "description": "Keeps the locked side and picks a new partner, or a whole new pair with lock=none. The same seed gives the same pair.",
        "parameters": [
          {
            "name": "heading",
            "in": "query",
            "required": false,
            "description": "A catalogue id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "body",
            "in": "query",
            "required": false,
            "description": "A catalogue id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lock",
            "in": "query",
            "required": false,
            "description": "Which side to keep.",
            "schema": {
              "type": "string",
              "enum": [
                "heading",
                "body",
                "none"
              ],
              "default": "none"
            }
          },
          {
            "name": "license",
            "in": "query",
            "required": false,
            "description": "As for /pairings.",
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "free",
                "any"
              ],
              "default": "free"
            }
          },
          {
            "name": "script",
            "in": "query",
            "required": false,
            "description": "A subset the fonts must cover.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "seed",
            "in": "query",
            "required": false,
            "description": "Any non-negative integer.",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "heading": {
                      "$ref": "#/components/schemas/FontRef"
                    },
                    "body": {
                      "$ref": "#/components/schemas/FontRef"
                    },
                    "score": {
                      "type": "number"
                    },
                    "reasons": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Reason"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/free-scans": {
      "get": {
        "tags": [
          "Access"
        ],
        "operationId": "getFreeScans",
        "summary": "Free scans left, and whether you’re approved",
        "description": "Counts nothing. Without an approved token: `limit` and `left` for this network, plus where to request access. With one: `approved: true` and no limit.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeScanStatus"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/access/request": {
      "post": {
        "tags": [
          "Access"
        ],
        "operationId": "requestAccess",
        "summary": "Ask for access",
        "description": "Files a request the owner reviews by hand; the same as the form at /access?for=api. One request per email and purpose a day is kept. At most 5 calls an hour.",
        "security": [
          {}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email",
                    "description": "The Google account that will sign in at /account."
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "note": {
                    "type": "string",
                    "maxLength": 500,
                    "description": "What you’ll use it for."
                  },
                  "for": {
                    "type": "string",
                    "enum": [
                      "api",
                      "workflows"
                    ],
                    "default": "workflows",
                    "description": "api: agents, MCP and API tokens."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "mft_ API token",
        "description": "An API token from https://mrsfont.web.app/account (approved accounts only). Optional for the first 10 scans and for free calls."
      }
    },
    "parameters": {
      "ScanId": {
        "name": "X-Mrsfont-Scan",
        "in": "header",
        "required": false,
        "description": "Optional id for one task (8 to 64 of A-Z, a-z, 0-9, _ and -): calls with the same id count as one scan, up to 3 calls.",
        "schema": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]{8,64}$"
        }
      }
    },
    "headers": {
      "X-Free-Scans-Left": {
        "description": "Free scans left on this network, on calls counted against them.",
        "schema": {
          "type": "integer"
        }
      },
      "Retry-After": {
        "description": "Seconds to wait before trying again.",
        "schema": {
          "type": "integer"
        }
      }
    },
    "responses": {
      "E400": {
        "description": "The request is incomplete or malformed; the message says what to fix.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E401": {
        "description": "`access_required`: the free scans are used up and no approved token was sent. `invalid_token`: the token was revoked, expired or mistyped.",
        "headers": {
          "WWW-Authenticate": {
            "schema": {
              "type": "string"
            },
            "description": "Bearer realm=\"Mrs Font\""
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E403": {
        "description": "`access_required`: the free scans are used up and the token’s account isn’t approved yet.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E404": {
        "description": "Not found.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E413": {
        "description": "The file or image is too large.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E415": {
        "description": "Not a font file we can read.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E429": {
        "description": "Too many calls from this address, or the scanner is busy.",
        "headers": {
          "Retry-After": {
            "$ref": "#/components/headers/Retry-After"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string",
                "examples": [
                  "access_required",
                  "invalid_token",
                  "rate_limited",
                  "bad_request"
                ]
              },
              "message": {
                "type": "string",
                "description": "A sentence to show to a person."
              },
              "retryAfter": {
                "type": "integer",
                "description": "rate_limited: seconds to wait."
              },
              "freeScans": {
                "type": "integer",
                "description": "access_required: the free allowance (10)."
              },
              "requestAccess": {
                "type": "string",
                "format": "uri",
                "description": "access_required: where to ask for access."
              },
              "account": {
                "type": "string",
                "format": "uri",
                "description": "Where approved accounts create API tokens."
              },
              "docs": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      },
      "FreeScanStatus": {
        "type": "object",
        "properties": {
          "signedIn": {
            "type": "boolean"
          },
          "email": {
            "type": "string"
          },
          "approved": {
            "type": "boolean"
          },
          "limit": {
            "type": [
              "integer",
              "null"
            ]
          },
          "left": {
            "type": [
              "integer",
              "null"
            ]
          },
          "requestAccess": {
            "type": "string",
            "format": "uri"
          },
          "account": {
            "type": "string",
            "format": "uri"
          },
          "docs": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "License": {
        "type": "object",
        "properties": {
          "tier": {
            "type": "string",
            "enum": [
              "open",
              "free-restricted",
              "personal",
              "commercial",
              "unknown"
            ],
            "description": "open: OFL, Apache, UFL, MIT or CC0. free-restricted: free for commercial use with limits (no subsetting or conversion). personal and unknown are never free."
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": [
              "string",
              "null"
            ]
          },
          "summary": {
            "type": "string"
          }
        }
      },
      "FontRef": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "family": {
            "type": "string"
          },
          "category": {
            "type": "string",
            "enum": [
              "serif",
              "sans-serif",
              "display",
              "handwriting",
              "monospace",
              "other"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "google",
              "fontshare",
              "fontsource-other"
            ]
          },
          "license": {
            "$ref": "#/components/schemas/License"
          },
          "weights": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "styles": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "normal",
                "italic"
              ]
            }
          },
          "variable": {
            "type": "boolean"
          },
          "subsets": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "links": {
            "type": "object",
            "properties": {
              "page": {
                "type": "string",
                "description": "Site-relative, such as /font/inter."
              },
              "specimen": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "download": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "css": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "classification": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "style": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "label": {
                "type": "string"
              },
              "group": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "contrast": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          }
        }
      },
      "FontDetails": {
        "allOf": [
          {
            "$ref": "#/components/schemas/FontRef"
          },
          {
            "type": "object",
            "properties": {
              "designers": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "description": {
                "type": "string"
              },
              "popularity": {
                "type": "number"
              },
              "metrics": {
                "type": "object"
              }
            }
          }
        ]
      },
      "Reason": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "text": {
            "type": "string"
          }
        }
      },
      "Alternative": {
        "allOf": [
          {
            "$ref": "#/components/schemas/FontRef"
          },
          {
            "type": "object",
            "properties": {
              "similarity": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              },
              "metricCompatible": {
                "type": "boolean",
                "description": "Swaps in without reflowing text."
              },
              "note": {
                "type": "string"
              }
            }
          }
        ]
      },
      "Candidate": {
        "allOf": [
          {
            "$ref": "#/components/schemas/FontRef"
          },
          {
            "type": "object",
            "properties": {
              "score": {
                "type": "number"
              },
              "weight": {
                "type": "integer"
              },
              "style": {
                "type": "string"
              },
              "match": {
                "type": "string",
                "enum": [
                  "exact",
                  "likely",
                  "similar"
                ]
              },
              "reasons": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Reason"
                }
              }
            }
          }
        ]
      },
      "ImageIdentifyRequest": {
        "type": "object",
        "description": "Send `image` or `imageUrl`.",
        "properties": {
          "image": {
            "type": "string",
            "description": "The image as a data: URL or base64."
          },
          "imageUrl": {
            "type": "string",
            "format": "uri",
            "description": "A public http(s) link to the image."
          },
          "hint": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string",
                "description": "The words in the image."
              },
              "script": {
                "type": "string",
                "description": "latin, devanagari, bengali, ..."
              }
            }
          },
          "maxGroups": {
            "type": "integer",
            "minimum": 1,
            "maximum": 6,
            "default": 4
          }
        }
      },
      "ImageIdentifyResult": {
        "type": "object",
        "properties": {
          "requestId": {
            "type": "string"
          },
          "width": {
            "type": "integer"
          },
          "height": {
            "type": "integer"
          },
          "groups": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "role": {
                  "type": "string",
                  "enum": [
                    "headline",
                    "subhead",
                    "body",
                    "text"
                  ]
                },
                "script": {
                  "type": "string"
                },
                "box": {
                  "type": "object"
                },
                "text": {
                  "type": "string"
                },
                "candidates": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Candidate"
                  }
                },
                "weightEstimate": {
                  "type": "integer"
                },
                "italic": {
                  "type": "boolean"
                },
                "unknownFont": {
                  "type": "boolean",
                  "description": "Probably custom lettering or a font outside our catalogue."
                },
                "searchElsewhere": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "label": {
                        "type": "string"
                      },
                      "url": {
                        "type": "string"
                      }
                    }
                  }
                },
                "notes": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      },
      "PageFont": {
        "type": "object",
        "properties": {
          "cssFamily": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "provenance": {
            "type": "string",
            "enum": [
              "exact-file",
              "exact-name",
              "system",
              "declared"
            ]
          },
          "confidence": {
            "type": "number"
          },
          "rendered": {
            "type": "boolean",
            "description": "false: declared or loaded but draws no visible text."
          },
          "license": {
            "$ref": "#/components/schemas/License"
          },
          "free": {
            "type": "boolean"
          },
          "catalog": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/FontRef"
              },
              {
                "type": "null"
              }
            ]
          },
          "source": {
            "type": "string"
          },
          "usage": {
            "type": "object",
            "properties": {
              "share": {
                "type": "number",
                "description": "Share of the page’s text, 0 to 1."
              },
              "chars": {
                "type": "integer"
              },
              "weights": {
                "type": "array",
                "items": {
                  "type": "number"
                }
              },
              "sizes": {
                "type": "array",
                "items": {
                  "type": "number"
                }
              },
              "roles": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "sample": {
                "type": "string"
              }
            }
          },
          "files": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "type": "string"
                },
                "format": {
                  "type": "string"
                },
                "bytes": {
                  "type": "integer"
                }
              }
            }
          },
          "alternatives": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Alternative"
            }
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "SiteScan": {
        "type": "object",
        "properties": {
          "domain": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "finalUrl": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "scannedAt": {
            "type": "string",
            "format": "date-time"
          },
          "cached": {
            "type": "boolean"
          },
          "httpStatus": {
            "type": [
              "integer",
              "null"
            ]
          },
          "fonts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PageFont"
            }
          },
          "summary": {
            "type": "object",
            "properties": {
              "families": {
                "type": "integer"
              },
              "files": {
                "type": "integer"
              },
              "totalFontBytes": {
                "type": "integer"
              },
              "scripts": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "FontFileResult": {
        "type": "object",
        "properties": {
          "identity": {
            "type": "object"
          },
          "names": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "license": {
            "$ref": "#/components/schemas/License"
          },
          "metrics": {
            "type": "object"
          },
          "axes": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "features": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "scripts": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "glyphCount": {
            "type": "integer"
          },
          "catalog": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/FontRef"
              },
              {
                "type": "null"
              }
            ]
          },
          "alternatives": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Alternative"
            }
          },
          "alternativesPage": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "PdfResult": {
        "type": "object",
        "properties": {
          "pages": {
            "type": "integer"
          },
          "fonts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "rawName": {
                  "type": "string"
                },
                "family": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "weight": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "italic": {
                  "type": "boolean"
                },
                "embedded": {
                  "type": "boolean"
                },
                "chars": {
                  "type": "integer"
                },
                "license": {
                  "$ref": "#/components/schemas/License"
                },
                "free": {
                  "type": "boolean"
                },
                "catalog": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/FontRef"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "alternatives": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Alternative"
                  }
                }
              }
            }
          },
          "needsVisual": {
            "type": "boolean",
            "description": "Scanned or outlined pages: identify a rendering of the page with /image/identify."
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "PairingSuggestions": {
        "type": "object",
        "properties": {
          "anchor": {
            "$ref": "#/components/schemas/FontRef"
          },
          "role": {
            "type": "string",
            "enum": [
              "heading",
              "body"
            ]
          },
          "suggestions": {
            "type": "array",
            "items": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/FontRef"
                },
                {
                  "type": "object",
                  "properties": {
                    "score": {
                      "type": "number"
                    },
                    "reasons": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Reason"
                      }
                    }
                  }
                }
              ]
            }
          }
        }
      }
    }
  }
}