Skip to main content
POST
/
v1
/
markdownify
cURL
curl -X POST 'https://api.scrapegraphai.com/v1/markdownify' \
  -H 'SGAI-APIKEY: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "website_url": "https://scrapegraphai.com/"
  }'
{
  "request_id": "<string>",
  "status": "queued",
  "website_url": "<string>",
  "result": "<string>",
  "error": ""
}
Markdownify converts webpage content into clean, well-formatted Markdown. This is useful for content migration, documentation creation, or making web content more readable and portable.

Features

  • Preserves content structure
  • Handles complex layouts
  • Maintains headings hierarchy
  • Converts tables
  • Preserves links and images
  • Cleans up unnecessary formatting

Request Body

website_url
string
required
The URL of the webpage you want to convert to markdown.
headers
object
Optional headers to customize the request behavior. This can include user agent, cookies, or other HTTP headers.
stealth
boolean
Optional parameter to enable stealth mode. When set to true, the scraper will use advanced anti-detection techniques to bypass bot protection and access protected websites. Adds +4 credits to the request cost.Default: false

Example Response

{
  "request_id": "65401e0d-8cd6-4d6a-88f6-e21255d1c06a",
  "status": "completed",
  "website_url": "https://scrapegraphai.com/",
  "result": "## Transform Websites into\nStructured Data\n\n### Just One Prompt Away\n\nTransform any website into clean, organized data for AI agents and Data Analytics.\nEnhance your apps with our AI-powered API.\n\n### Save time\n\nNo more writing complex code or dealing with manual extraction.\n\n### Save money\n\nWhy hire expensive developers or pay for costly scraping services? Our API gives you high-quality data extraction at a fraction of the cost.\n\n### AI powered\n\nWe employ state-of-the-art AI technologies to streamline the data extraction process...",
  "error": ""
}
The response includes the complete webpage content converted to Markdown format. The example above shows a truncated version of the response.

Authorizations

SGAI-APIKEY
string
header
required

Body

application/json
website_url
string
required
Example:

"https://scrapegraphai.com/"

headers
object

Optional headers to send with the request, including cookies and user agent

Example:
{
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
"Cookie": "cookie1=value1; cookie2=value2"
}
stealth
boolean
default:false

Enable stealth mode to bypass bot protection using advanced anti-detection techniques. Adds +4 credits to the request cost

Response

Successful Response

request_id
string
required
status
enum<string>
required
Available options:
queued,
processing,
completed,
failed
website_url
string
required
result
string | null
error
string
default:""