Skip to content

Node.js URL to Markdown API

Convert any URL to clean, LLM-ready markdown with one HTTP request in Node.js — no Puppeteer, no readability pipeline, no browser to maintain.

Convert a URL to markdown in Node.js

No package and no browser — the Microlink REST API turns any URL into clean markdown with a single HTTP GET. Here it is with the global fetch that ships with Node.js 18+.
Step 01 · Convert any URL
A few lines with global fetch — no npm package to add. Point it at a page and read the markdown string from the JSON response.
convert.mjs
const params = new URLSearchParams({
  url: 'https://example.com',
  'data.markdown.attr': 'markdown',
  meta: 'false' // skip metadata extraction for a faster response
})

const res = await fetch(`https://api.microlink.io?${params}`)
  .then(res => res.json())

console.log(res.data.markdown)
Step 02 · Scope the extraction
Pass a CSS selector to keep just the article body and drop headers, footers, and sidebars — fewer tokens, better embeddings.
scoped.mjs
const params = new URLSearchParams({
  url: 'https://example.com/blog/post',
  'data.markdown.attr': 'markdown',
  'data.markdown.selector': 'article', // keep just the article body
  meta: 'false'
})

const res = await fetch(`https://api.microlink.io?${params}`)
  .then(res => res.json())

console.log(res.data.markdown)
Step 03 · Render JavaScript pages
Client-side rendered content only exists after JavaScript runs — prerender with a real browser and wait for the content, still one request.
spa.mjs
const params = new URLSearchParams({
  url: 'https://app.example.com/docs',
  'data.markdown.attr': 'markdown',
  'data.markdown.selector': 'main',
  prerender: 'true',               // render JS in a real browser first
  waitForSelector: 'main h1',      // wait until the content exists
  meta: 'false'
})

const res = await fetch(`https://api.microlink.io?${params}`)
  .then(res => res.json())

console.log(res.data.markdown)
Step 04 · Get markdown back directly
Skip the JSON envelope entirely: embed=markdown returns the page as text/markdown, ready to pipe into a file or a prompt.
embed.mjs
import { writeFile } from 'node:fs/promises'

const params = new URLSearchParams({
  url: 'https://example.com',
  'data.markdown.attr': 'markdown',
  meta: 'false',
  embed: 'markdown' // respond with text/markdown instead of JSON
})

const markdown = await fetch(`https://api.microlink.io?${params}`)
  .then(res => res.text())

await writeFile('page.md', markdown)

Drop it into your framework

A route handler, an Express endpoint, or a LangChain loader — the same request becomes your own URL-to-markdown primitive for agents and RAG pipelines.
  • Next.js
  • Express
  • LangChain
  • Plain Node.js
import express from 'express'

const app = express()

// GET /markdown?url=https://example.com
app.get('/markdown', async (req, res) => {
  const params = new URLSearchParams({
    url: req.query.url,
    'data.markdown.attr': 'markdown',
    meta: 'false'
  })

  const { data } = await fetch(`https://api.microlink.io?${params}`)
    .then(res => res.json())

  res.type('text/markdown').send(data.markdown)
})

Skip the readability pipeline maintenance

Rolling your own means fetching HTML, running a readability extractor, converting with Turndown, and adding Playwright when a page needs JavaScript. The API gives you clean markdown from any page without any of the moving parts.

DIY extraction pipeline

  • Fetch HTML, then chain readability + Turndown yourself
  • Every site breaks your selectors in its own special way
  • JavaScript-rendered pages need Playwright — a 300 MB browser
  • Each browser eats hundreds of MB of RAM per worker
  • You build the queueing, retries, caching and autoscaling
  • Output quality drifts as sites change; you own the fixes

Microlink for Node.js

  • One HTTP request — global fetch, no npm package to add
  • Runs anywhere: Vercel, AWS Lambda, containers, your laptop
  • Real browser rendering built in with prerender=true
  • CSS selector scoping keeps tokens focused on the content
  • Cached responses from a global edge network
  • Autoscaled fleet with a 99.95% uptime SLA

