Skip to content

Web Scraping

Turn any URL into structured JSON. Point CSS selectors at the fields you need — Microlink fetches the page, runs a browser when the content is client-rendered, and returns typed data.

Overview

Declare the shape. Get the data.

Web scraping on Microlink is built around a target url and a data schema. Each key in that schema becomes a field in the response; each rule tells Microlink how to pull that field from the page — a CSS selector, an attribute, a type, or a list. The API returns clean JSON: absolute URLs, typed images with size and dimensions, validated emails, or Markdown of the content you scoped.
  • CSS selectors and attr rules define every field you want back
  • Headless Chrome runs when the page needs JavaScript to render
  • Types like url, image, and email normalize and validate server-side
  • Same call can take proxy, headers and ttl when the target is hard or repeated (Pro)
Parameters

What an extraction call accepts.

Examples
Shape any JSON with CSS-selector rules and typed fields.
Custom extract
import createClient from 'microlink.io'

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

const { image } = await microlink.extract(url, {
  image: {
    selector: 'meta[property="og:image"]',
    attr: 'content',
    type: 'image'
  }
})