Have you ever needed to grab the actual content from a web page — without all the ads, nav bars, and JavaScript junk?
Whether you're building an AI training pipeline, a reading app, or a data scraper, extracting clean text from arbitrary URLs is a universal pain point.
Here's the fastest way I've found.
The Problem
Most websites are 70% boilerplate. Headers, footers, sidebars, cookie banners, popups. If you just use requests.get() and parse the HTML, you get garbage:
import requests
from bs4 import BeautifulSoup
resp = requests.get("https://example.com/article")
soup = BeautifulSoup(resp.text, "html.parser")
print(soup.get_text())
# Output: navigation menu sidebar footer ads copyright...
The Solution: One API Call
Instead of fighting with HTML parsing, use a dedicated content extraction API:
import requests
resp = requests.post("https://web2md-api-production-d822.up.railway.app/extract", json={
"url": "https://www.python.org/doc/",
"format": "markdown"
})
data = resp.json()
print(data["content"][:500])
That's it. Three lines. The API handles:
- Fetching the page
- Stripping all boilerplate (nav, ads, scripts)
- Extracting the main article content
- Converting to clean Markdown
What You Get Back
The API returns structured JSON:
{
"success": true,
"title": "Documentation — Python.org",
"content": "# Markdown content here...",
"description": "The official home of the Python Programming Language",
"word_count": 1234,
"response_time_ms": 850
}
Format Options
- markdown (default) — perfect for LLM training data, note-taking, publishing
- json — structured paragraphs, headings, and metadata
- text — plain text when you just need the words
Pricing
It's cheap. Free tier handles 50 requests/day — enough for most side projects.
- Free: 50 requests/day
- Basic: 5,000/month — $4.99
- Pro: 50,000/month — $19.99
Real Use Cases
- AI Training Data — Feed clean web content into your LLM fine-tuning pipeline
- Research — Download articles for offline reading and analysis
- Content Monitoring — Track changes on competitor pages
- Reading Apps — Convert any article to a clean reading view
Why Not Just Use BeautifulSoup?
You can, but:
- Every site has different HTML structure
- JavaScript-rendered content won't appear
- You'll spend hours writing selectors for each site
- Maintenance nightmare when sites redesign
A dedicated extraction API handles all of this with one endpoint. No selectors, no maintenance, no hassle.
This article was written with the help of AI. The API mentioned is a personal project — I built it because I needed it myself.
Top comments (0)