API Documentation
High-performance rendering API for developers. Convert any URL into PDFs, Screenshots, or AI-Ready Markdown.
💾 Handling File Responses
To ensure reliability across networks, the API returns files as Base64 encoded strings inside a JSON object. This prevents binary encoding issues.
# Use 'jq' to extract the base64 string and pipe it to 'base64 -d' curl -X POST https://api.mecke.dev/v1/pdf \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"url": "https://mecke.dev/"}' \ | jq -r '.pdf' | base64 -d > output.pdf
Authentication
Include your API key in the header of every request.
/v1/pdf
Parameters
| Field | Type | Description |
|---|---|---|
| url | string | Target URL to render. Use either url OR html. |
| html | string | Raw HTML content. Use either url OR html. |
| blockAssets | bool | Block images/fonts for speed. Default: false. |
| language | string | Set Accept-Language header (e.g., de-DE). Default: en-US. |
| userAgent | string | Custom User-Agent header. Default: Chrome 120 on Windows. |
| darkMode | bool | Emulate prefers-color-scheme: dark. Default: false. |
| waitForSelector | string | Wait until CSS selector is visible before rendering (e.g., #chart). Timeout: 5s. |
| accept_cookies | bool | Auto-accept cookie banners. Default: false. |
| options | object |
PDF settings. Supported fields:
|
Example with Header (No Footer)
curl -X POST https://api.mecke.dev/v1/pdf \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://mecke.dev/", "waitForSelector": "h1", "options": { "format": "A4", "displayHeaderFooter": true, "margin": { "top": "2cm", "bottom": "0", "left": "1cm", "right": "1cm" }, "headerTemplate": "<div style=\"font-size:10px; text-align:center; width:100%; margin-top: 10px;\">Page <span class=\"pageNumber\"></span></div>", "footerTemplate": "<div></div>" } }' | jq -r '.pdf' | base64 -d > output.pdf
/v1/screenshot
Parameters
| Field | Type | Description |
|---|---|---|
| fullPage | bool | Capture entire scrollable page height. |
| selector | string | Crop screenshot to specific element (e.g. .chart). |
| darkMode | bool | Emulate prefers-color-scheme: dark. |
| viewport | object | { "width": 1920, "height": 1080 } |
| waitForSelector | string | Wait for element before capturing. |
| type | string | "jpeg" or "png". |
Example: Contribution Graph (Dark Mode)
curl -X POST https://api.mecke.dev/v1/screenshot \
-H "x-api-key: sk_9105c9e7ae4f46a2b1d7ef515b8d8543" \
-H "Content-Type: application/json" \
-d '{
"url": "https://mecke.dev/",
"selector": ".api-example",
"waitForSelector": ".feature-card",
"darkMode": false,
"type": "png"
}' \
| jq -r '.image' | base64 -d > mecke-features.png
/v1/screenshot/clean
This endpoint behaves like /v1/screenshot, but removes cookie banners, overlays and other visual clutter before capturing.
Example: Clean Page Capture
curl -X POST https://api.mecke.dev/v1/screenshot/clean \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://mecke.dev/", "fullPage": true, "darkMode": false, "type": "png" }' \ | jq -r '.image' | base64 -d > clean-capture.png
/v1/screenshot/wait
This endpoint waits exactly 5 seconds before taking the screenshot. Useful for pages with heavy dynamic content or animations.
Example: Delayed Capture
curl -X POST https://api.mecke.dev/v1/screenshot/wait \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://mecke.dev/", "fullPage": true, "darkMode": true, "type": "jpeg" }' \ | jq -r '.image' | base64 -d > delayed-capture.jpg
/v1/scrape
Returns clean Markdown content.
Ideal for feeding context to ChatGPT, Claude, or RAG systems.
Example Request
curl -X POST https://api.mecke.dev/v1/scrape \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://mecke.dev/" }' \ | jq -r .data.markdown > output.md
/v1/markdown
Extracts readable article content from any URL and returns pure Markdown.
Perfect for LLMs, embeddings and RAG pipelines.
Example Request
curl -X POST https://api.mecke.dev/v1/markdown \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://mecke.dev/" }' \ | jq -r .markdown > output.md
/v1/html-image
Render raw HTML directly into a PNG or JPEG — ideal for Open Graph images, thumbnails and social cards.
Example Request
curl -X POST https://api.mecke.dev/v1/html-image \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"html": "<html><body><h1>Mecke API</h1></body></html>",
"width": 1200,
"height": 630,
"type": "png"
}' \
| jq -r '.image' | base64 -d > social-card.png
/v1/info
Lightweight JSON status endpoint. Check service health and basic usage stats from your monitoring or CI.
Example Request
curl -X GET https://api.mecke.dev/v1/info | jq .