# md.fastdb.in HTML-to-Image Renderer

> md.fastdb.in HTML-to-Image Renderer is a paid API for AI agents from md.fastdb.in, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-15).

Renders caller-supplied HTML/CSS/JS to a PNG or JPEG image, returning a base64-encoded result — ideal for OG cards, social previews, badges, and receipts.

## Facts

- Endpoint: POST https://md.fastdb.in/shot/render
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/md-fastdb-in-html-to-image-renderer-fa11cb75
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_6Rbnf1qZHiV7mMcQXwUvb

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability md-fastdb-in-html-to-image-renderer-fa11cb75 -d '<json body>'
```

Example prompt: Render this HTML as a 1200x630 PNG for an OG social card: '<div style="background:#1a1a2e;color:#eee;font-size:48px;display:flex;align-items:center;justify-content:center;height:100%">Hello World</div>' — transparent background is fine if needed.

## When to prefer this

Choose this endpoint when you need to programmatically generate pixel-perfect images from HTML/CSS templates — especially for OG tags, social sharing cards, email headers, badges, or receipts — and want exact control over layout via web standards rather than a design API or image generation model. It supports JS execution and transparent backgrounds, making it more flexible than static screenshot tools.

## Known failure modes

- Invalid or malformed HTML returns an error response with ok: false
- Unsupported image format requested returns an error
- Canvas dimensions that are too large may time out or be rejected
- JavaScript errors in the supplied code may cause incomplete renders
- Network or server overload may result in timeout

## How this service works

Render caller-supplied HTML/CSS (JS allowed) to a PNG/JPEG image — OG/social cards, link previews, badges, receipts, any picture you can express as HTML. Transparent backgrounds supported. Default canvas 1200x630 (OG size). $0.005 per call via x402.

## Output

A JSON object containing: ok (boolean), b64 (base64-encoded image string), bytes (image file size), width and height (pixels), sha256 (content hash), tookMs (render duration), and contentType (e.g. image/png).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "required": [
      "html"
     ],
     "properties": {
      "html": {
       "type": "string",
       "description": "HTML document or fragment to render (max 2 MB)"
      },
      "scale": {
       "enum": [
        1,
        2
       ],
       "type": "number",
       "description": "Device scale factor (2 = retina), default 1"
      },
      "width": {
       "type": "integer",
       "maximum": 1920,
       "minimum": 16,
       "description": "Canvas width, default 1200"
      },
      "format": {
       "enum": [
        "png",
        "jpeg"
       ],
       "type": "string",
       "description": "Image format, default png"
      },
      "height": {
       "type": "integer",
       "maximum": 1920,
       "minimum": 16,
       "description": "Canvas height, default 630"
      },
      "waitMs": {
       "type": "integer",
       "maximum": 10000,
       "minimum": 0,
       "description": "Extra settle time after load, ms"
      },
      "quality": {
       "type": "integer",
       "maximum": 100,
       "minimum": 1,
       "description": "JPEG quality, default 80 (jpeg only)"
      },
      "fullPage": {
       "type": "boolean",
       "description": "Capture full content height instead of the fixed canvas"
      },
      "response": {
       "enum": [
        "json",
        "binary"
       ],
       "type": "string",
       "description": "json (default) wraps base64; binary returns raw image bytes"
      },
      "selector": {
       "type": "string",
       "description": "CSS selector — capture just this element"
      },
      "transparent": {
       "type": "boolean",
       "description": "Omit default white background (png only)"
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "b64": "<base64-encoded image>",
  "bytes": 48213,
  "width": 1280,
  "height": 800,
  "sha256": "9f7d…",
  "tookMs": 1450,
  "contentType": "image/png"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/md-fastdb-in-html-to-image-renderer-fa11cb75/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from md.fastdb.in](https://www.zero.xyz/host/md.fastdb.in/llms.txt)
