Skip to main content
POST
/
v1
/
api
/
lens
Font recognition
const options = {
  method: 'POST',
  headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
  body: JSON.stringify({image_url: 'https://images.example.com/wordmark.png', top_k: 3})
};

fetch('https://api.mixfont.com/v1/api/lens', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "word": "Mixfont",
  "word_box": {
    "left": 140,
    "top": 96,
    "width": 412,
    "height": 104
  },
  "input_image": {
    "width": 1600,
    "height": 900,
    "image_url": "https://images.example.com/wordmark.png"
  },
  "font_matches": [
    {
      "name": "Inter",
      "score": 0.83,
      "fonts": [
        {
          "full_name": "Inter Regular",
          "style": "normal",
          "weight": 400,
          "url": "https://static.mixfont.com/fonts/inter/Inter-Regular.ttf"
        },
        {
          "full_name": "Inter Italic",
          "style": "italic",
          "weight": 400,
          "url": "https://static.mixfont.com/fonts/inter/Inter-Italic.ttf"
        }
      ]
    },
    {
      "name": "Public Sans",
      "score": 0.11,
      "fonts": [
        {
          "full_name": "Public Sans Regular",
          "style": "normal",
          "weight": 400,
          "url": "https://static.mixfont.com/fonts/public-sans/PublicSans-Regular.ttf"
        }
      ]
    }
  ],
  "requestId": "7d58a66d-f129-4f9a-bf9a-4f2c6d0c3e4d"
}
Analyze a public image URL and return ranked open-source font matches for the largest readable word in the image.

Font recognition guide

Learn when to use font recognition and see a complete example response.

Authorizations

x-api-key
string
header
required

Body

application/json
image_url
string<uri>
required

Public http:// or https:// image URL to analyze. The image response must be no larger than 10 MB.

top_k
integer
default:3

Number of font matches to return.

Required range: 1 <= x <= 10

Response

Successful response

word
string | null
required

Largest detected word in the image. This can be null if no confident word is found.

word_box
object
required

Location of the detected word in the original image. This can be null if detection falls back to the full image.

input_image
object
required
font_matches
object[]
required

Ranked font matches, sorted best first.

requestId
string

Request identifier to share with support.