Metascraper normalizes article and page metadata from HTML using Open Graph, JSON-LD, Microdata, RDFa, Twitter Cards, and fallback rules. You supply a URL plus markup; it returns fields such as title, author, image, and description.
Overview
Metascraper is a Node.js library built from small rule bundles. Each bundle targets one metadata property with ordered selectors and fallbacks: the first rule that resolves a value wins, moving from specific signals to generic HTML cues. The design favors high accuracy on online articles and allows custom or vendor-specific bundles.
Core bundles cover audio, author, citation tags, dates, descriptions, feeds, images, language, logos, publishers, titles, URLs, videos, and related fields. Additional packages integrate sites such as YouTube, Instagram, Reddit, Spotify, and Bluesky. Helpers support readability-style parsing and BIMI logo lookup.
The constructor loads an explicit list of rule packages; execution takes HTML (or a parsed DOM) and a canonical URL for resolving relative links. Options can omit or pick property names, attach runtime rules, and validate URLs. An environment flag optionally swaps in RE2 for regular expressions.
Accuracy comes from layered fallbacks rather than relying only on Open Graph tags. For fetching rendered HTML at scale, Microlink documents a headless-browser helper pairing, while Microlink’s hosted API offers managed proxy rotation and anti-bot handling if you do not want to run that infrastructure yourself.
Key features
- Rule-bundle pipeline with prioritized fallbacks
- Open Graph, JSON-LD, and Twitter Card support
- Per-field official and vendor bundles
- Custom rule and bundle composition
- DOM or raw HTML input
- Property pick and omit filters
- Article-focused default tuning
- Optional RE2-backed regex engine
Use cases
- Link preview cards in chat or social apps
- Normalizing blog and news article metadata
- Enriching bookmarks with title and image
- Building unfurl APIs behind your own fetch layer
- Site-specific metadata via vendor rule packs