Markdown Code To Image avatar

Markdown Code To Image

Pricing

from $5.00 / 1,000 generated images

Go to Apify Store
Markdown Code To Image

Markdown Code To Image

Convert Markdown, code snippets, tables, quotes, and AI answers into polished downloadable PNG images. Batch rendering API for n8n, Make, Zapier, newsletters, docs, and social media.

Pricing

from $5.00 / 1,000 generated images

Rating

0.0

(0)

Developer

AI Coding Radar

AI Coding Radar

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

5 hours ago

Last modified

Share

Markdown & Code to Image API

Turn Markdown, code snippets, tables, quotes, and AI answers into polished PNG images through Apify. Use it from the Console, API, n8n, Make, Zapier, or a schedule. It is a rendering API, not a web scraper: no login, proxy, source website, or external API key is required.

Example Markdown and code rendered as a PNG

What it is for

  • Markdown to image automation for newsletters and social posts.
  • Code screenshot generation with syntax highlighting.
  • ChatGPT, Claude, or Gemini answer cards without browser copy/paste work.
  • Batch quote cards, changelog images, and documentation previews.

Each successful document creates one Dataset record and one PNG in the run's default key-value store. The Dataset record contains a direct imageUrl. Storage retention follows the caller's Apify plan and storage settings; copy a file elsewhere if it needs to be permanent.

Input

{
"documents": [
{
"title": "Ship the small thing",
"markdown": "# Markdown to image\n\nTurn **notes** and code into a PNG.\n\n```js\nconst result = await automate();\n```"
}
],
"theme": "paper",
"width": 1080,
"fontSize": 22,
"watermark": "Made with Cardify"
}

Available themes are paper, midnight, terminal, and clean. A run accepts 1-20 documents. Each Markdown value is capped at 12,000 characters and each rendered image at 16,000 pixels high so oversized input fails explicitly.

Automation API

Set APIFY_TOKEN in your secret manager, then call the synchronous Dataset endpoint from a shell, n8n HTTP Request node, or Make HTTP module:

curl -sS -X POST \
"https://api.apify.com/v2/acts/ai-coding-radar~markdown-code-to-image/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
-H 'content-type: application/json' \
-d '{"documents":[{"title":"Release note","markdown":"# Shipped\n\nThe useful change is live."}],"theme":"paper","width":1080,"fontSize":22,"watermark":""}'

The response is an array with one record per generated PNG. Download the signed imageUrl from each record before the run storage expires. Never put an Apify token in a workflow exported to a public repository. The generated API client's empty {} input is also safe: it renders exactly one bounded default card so a first call produces a visible result instead of failing validation.

Automation recipes

Copy the n8n batch Markdown-to-image API workflow or the Make batch recipe. Both send the same validated input body and return one dataset record per PNG. The examples cover a markdown to image API, a code screenshot API, and an OG image card without fetching remote assets.

The n8n workflow reads the caller's APIFY_TOKEN environment variable. The Make recipe keeps bearer authorization in a private Make connection or secret field. Neither example includes a token, cookie, private webhook URL, or a signed imageUrl; map each runtime imageUrl to the next automation step. See examples/README.md for setup, batching limits, and downstream file handling.

Security and limits

Raw HTML is disabled. Markdown images are replaced with alt text, and the rendering page blocks network requests. This prevents user content from turning the Actor into a request proxy or silently loading tracking pixels. The first version outputs PNG only and uses system fonts; it does not fetch remote fonts, images, Mermaid diagrams, or arbitrary HTML.

Local verification

npm install
npm test
npm run smoke

The smoke command writes /tmp/markdown-code-to-image-smoke.png using local Chrome. The Apify image uses the official Playwright Chrome base image.

Pricing

The launch price is $0.005 per generated image plus $0.00005 per Actor start. Platform usage is included. Test runs, free users, and generated image counts are not creator revenue; only a finalized payout that actually settles is treated as income.