with one click
microlink-api
// Use Microlink API/MQL to extract URL metadata, build link previews, capture screenshots/PDFs, scrape CSS-selected data, and avoid browser infrastructure.
// Use Microlink API/MQL to extract URL metadata, build link previews, capture screenshots/PDFs, scrape CSS-selected data, and avoid browser infrastructure.
Automate browserless/Puppeteer headless Chrome for screenshots, PDFs, HTML/text extraction, status checks, Lighthouse audits, and browser pipelines.
Create project-local skills for Cursor and Claude Code when users ask to create, add, or update reusable repo instructions.
Retrieve normalized HTML from URLs with fetch or headless prerender for JS pages, absolute URL rewriting, and metadata extraction pipelines.
Tune Kubernetes HPA, topology spread, requests, and scale-down behavior for cluster cost audits, incidents, replica/node issues, and over-reservation.
Build @keyvhq/core key-value caches with TTL, namespaces, memoization, cache-aside patterns, and Redis/Mongo/MySQL/PostgreSQL/SQLite adapters.
Extract metadata from HTML with metascraper rules for link previews, Open Graph, Twitter Cards, JSON-LD, titles, images, authors, and custom parsers.
| name | microlink-api |
| description | Use Microlink API/MQL to extract URL metadata, build link previews, capture screenshots/PDFs, scrape CSS-selected data, and avoid browser infrastructure. |
Microlink turns a URL into structured output over HTTP. It can return metadata, media assets, scraped content, and browser-rendered results.
https://api.microlink.io (no auth, 50 requests/day)https://pro.microlink.io (requires x-api-key header)const mql = require('@microlink/mql')
const { status, data, response } = await mql('https://example.com')
meta: truemeta: falsefilter (example: 'url,title,image.url')screenshot: true.pdf: true.data rules with CSS selectors.embed.prerender: true or keep auto.Microlink uses JSend-style responses:
{
"status": "success",
"data": {},
"message": "optional",
"more": "optional docs url"
}
status: success (2xx), fail (4xx), error (5xx)data: extracted output (title, description, image, video, and more)For copy-paste recipes, see common-workflows/README.md.
npm install @microlink/mql
const mql = require('@microlink/mql')import mql from '@microlink/mql/lightweight'import mql from 'https://esm.sh/@microlink/mql'mql(url, [options], [httpOptions])
url: required target URLoptions: Microlink parameters plus apiKey, cache, retryhttpOptions: forwarded to the underlying HTTP clientExtra methods: mql.stream(), mql.buffer().
url (required): target URL with protocolmeta (default true): metadata extractiondata: custom scraping rulesfilter: comma-separated output fieldsembed: return one field directly as response bodyscreenshot / screenshot.*: create page imagepdf / pdf.*: create PDFvideo, audio: detect playable sourcesprerender: auto, true, or falsewaitUntil, waitForSelector, waitForTimeout, timeoutdevice, viewport, javascript, animations, mediaTypeclick, scroll, scripts, modules, stylesforce: bypass cachettl (Pro): cache lifetimestaleTtl (Pro): stale-while-revalidate strategyheaders, proxy, filename, ttl, staleTtldata: {
avatar: { selector: '#avatar', attr: 'src', type: 'image' }
}
data: {
stories: { selectorAll: '.titleline > a', attr: 'text' }
}
data: {
title: [
{ selector: 'meta[property="og:title"]', attr: 'content' },
{ selector: 'title', attr: 'text' },
{ selector: 'h1', attr: 'text' }
]
}
data: {
stats: {
selector: '.profile',
attr: {
followers: { selector: '.followers', type: 'number' },
stars: { selector: '.stars', type: 'number' }
}
}
}
data: {
version: { evaluate: 'window.next.version', type: 'string' }
}
const { MicrolinkError } = mql
try {
const { data } = await mql('https://example.com', { screenshot: true })
} catch (error) {
// error.status, error.code, error.message, error.statusCode
}
Common error codes: EAUTH, ERATE, EINVALURL, EBRWSRTIMEOUT, EPRO, ETIMEOUT.
x-api-key in client-side code.pro.microlink.io for authenticated requests.microlinkhq/proxy or microlinkhq/edge-proxy).meta: false.npm install -g @microlink/cli
microlink <url> [flags]
Common flags: --api-key, --pretty, --copy, --colors.
For complete parameter-by-parameter docs, full error matrix, and response headers, see api-reference.md.