Skip to content
Metadata API · Use case

Fetch only the metadata fields you need

A metadata API should let you select fields, because the default payload detects every field, resolves every image and checks every URL. A search indexer that only needs the title, or a text pipeline that never shows a logo, waits for all of it. The meta object turns detection into a menu, and filter trims the JSON to the keys you read.

The problem

Full metadata detection is the expensive default

Detecting an image means finding candidates, fetching them, measuring them and verifying they load. Detecting a logo does the same for favicons and touch icons. When the consumer never renders either, that is wasted time on every uncached request.

Dropping the fields client-side changes nothing: the work already happened and the bytes already crossed the network. Writing a separate lightweight scraper for the title-only jobs means a second codebase, one that loses the normalization across Open Graph, Twitter Cards, JSON-LD and the HTML.

Pass meta as an object. Fields set to true are the only ones detected; fields set to false are removed from the default set. Combine it with filter for the response shape and each request carries exactly what the consumer reads. The choosing fields guide has the include versus exclude table.

How it works

How to select fields for fast metadata extraction

There are two ways to scope detection, include and exclude, and one way to scope the response. All three work on the free endpoint.

1 · Include only what you render
import createClient from 'microlink.io'

const microlink = createClient({
  apiKey: process.env.MICROLINK_API_KEY
})

const { title, description } = await microlink.metadata('https://example.com', {
  meta: { title: true, description: true }
})

Only title and description are detected. image, logo and the rest of the default set are never processed.

2 · Exclude the heavy fields
import createClient from 'microlink.io'

const microlink = createClient({
  apiKey: process.env.MICROLINK_API_KEY
})

const { title, author, date } = await microlink.metadata('https://example.com', {
  meta: { image: false, logo: false }
})

The default set minus media: title, description, lang, author, publisher, date and url, without any image fetching.

3 · The same request as a URL
curl 'https://api.microlink.io/?url=https%3A%2F%2Fexample.com&meta.title=true&meta.description=true&filter=title%2Cdescription'

meta scopes detection and filter trims the JSON to the listed keys. filter accepts dot notation, so image.url returns one property of a media field.

Parameters used
  • meta Object of field names set to true (include only) or false (exclude). Default true, which detects everything.
  • filter Comma-separated list of keys to keep in the JSON response, with dot notation for nested fields.
  • ping Default true. Pass false, or an object such as { audio: false }, to skip reachability checks.
  • prerender false forces a plain HTTP GET for pages you know are server-rendered. Default auto.
  • javascript Default true. Set false when the page does not need JavaScript to expose its metadata.

meta: false disables detection entirely, and the x-fetch-mode header reports skipped. That is the right setting when the request only exists for a screenshot, a PDF or custom rules. The caching and performance guide ranks the other speedups.

Why it works

Why scoping fields makes for a lightweight link preview API

Every skipped field is work the API does not do and bytes the network does not carry.

01 · Less work per request
Images and logos are the expensive fields.
Media detection fetches and measures candidate files. Excluding image and logo removes that step, and including only title brings the request close to a plain fetch.

For link previews at scale the saving multiplies across every uncached request.

02 · Smaller payloads
filter returns only the keys you read.
A response with three fields is easier to log, cheaper to store and faster to parse than the full object with nested asset details.

The delivery and response guide covers filter next to the other ways of shaping the output.

03 · Same normalization
Scoped fields are still the normalized ones.
Including only title does not change how title is detected. It is still merged from Open Graph, Twitter Cards, JSON-LD and the HTML, exactly as in a full request.

When not to: while exploring a new source, request the default set first to see what the page exposes, and narrow the request once you know which fields are reliable. The same trim-the-work idea applies to faster, smaller screenshots.

FAQ

How do I request only some metadata fields?

Pass meta as an object with the fields you want set to true, for example meta: { title: true, description: true }. Only those fields are detected, and everything else is skipped before any work happens.

How do I skip image and logo detection in a metadata request?

Set them to false in the meta object: meta: { image: false, logo: false }. The rest of the default set is still detected, so you keep title, description, author, publisher and date without fetching any media.

What is the difference between meta and filter in the metadata API?

meta controls which fields are detected, so it changes the work the request does. filter controls which keys appear in the JSON, so it only changes the response shape. Use both when you want a fast request and a small payload.

Does selecting metadata fields change the cache entry?

Yes. The cache key is derived from the URL and every recognized parameter, so a request with a different meta object is a separate cache entry. Keep the meta object identical across calls to share the entry, and remember that cache hits do not count against your quota.

Which metadata fields are returned by default?

title, description, lang, author, publisher, date, url, image and logo. Text fields are strings, and image and logo are asset objects with url, type, size, width and height. video and audio are opt-in, and a field the page does not expose comes back as null.
Related use cases

Solve the next problem with the same API

Link previews at scale

Unfurl links at any volume: no throttling, background refresh and cache hits that never count against your quota.

Custom fields alongside metadata

Get prices, ratings, headings or any CSS selector, typed and returned next to the normalized metadata.

Brand colors from images

Get the dominant palette and an accessible text and background pair from a site’s logo and preview image.

Metadata from single-page apps

Render React, Vue or Angular apps in a headless browser, wait for the tags, then read the normalized metadata.

Faster, smaller screenshots

Skip metadata, pick JPEG quality and pixel density, and wait for a selector instead of a timer to cut time and bytes.

Clean Markdown, no boilerplate

Convert only the article body: one selector keeps navigation, ads and widgets out of the Markdown.

Ready for lean metadata requests?

Detect only what you render and return only what you read. Start on the free tier and trim your first request today.