Built for the way you write Node.js.

A REST API that feels native in Node.js — one fetch, JSON back, and at home in anything from a script to a serverless function. Read the URL to Markdown guide to go deeper.

  • No Browser to Install

    No Puppeteer or Playwright to install or keep patched. JavaScript rendering runs on Microlink’s side with prerender=true.
  • Zero Dependencies

    Node.js 18+ ships global fetch — the examples work with no npm install and nothing to vendor.
  • LLM-Ready Output

    Clean markdown instead of HTML noise — around 80% fewer tokens on average, so agents spend context on meaning, not markup.
  • CSS Selector Scoping

    Extract the whole page or narrow to article, main, or any selector — precise content targeting for better embeddings.
  • JavaScript Rendering

    SPAs and client-rendered docs are rendered in a real browser first, with waitForSelector to catch late content.
  • Documents Too

    Point it at a PDF or an office file — docx, xlsx, pptx — and the content is converted to markdown the same way.
  • Framework Friendly

    Drop it into Next.js, Express, or a LangChain loader as a route or a few-line function.
  • text/markdown Responses

    embed=markdown returns the page as text/markdown — pipe it straight into a file, a queue, or a prompt.
  • Generous Free Tier

    Start with 25 requests per day — no account, no credit card. Add an API key when you are ready to scale.
  • No Browser to Install

    No Puppeteer or Playwright to install or keep patched. JavaScript rendering runs on Microlink’s side with prerender=true.
  • Zero Dependencies

    Node.js 18+ ships global fetch — the examples work with no npm install and nothing to vendor.
  • LLM-Ready Output

    Clean markdown instead of HTML noise — around 80% fewer tokens on average, so agents spend context on meaning, not markup.
  • CSS Selector Scoping

    Extract the whole page or narrow to article, main, or any selector — precise content targeting for better embeddings.
  • JavaScript Rendering

    SPAs and client-rendered docs are rendered in a real browser first, with waitForSelector to catch late content.
  • Documents Too

    Point it at a PDF or an office file — docx, xlsx, pptx — and the content is converted to markdown the same way.
  • Framework Friendly

    Drop it into Next.js, Express, or a LangChain loader as a route or a few-line function.
  • text/markdown Responses

    embed=markdown returns the page as text/markdown — pipe it straight into a file, a queue, or a prompt.
  • Generous Free Tier

    Start with 25 requests per day — no account, no credit card. Add an API key when you are ready to scale.

Try it live in the playground

Paste a URL and see the exact markdown output before you write a line of Node.js.

Node.js URL to Markdown FAQ

Everything Node.js developers ask before integrating the Microlink URL to Markdown API.

Do I need Puppeteer or Playwright?

No. JavaScript rendering runs on Microlink’s managed browser fleet — pass prerender=true and the page is rendered before conversion. Your Node.js process stays browser-free.

Do I need to install a package?

No. The examples use the global fetch that ships with Node.js 18+. If you prefer the official SDK, microlink SDK wraps the same API with conveniences like microlink.markdown(url).

How do I convert only the article body?

Pass a CSS selector with data.markdown.selector=article and the extraction is scoped to that element — headers, footers, and sidebars are dropped before conversion, which keeps token counts down.
See the URL to Markdown guide for scoping strategies.

Does it work on serverless platforms?

Yes. Because there is no browser binary to ship, it works on Vercel, AWS Lambda, Cloudflare Workers, and containers alike — a plain HTTPS call with no cold-start penalty.

Is there a free tier or do I need an API key?

The free tier gives you 25 requests per day with no account, no credit card, and no API key. Just call the endpoint and start converting.
When you need more throughput or caching control, add an apiKey header and requests route to the Pro tier. See pricing for the limits.

Can I get the response as markdown instead of JSON?

Yes. Add embed=markdown and the API responds with text/markdown directly — handy for piping into files, queues, or prompts without parsing an envelope.

Start converting in Node.js

Get 25 requests/day with zero commitment — no account and no credit card. Send your first request and ship markdown in minutes.
No login needed
25 reqs/day free
No credit card