URL to Markdown API – 2markdown.com

URL to Markdown API

Leverage our simple yet powerful API to convert any webpage (URL) into clean, structured Markdown. Perfect for automated workflows, documentation pipelines, research, and more.

Overview

The URL to Markdown API allows you to convert any webpage into well-formatted Markdown with a single API call. This is ideal for content migrations, archiving, knowledge base creation, and more.

Use Cases:

  • Batch converting websites to Markdown for static site generators
  • Automating blog-to-Markdown workflows
  • Research, data collection, and scraping tasks
  • Documentation systems & knowledge bases
  • Content aggregation and archiving

API Usage

Endpoint

POST https://api.2markdown.com/v1/url2md

Headers

Header Value Description
X-Api-Key YOUR_API_KEY Your API key for authentication
Content-Type application/json Specifies the format of the request body

Request Body

{
  "url": "https://example.com/page-to-convert"
}

Response

{
  "article": "# Example Page Title\n\nThis is the content of the page converted to Markdown..."
}

Example

curl -X POST "https://api.2markdown.com/v1/url2md" \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -d '{"url": "https://example.com/page-to-convert"}'

Note:

Complex pages may take 30-90 seconds to process. The request remains open until completion or timeout.

Quickstart in Your Favorite Language

Python

import requests

url = "https://api.2markdown.com/v1/url2md"
payload = {
    "url": "https://example.com"
}
headers = {
    "X-Api-Key": "YOUR_API_KEY",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)
print(response.json())

Node.js

const axios = require('axios');

async function convertUrlToMarkdown() {
  try {
    const response = await axios.post(
      'https://api.2markdown.com/v1/url2md',
      { url: 'https://example.com' },
      {
        headers: {
          'X-Api-Key': 'YOUR_API_KEY',
          'Content-Type': 'application/json'
        }
      }
    );
    console.log(response.data);
  } catch (error) {
    console.error(error);
  }
}

convertUrlToMarkdown();

Error Codes

Status Code Description
400 Bad Request - Missing or invalid parameters
401 Unauthorized - Invalid or missing API key
402 Payment Required - Insufficient credits
504 Gateway Timeout - Processing took too long

Rate Limits & Plans

Choose a plan that fits your usage. Contact us if you need a custom solution.

  • Free Tier: 250 conversions
  • Pro Tier: 10,000+ conversions/month
  • Enterprise: Custom solutions for high-volume usage

Frequently Asked Questions

What makes this different from a simple HTML to MD tool?

Our API not only handles raw HTML, but automatically scrapes and extracts the main content from the provided URL. This results in cleaner, more readable Markdown output, saving you time in post-processing.

Does it support JavaScript-heavy pages?

Yes, but heavily dynamic sites may require additional wait time. If the content is loaded only via client-side JavaScript, consider using our advanced scraping options or contacting support for custom solutions.

Is this API free to use?

We offer a free tier with limited conversions, along with paid plans for higher volume usage. Check out the Rate Limits & Plans section for more info.

Ready to Get Started?

Sign up for an API key and begin converting URLs to Markdown in seconds.

Get Your API Key