Leverage our simple yet powerful API to convert any webpage (URL) into clean, structured Markdown. Perfect for automated workflows, documentation pipelines, research, and more.
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:
POST https://api.2markdown.com/v1/url2md
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 |
{
"url": "https://example.com/page-to-convert"
}
{
"article": "# Example Page Title\n\nThis is the content of the page converted to Markdown..."
}
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.
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())
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();
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 |
Choose a plan that fits your usage. Contact us if you need a custom solution.
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.
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.
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.
Sign up for an API key and begin converting URLs to Markdown in seconds.
Get Your API Key