import ContextDev from 'context.dev';
const client = new ContextDev({
apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted
});
const response = await client.web.extractFonts();
console.log(response.code);{
"status": "<string>",
"domain": "<string>",
"fonts": [
{
"font": "<string>",
"uses": [
"<string>"
],
"fallbacks": [
"<string>"
],
"num_elements": 123,
"num_words": 123,
"percent_words": 123,
"percent_elements": 123
}
],
"code": 123,
"fontLinks": {}
}Scrape font information from a website including font families, usage statistics, fallbacks, and element/word counts.
import ContextDev from 'context.dev';
const client = new ContextDev({
apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted
});
const response = await client.web.extractFonts();
console.log(response.code);{
"status": "<string>",
"domain": "<string>",
"fonts": [
{
"font": "<string>",
"uses": [
"<string>"
],
"fallbacks": [
"<string>"
],
"num_elements": 123,
"num_words": 123,
"percent_words": 123,
"percent_elements": 123
}
],
"code": 123,
"fontLinks": {}
}5 CreditsDocumentation Index
Fetch the complete documentation index at: https://docs.context.dev/llms.txt
Use this file to discover all available pages before exploring further.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Domain name to extract fonts from (e.g., 'example.com', 'google.com'). The domain will be automatically normalized and validated. You must provide either 'domain' or 'directUrl', but not both.
A specific URL to fetch fonts from directly, bypassing domain resolution (e.g., 'https://example.com/design-system'). When provided, fonts are extracted from this exact URL. You must provide either 'domain' or 'directUrl', but not both.
Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).
1000 <= x <= 300000Successful response
Status of the response, e.g., 'ok'
The normalized domain that was processed
Array of font usage information
Show child attributes
HTTP status code, e.g., 200
Font assets keyed by family name as it appears in the fonts array (non-generic names only). Clients match entries in fonts to pick a file URL from files. Omitted when no families resolve to Google or custom @font-face URLs.
Show child attributes
Was this page helpful?