{"openapi":"3.1.0","info":{"title":"Li Type Library public API","version":"1.0.0","description":"Search published typefaces, inspect original licences and provenance, and download unchanged font packages. All operations are read-only and require no API key. Resolve relative links against the origin from which this document was fetched. Live responses are authoritative; unavailable typefaces and their files return 404."},"servers":[{"url":"/","description":"Current origin, including the local development port."}],"security":[],"externalDocs":{"description":"AI / Agent guide","url":"/en/agents"},"paths":{"/api/fonts":{"get":{"operationId":"searchFonts","summary":"Search currently published fonts","description":"Returns all matches without pagination. Whitespace-separated terms must all match a name, alias, publisher, style, format, script or licence. Search ignores case and punctuation and normalizes full-width characters. Empty q lists all published fonts.","parameters":[{"name":"q","in":"query","schema":{"type":"string","maxLength":160,"default":""},"description":"Font name, alias, publisher or keyword; UTF-8 query values must be URL-encoded."},{"name":"script","in":"query","schema":{"type":"string","enum":["","cjk","latin"],"default":""},"description":"Empty = all, cjk = Chinese catalogue, latin = Latin catalogue."}],"responses":{"200":{"description":"Current published matches; an empty search is a successful response with total=0 and items=[].","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FontList"}}}}}}},"/api/fonts/{id}":{"get":{"operationId":"getFont","summary":"Get one published font, its licence, checksums and links","parameters":[{"name":"id","in":"path","required":true,"description":"Stable font ID returned by searchFonts.","schema":{"type":"string","maxLength":90,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"}}],"responses":{"200":{"description":"The current published metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Font"}}}},"404":{"description":"Typeface is unavailable or unpublished. Refresh the live catalogue.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/files/{id}/download":{"get":{"operationId":"downloadFontPackage","summary":"Download the original font, OFL.txt and SOURCE.txt as a ZIP","parameters":[{"name":"id","in":"path","required":true,"description":"Stable font ID returned by searchFonts.","schema":{"type":"string","maxLength":90,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"}}],"responses":{"200":{"description":"Download the original font, OFL.txt and SOURCE.txt as a ZIP","headers":{"Content-Length":{"schema":{"type":"integer","minimum":1}},"Content-Disposition":{"schema":{"type":"string"},"description":"attachment with the ZIP filename"}},"content":{"application/zip":{"schema":{"type":"string","format":"binary"}}}},"404":{"description":"Typeface is unavailable or unpublished."}}}},"/files/{id}/license":{"get":{"operationId":"getFontLicense","summary":"Read the original copyright notice and complete licence","parameters":[{"name":"id","in":"path","required":true,"description":"Stable font ID returned by searchFonts.","schema":{"type":"string","maxLength":90,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"}}],"responses":{"200":{"description":"Unmodified upstream licence text.","content":{"text/plain":{"schema":{"type":"string"}}}},"404":{"description":"Typeface is unavailable or unpublished."}}}},"/files/{id}/font":{"get":{"operationId":"getFontFile","summary":"Get the original font bytes for preview or inspection","parameters":[{"name":"id","in":"path","required":true,"description":"Stable font ID returned by searchFonts.","schema":{"type":"string","maxLength":90,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"}}],"responses":{"200":{"description":"Original OTF or TTF; use format to select the appropriate media type.","content":{"font/otf":{"schema":{"type":"string","format":"binary"}},"font/ttf":{"schema":{"type":"string","format":"binary"}}}},"404":{"description":"Typeface is unavailable or unpublished."}}}},"/files/{id}/proof":{"get":{"operationId":"getFontProof","summary":"Get the lightweight specimen PNG","parameters":[{"name":"id","in":"path","required":true,"description":"Stable font ID returned by searchFonts.","schema":{"type":"string","maxLength":90,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"}}],"responses":{"200":{"description":"Get the lightweight specimen PNG","headers":{"Content-Length":{"schema":{"type":"integer","minimum":1}}},"content":{"image/png":{"schema":{"type":"string","format":"binary"}}}},"404":{"description":"Typeface is unavailable or unpublished."}}}}},"components":{"schemas":{"Font":{"type":"object","required":["id","names","localizedNames","aliases","script","variant","sample","version","format","publisher","filename","license","licenseId","commercialUse","redistribution","copyright","project","originalURL","originalLicenseURL","font","proof","licenseURL","download","downloadBytes","proofSize","sha256","licenseSha256","packageSha256","fontBlob","licenseBlob","sourceReview","links"],"properties":{"id":{"type":"string","description":"Language-independent ID. Use this for subsequent requests."},"names":{"type":"array","items":{"type":"string"},"minItems":2,"maxItems":2,"description":"Legacy display names, in [zh, en] order."},"localizedNames":{"type":"object","required":["zh","en"],"properties":{"zh":{"type":"string"},"en":{"type":"string"}}},"aliases":{"type":"array","items":{"type":"string"}},"script":{"type":"string","enum":["cjk","latin"],"description":"Catalogue category, not a guarantee of full Unicode coverage."},"variant":{"type":"array","items":{"type":"string"},"minItems":2,"maxItems":2,"description":"[zh, en] descriptions of the included style."},"sample":{"type":"string"},"version":{"type":"string","description":"Internal OpenType version; may differ from the upstream release tag."},"format":{"type":"string","enum":["OTF","TTF"]},"publisher":{"type":"string"},"filename":{"type":"string"},"license":{"type":"string","const":"OFL 1.1"},"licenseId":{"type":"string","const":"OFL-1.1"},"commercialUse":{"type":"string","const":"free"},"redistribution":{"type":"string","const":"permitted"},"copyright":{"type":"string"},"project":{"type":"string","format":"uri"},"originalURL":{"type":"string","format":"uri"},"originalLicenseURL":{"type":"string","format":"uri"},"font":{"type":"string","pattern":"^/"},"proof":{"type":"string","pattern":"^/"},"licenseURL":{"type":"string","pattern":"^/"},"download":{"type":"string","pattern":"^/"},"downloadBytes":{"type":"integer","minimum":1},"proofSize":{"type":"array","items":{"type":"number"},"minItems":3,"maxItems":3},"sha256":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"SHA-256 of the original OTF/TTF, not the ZIP."},"licenseSha256":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"SHA-256 of the packaged licence text."},"packageSha256":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"SHA-256 of the download ZIP. Verify this after downloading."},"fontBlob":{"type":"string","pattern":"^[a-f0-9]{40}$"},"licenseBlob":{"type":"string","pattern":"^[a-f0-9]{40}$"},"sourceReview":{"type":["object","null"],"required":["projectName","ref","commit","url","date"],"properties":{"projectName":{"type":"string"},"ref":{"type":"string"},"commit":{"type":"string","pattern":"^[a-f0-9]{40}$"},"url":{"type":"string","format":"uri"},"date":{"type":"string","format":"date"}}},"links":{"type":"object","required":["self","details","font","proof","license","download","officialProject","originalFont","originalLicense"],"properties":{"self":{"type":"string","pattern":"^/"},"details":{"type":"object","required":["zh","en"],"properties":{"zh":{"type":"string","pattern":"^/"},"en":{"type":"string","pattern":"^/"}}},"font":{"type":"string","pattern":"^/"},"proof":{"type":"string","pattern":"^/"},"license":{"type":"string","pattern":"^/"},"download":{"type":"string","pattern":"^/"},"officialProject":{"type":"string","format":"uri"},"originalFont":{"type":"string","format":"uri"},"originalLicense":{"type":"string","format":"uri"}}}}},"FontList":{"type":"object","required":["apiVersion","items","total","links"],"properties":{"apiVersion":{"type":"string","const":"1"},"items":{"type":"array","items":{"$ref":"#/components/schemas/Font"}},"total":{"type":"integer","minimum":0},"links":{"type":"object","required":["self","openapi","guides"],"properties":{"self":{"type":"string","pattern":"^/"},"openapi":{"type":"string","pattern":"^/"},"guides":{"type":"object","required":["zh","en"],"properties":{"zh":{"type":"string","pattern":"^/"},"en":{"type":"string","pattern":"^/"}}}}}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}