Typekit's font library contains hundreds of font families and thousands of font family variations. The Typekit API gives you access to detailed metadata about all of these font families and variations.
Fetching library information
You can fetch information about the libraries available through typekit by making a GET
request to libraries
. You can then get information on the font families in one of those libraries by sending a request to libraries/:library
. For example:
$ curl -s https://typekit.com/api/v1/json/libraries/trial | jsonpretty
{
"library": {
"id": "trial",
"link": "/api/v1/json/libraries/trial",
"name": "Trial Library",
"families": [
{
"id": "gmsj",
"link": "/api/v1/json/families/gmsj",
"name": "Adelle Web"
},
…
],
"pagination": {
"count": 153,
"on": "families"
"page": 1,
"page_count": 8,
"per_page": 20
}
}
}
Fetching font family information
Once you have the ID of a family you're interested in, you can find out more information by making a GET
request to families/:family
. For example:
$ curl -s https://typekit.com/api/v1/json/families/pcpv | jsonpretty
{
"family": {
"browse_info": {
"width": [
"regular"
],
"language": [
"ca",
"cs",
"de",
"en",
"es",
"fr",
"it",
"mt",
"nl",
"pl",
"pt",
"ru",
"sl",
"sv"
],
"x_height": [
"high"
],
"weight": [
"regular"
],
"number_style": [
"uppercase"
],
"classification": [
"serif"
],
"contrast": [
"regular"
],
"capitals": [
"uppercase-lowercase"
],
"recommended_for": [
"paragraphs"
]
},
"id": "pcpv",
"name": "Droid Serif",
"libraries": [
{
"id": "trial",
"name": "Trial Library",
"link": "/api/v1/json/libraries/trial"
},
{
"id": "personal",
"name": "Personal Library",
"link": "/api/v1/json/libraries/personal"
},
{
"id": "full",
"name": "Full Library",
"link": "/api/v1/json/libraries/full"
}
],
"css_stack": "serif",
"foundry": {
"name": "Google Android",
"slug": "google-android"
},
"variations": [
{
"id": "pcpv:n4",
"name": "Droid Serif Regular",
"link": "/api/v1/json/families/pcpv/n4",
"fvd": "n4"
},
{
"id": "pcpv:i4",
"name": "Droid Serif Italic",
"link": "/api/v1/json/families/pcpv/i4",
"fvd": "i4"
},
{
"id": "pcpv:n7",
"name": "Droid Serif Bold",
"link": "/api/v1/json/families/pcpv/n7",
"fvd": "n7"
},
{
"id": "pcpv:i7",
"name": "Droid Serif Bold Italic",
"link": "/api/v1/json/families/pcpv/i7",
"fvd": "i7"
}
],
"description": "Droid Serif is a contemporary serif typeface family designed for comfortable reading on screen. Droid Serif is slightly condensed to maximize the amount of text displayed on small screens. Vertical stress, sturdy serifs and open forms contribute to the readability.",
"web_link": "http://typekit.com/fonts/droid-serif",
"slug": "droid-serif"
}
}
This output tells you some information about the family, including the libraries that include the font family and the variations that exist within the font family. You can make a GET
request to families/:family/:variation
for more information on each variation.
Font Family IDs
The Typekit website uses human readable slugs when constructing URLs for font families. These slugs are derived from the name of the font, and unfortunately occasionally need to be updated.
We maintain redirects when slugs are updated, but many applications need an immutable ID that they can store in their database. The IDs used in the Typekit API aren't human readable, but will never change.
To convert from a font family slug to a font family id, you can make a GET
request to families/:family
with the slug and the API will respond with a 302 redirect, with a body containing extra information. For example:
$ curl -s -i https://typekit.com/api/v1/json/families/droid-sans | jsonpretty
HTTP/1.1 302 Moved Temporarily
Connection: close
Date: Tue, 27 Jul 2010 23:24:19 GMT
Location: /api/v1/json/families/gkmg
Content-Type: application/json; charset=utf-8
Content-Length: 60
{
"family": {
"id": "gkmg",
"link": "/api/v1/json/families/gkmg"
}
}
To convert from a font id to a slug, make a GET
request to families/:family
and read the slug
attribute in the response.