How to convert any URL or PDF into AI ready Markdown

Simple to use API for converting any html url content into markdown.

How to convert any URL or PDF into AI ready Markdown
Photo by Douglas Lopes / Unsplash

Working with AI often means feeding it the right data in the right format. But most web pages and PDFs are messy. They come with headers, footers, menus, ads, and other distractions that add noise instead of value.

That’s where Lemino AI's URL to Markdown API comes in. It can turn any Webpage or PDF into clean, structured Markdown, perfect for use in AI pipelines, RAG systems, note-taking apps, or knowledge bases.

Key Features

  • Flexible content extraction – pulls out the main body text, images, and key content.
  • Noise filtering – reliably removes headers, footers, sidebars, menus, and ads.
  • JavaScript support – works on modern, dynamic websites.
  • PDF to Markdown – preserves formatting, tables, images, and structure.
  • AI-ready output – gives you clean, structured Markdown with minimal fuss.

Quick Start: Try in Your Browser

Simply prepend this to any URL:

https://platform.lemino.ai/api/url2md/

Example: Click here or run in your terminal to convert example.com:

curl "https://platform.lemino.ai/api/url2md/https://www.example.com"

Yes it's that easy!


Example API Usage

With just a few lines of code, you can fetch Markdown from any webpage or PDF:

cURL

URL="https://www.example.com"
curl -X GET https://platform.lemino.ai/api/url2md/$URL \
  -H "x-api-key: YOUR_API_KEY" \
  -H "x-extract-images: no" \
  -H "accept: text/plain"

JavaScript (Fetch)

const url = 'https://www.example.com';
const apiUrl = 'https://platform.lemino.ai/api/url2md/' + url;

const response = await fetch(apiUrl, {
  method: 'GET',
  headers: {
    'x-api-key': 'YOUR_API_KEY',
    'x-extract-images': 'no',
    'accept': 'text/plain'
  }
});

const markdown = await response.text();
console.log(markdown);

Python (requests)

import requests

url = 'https://www.example.com'
api_url = 'https://platform.lemino.ai/api/url2md/' + url
headers = {
  'x-api-key': 'YOUR_API_KEY',
  'x-extract-images': 'no',
  'accept': 'text/plain'
}

response = requests.get(api_url, headers=headers)
markdown = response.text
print(markdown)

More examples available here for PHP, Go, Ruby, Java, Kotlin, Swift, C++, and C#.

Chunked Output

Note that if you use json output, large content will automatically be chunked into pieces intelligently. For json output instead of plain text, just use the following header.

'accept': 'application/json'

Why This Matters

If you’re building AI applications—whether it’s a RAG system, chatbot, document pipeline, or knowledge base - having clean, structured, noise-free data is crucial. Lemino's URL to Markdown API ensures your AI consumes only what matters, the real content.


Get Started

Test it out now in Lemino Platform