BYTETOOLS

Fontsource API

Query font metadata including weights, styles, subsets, unicode ranges and licences for Google Fonts and more. No API key, unlike the official Google Fonts API.

No API key requiredCORS enabledHTTPSFree tier

Endpoint tested and returned HTTP 200 on 2026-08-21

What is the Fontsource API?

Fontsource publishes a metadata API for self-hostable open source fonts. `GET https://api.fontsource.org/v1/fonts/{id}` returns a font's weights, styles, subsets, unicode ranges, licence and variable-font status. Unlike the official Google Fonts API, no key is required.

Google's own Fonts Developer API requires a key, which is a needless obstacle when all you want is to know which weights of Roboto exist. Fontsource mirrors the same catalogue plus fonts from other open source sources, and serves the metadata anonymously. The project's real purpose is self-hosting fonts as npm packages, and this API is the index behind that.

The most valuable field is `unicodeRange`, a map of subset name to the exact code point ranges each subset covers. That is the data you need to write correct `@font-face` rules with `unicode-range` descriptors, which is what lets a browser download only the subsets a page actually uses. Copying those ranges by hand from a stylesheet is tedious and error-prone; here they arrive structured. Note that `variable: true` only tells you a variable version exists, not that the static weights are unavailable.

Quick facts

Base URL
https://api.fontsource.org/v1
Authentication
No key or account, in deliberate contrast to the official Google Fonts Developer API.
Rate limit
Not published. Font metadata changes rarely, so fetch at build time rather than at runtime.
Pricing
Free and open source. The fonts themselves carry their own licences, recorded in the `license` field.
CORS
Enabled — callable directly from browser JavaScript
Official docs
Read the docs

How to use the Fontsource API

Every request below was executed against the live API on 2026-08-21, and the response shown is the real body it returned — not an illustration.

1. Fetch metadata for a font family

GET https://api.fontsource.org/v1/fonts/roboto

curl
curl 'https://api.fontsource.org/v1/fonts/roboto'
JavaScript (fetch)
const res = await fetch("https://api.fontsource.org/v1/fonts/roboto");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);
Python (requests)
import requests

res = requests.get("https://api.fontsource.org/v1/fonts/roboto", timeout=20)
res.raise_for_status()
print(res.json())
Response — HTTP 200 (truncated)
{
  "id": "roboto",
  "family": "Roboto",
  "subsets": [
    "cyrillic",
    "cyrillic-ext",
    "greek",
    "greek-ext",
    "latin",
    "latin-ext",
    "math",
    "symbols",
    "vietnamese"
  ],
  "weights": [
    100,
    200,
    300,
    400,
    500,
    600,
    700,
    800,
    900
  ],
  "styles": [
    "italic",
    "normal"
  ],
  "defSubset": "latin",
  "variable": true,
  "lastModified": "2026-02-19",
  "category": "sans-serif",
  "license": "OFL-1.1",
  "type": "google",
  "version": "v51",
  "source": "https://github.com/google/fonts",
  "npmVersion": "5.3.0",
  "unicodeRange": {
    "cyrillic-ext": "U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F",
    "cyrillic": "U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116",
    "greek-ext": "U+1F00-1FFF",
    "greek": "U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF",
    "math": "U+0302-0303,U+0305,U+0307-0308,U+0310,U+0312,U+0315,U+031A,U+0326-0327,U+032C,U+032F-0330,U+0332-0333,U+0338,U+033A,U+0346,U+034D,U+0391-03A1,U+03A3-03A9,U+03B1-03C9,U+03D1,U+03D5-03D6,U+03F0-03F1,U+03F4-03F5,U+2016-2017,U+2034-2038,U+203C,U+2040,U+2043,U+2047,U+2050,U+2057,U+205F,U+2070-2071,U+2074-208E,U+2090-209C,U+20D0-20DC,U+20E1,U+20E5-20EF,U+2100-2112,U+2114-2115,U+2117-2121,U+2123-214F,U+2190,U+2192,U+2194-21AE,U+21B0-21E5,U+21F1-21F2,U+21F4-2211,U+2213-2214,U+2216-22FF,U+2308-230B,U+2310,U+2319,U+231C-2321,U+2336-237A,U+237C,U+2395,U+239B-23B7,U+23D0,U+23DC-23E1,U+2474-2475,U+25AF,U+25B3,U+25B7,U+25BD,U+25C1,U+25CA,U+25CC,U+25FB,U+266D-266F,U+27C0-27FF,U+2900-2AFF,U+2B0E-2B11,U+2B30-2B4C

Parameters

ParameterTypeRequiredDescription
{id}pathRequiredFont id: the family name lowercased with hyphens, such as `roboto` or `open-sans`. roboto
/v1/fontspathOptionalList every font in the catalogue. Accepts `family`, `subset`, `variable` and `category` filters. ?category=serif
/v1/variable/{id}pathOptionalVariable-font axis definitions for families that publish one. roboto

Response fields

id / familystring
Hyphenated identifier and the display family name. Use `id` in URLs and package names, `family` in CSS.
weightsarray of integers
Available numeric weights such as 100 through 900. Genuine integers, not strings.
stylesarray of strings
Usually `normal` and `italic`. A family with only `normal` has no real italic, so browsers will synthesise a slanted form.
subsetsarray of strings
Character subsets published, such as `latin`, `cyrillic-ext`, `greek` and `vietnamese`.
defSubsetstring
The default subset, almost always `latin`. This is what you get if you do not specify one.
unicodeRangeobject
Map of subset name to CSS `unicode-range` value. Paste these straight into `@font-face` rules to enable subset-aware loading.
variableboolean
Whether a variable version exists. It does not mean the static weights are gone; both are usually published.
licensestring
SPDX-style licence identifier such as `OFL-1.1`. Read it before bundling a font into a commercial product.
typestring
Upstream source, for example `google`. Fontsource also carries fonts from other open source collections.
lastModified / versionstring
Date of the last update and the upstream version string, for cache-busting a self-hosted copy.

What you can build with the Fontsource API

  • Generate correct `@font-face` rules with unicode-range subsetting automatically
  • Check which weights and styles exist before designing a type scale
  • Audit the licences of every font bundled into a product
  • Build a font picker that shows only families supporting the scripts you need
  • Self-host fonts for privacy or performance instead of loading from Google's CDN

Common errors and how to fix them

404

The font id is wrong. Ids are lowercase and hyphenated.

Fix: `Open Sans` is `open-sans`, not `opensans` or `OpenSans`. Search the `/v1/fonts` list to confirm.

Missing weight in your CSS

You assumed a weight exists because a browser rendered something.

Fix: Check the `weights` array. Browsers fake missing weights by synthesising bold, which looks noticeably worse than a real cut.

Wrong characters render as boxes

You loaded only the default `latin` subset for text needing another script.

Fix: Read `subsets` and `unicodeRange`, and load the specific subsets your content requires.

Fontsource API — frequently asked questions

Does the Fontsource API need an API key?

No, and that is its main advantage over Google's own Fonts Developer API, which requires a key for the equivalent metadata.

Does Fontsource serve the font files as well?

Yes, alongside npm packages for self-hosting. This API returns the metadata; the CDN and packages deliver the actual woff2 files.

What is unicodeRange for?

It gives you the exact code point ranges of each subset, which go into `@font-face` `unicode-range` descriptors so browsers download only the subsets a page needs.

Is it only Google Fonts?

No. Google Fonts is the largest source and is marked with `type: "google"`, but the catalogue includes other open source families too.

Tools that pair with this API

Fontsource is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-21; always check the official documentation before relying on this API in production, as terms and limits can change.