linkoi docsWebsite ↗

Metadata

One response shape. Missing values stay explicit.

Response type#

ts
export interface Metadata {
  url: string;
  title: string | null;
  description: string | null;
  image: string | null;
  logo: string | null;
  publisher: string | null;
  author: string | null;
  date: string | null;
  lang: string | null;
  source: "fast" | "fallback";
}

Field behaviour#

FieldDescription
urlNormalised page URL.
titleCleaned title, capped at 200 characters on the fast path.
descriptionCleaned description, capped at 500 characters on the fast path.
image / logoHTTP(S) image URLs. Relative URLs are resolved against the page URL.
publisher / authorPublisher and author names when available.
dateNormalised publication date when available.
langLanguage identifier. Fast-path regional tags are reduced to the primary language.
sourcefast or fallback.

Handle missing fields#

ts
const title = page.title ?? new URL(page.url).hostname
const image = page.image ?? '/default-preview.png'

Treat all extracted text as untrusted. Render it as text, not HTML. Returned image URLs also need your network policy if your server fetches them.

Extraction sources#

Linkoi reads Open Graph, Twitter Cards, JSON-LD, and HTML tags. New results always report source as fast. The fallback value remains in the type only for compatibility with older stored data.

Linkoi · PolyForm Shield 1.0.0