markdown is the default format for POST /v1/scrape. Omit format or send "format": "markdown" to receive clean article text in data.markdown alongside every page link in data.links.
Example
curl -sS https://api.crawlapi.dev/v1/scrape \
-H "Authorization: Bearer $CRAWLAPI_API_KEY" \
-H 'content-type: application/json' \
--data '{"url": "https://en.wikipedia.org/wiki/Web_scraping"}'const response = await fetch('https://api.crawlapi.dev/v1/scrape', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.CRAWLAPI_API_KEY}`,
'content-type': 'application/json',
},
body: JSON.stringify({ url: 'https://en.wikipedia.org/wiki/Web_scraping', format: 'markdown' }),
});
const body = await response.json();
if (!body.success) throw new Error(`${body.error.code}: ${body.error.message}`);
console.log(body.data.markdown);import os
import requests
response = requests.post(
"https://api.crawlapi.dev/v1/scrape",
headers={"Authorization": f"Bearer {os.environ['CRAWLAPI_API_KEY']}"},
json={"url": "https://en.wikipedia.org/wiki/Web_scraping", "format": "markdown"},
timeout=65,
)
body = response.json()
if not body["success"]:
raise RuntimeError(f"{body['error']['code']}: {body['error']['message']}")
print(body["data"]["markdown"])The response returns clean page text in data.markdown and every unique page link in data.links.
What is kept and removed
| Element | Output in data.markdown |
|---|---|
| Headings | # through ######, with the page title promoted when missing |
| Paragraphs, blockquotes, lists | Clean markdown preserving ordered and unordered lists |
| Data tables | Markdown tables (layout tables flatten to plain text) |
| Code blocks | Fenced code blocks preserving declared language tags |
| Images | Dropped (no image URLs or base64 data) |
| Page chrome | Navigation bars, footers, cookie banners, dialogs, form controls, and repeated UI chrome removed |
Link rules
Inline links in data.markdown are normalized to keep token counts low:
- Absolute
http(s)URLs: Relative links resolve against the page’s base URL. Non-web schemes (mailto:,javascript:) stay as plain text. - Tracking removed: Parameters such as
utm_*,fbclid, andgclidare stripped from links and frommetadata.final_url. - Linked once: Each unique URL links on its first appearance; repeated mentions render as plain text.
- Noisy controls flattened: Same-page fragment anchors and listing filter/sort controls render as plain text while pagination links stay linked.
- Full page
data.links[]: Separate from inline links,data.linksreturns every unique absolutehttp(s)<a href>on the entire page (including navigation) in document order, with fragments and tracking stripped. RSS and Atom feeds populatedata.linkswith entry URLs; other documents return[].
Special sources
- X and YouTube: Dedicated markdown layouts with metrics, threads, descriptions, chapters, and transcripts. See X and YouTube.
- Documents: PDFs, Office files, CSVs, JSON, feeds, and plain text convert to markdown through the same endpoint. See PDFs and documents.
Response metadata
Every response includes data.metadata alongside data.markdown so you can index, deduplicate, and filter results before storing them:
| Field | Meaning |
|---|---|
title / description |
Page title and meta description |
language |
Detected BCP-47 language tag (or null when unavailable) |
status |
Final HTTP status code returned by the target site |
final_url |
Canonical URL after redirects, with tracking parameters removed |
truncated |
Present and true only when data.markdown was trimmed at 2 MiB |
login_required |
Present and true only when the target served a readable sign-in wall |
Output size
data.markdown is capped at 2 MiB UTF-8. When a very large page exceeds that cap, the text is trimmed cleanly and metadata.truncated is set to true.