Get brand, styleguide and font data from a site
Detect the fonts a website uses, read its brand colors, logos and links, and get its type scale and design tokens with the brand, styleguide and fonts APIs.
Updated
Three endpoints describe how a site looks and who it says it is. brand returns the brand profile, styleguide returns the visual system and fonts returns every font family the page uses. This guide shows what each one returns and what it costs.
Make a request
All three take the same body. Only url is required.
curl -X POST https://api.wayfern.com/api/v1/fonts \
-H "Authorization: Bearer $WAYFERN_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "url": "https://example.com", "waitFor": 1500 }' | Endpoint | Credits | Returns |
|---|---|---|
POST /api/v1/brand | 10 per profile | Name, contact data, colors, logos and links |
POST /api/v1/styleguide | 10 per site | Colors by role, type scale, radii, shadows, spacing, breakpoints, CSS variables |
POST /api/v1/fonts | 5 per site | Font families with their source, weights, files and use |
These endpoints also take proxy, country, timeout, waitFor and headers. The default timeout is 45 seconds. Each route allows 30 requests a minute.
Each call loads the page once with images, fonts and stylesheets. It waits for the network to go quiet, up to 8 seconds, and samples the computed styles of the live page. There is no cache for these reports, so each call loads the page and is billed. A failed call costs nothing. For a client-rendered site, add waitFor in milliseconds.
Brand profile
data has these fields:
domain,url,nameandlegalNamedescription,slogan,industryandfoundedemail,phoneandaddresscolors.primaryandcolors.palette. Each palette color hashex,sourceandweight.logos, each withurl,type,format,width,heightandvariant.typeisicon,logo,og-image,apple-touch-icon,mask-iconormanifest-icon.links.social, keyed by network, andlinks.sitefor pages such as pricing or docsmetadata, the same page metadata a scrape returns
A color source is theme-color, manifest, css-variable or computed. For computed colors, weight is the number of sampled elements that use the color. A declared color has weight 0. Use source to tell a declared brand color from a color that is only common on the page.
Wayfern also reads the web app manifest. When the markup has no description, industry or slogan, a language model fills them from the page text, if it is available. It never replaces a value that the markup declares.
Styleguide
data has these fields:
colors.palette, pluscolors.text,colors.backgroundandcolors.accent. Accent colors are the colors of links and buttons.typography.families, each withfamily,stack,countandrole.roleisheading,body,monoorui.typography.scale, each size with itscountand thelineHeightandweightmost often used with ittypography.weights,typography.lineHeightsandtypography.letterSpacingsradiifrom small to large,shadowsfrom most used, andspacingfrom small to largebreakpoints, themin-widthmedia queries in the site’s own CSScssVariables, the custom properties on:rootsources, the stylesheets the report used, withurl,bytesandinline
The report comes from the stylesheets the page loaded and from the live page, so it describes what renders.
Fonts
Use /api/v1/fonts to detect the fonts a website uses. Each entry in data.fonts has:
familyandsource.sourceisgoogle,adobe,bunny,fontshare,self-hosted,third-partyorsystem.host, the host that serves the files, ornullfor a system fontweights,stylesandformatsfiles, the font files the page downloaded, each withurl,formatandbytesdisplay, thefont-displayvalue, andunicodeRangesusage, withelementCount,sampleSelector,headingandbody.headingis true when anh1,h2orh3uses the family.
data.totalBytes is the total size of the font files the page downloaded.
const res = await fetch("https://api.wayfern.com/api/v1/fonts", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.WAYFERN_API_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ url: "https://example.com" }),
});
const body = await res.json();
if (!res.ok) throw new Error(`${body.error}: ${body.message}`);
for (const font of body.data.fonts) {
const where = font.usage.heading && font.usage.body ? "headings and body" : font.usage.heading ? "headings" : "body";
console.log(`${font.family} (${font.source}) ${font.weights.join("/")} for ${where}`);
}
console.log(`${body.data.totalBytes} bytes of web fonts, ${body.credits} credits`); Costs and limits
Residential bandwidth, when used, costs 320 credits per GB on top of the report rate. These pages load images and fonts, so a residential exit uses more bytes than a scrape. See Pricing and the references for Brand profile, Styleguide and Fonts.