Documents · V0.1.0 · 3 ENDPOINTS
Diagram, Math & Code Render API

Ideas in text. Clarity in pixels.

Render Mermaid, Graphviz, D2, Vega-Lite, LaTeX and source code as shareable images and PDFs.

Production access through RapidAPI & ApyHub.
Compare available capabilities & plans

From input to outputSample preview
INPUTdiagram.mmd
flowchart TD
  A[Your idea] --> B[An API call]
  B --> C[Finished diagram]
OUTPUTdiagram.svg
MERMAID → SVG
Your ideaAn API callFinished diagram
Architecture diagrams 1 / 3

Illustrative Mermaid render. Also supports Graphviz, D2 and Vega-Lite.

Try this in the Playground

Try it in the Playground.

Pick an example to open it in the Playground. Change anything and run it yourself.

Open full Playground

Your first request

import os
import httpx

base_url = "https://diagram-math-code-render-api.p.rapidapi.com"
headers = {
    "X-RapidAPI-Key": os.environ["RAPIDAPI_KEY"],
    "X-RapidAPI-Host": "diagram-math-code-render-api.p.rapidapi.com",
}
payload = {
    "engine": "mermaid",
    "source": "flowchart LR\n  A[Your idea] --> B[An API call]\n  B --> C[A finished diagram]",
    "format": "png",
    "width": 900,
    "scale": 1,
    "theme": "neutral",
}
response = httpx.post(
    base_url + "/v1/render/diagram",
    headers=headers, json=payload, timeout=120
)
response.raise_for_status()
with open("result.png", "wb") as output:
    output.write(response.content)
5 MIN
Render a Mermaid diagram with an APIComplete task tutorial

Access & plans

Subscribe through a marketplace. They issue credentials, enforce plan allowances and handle billing. Check each capability’s listing for current plans and units.

CapabilityRapidAPIApyHub
Diagrams, equations & code Live Live

Good to know

The demo supports diagrams, math and code with source up to 8 KiB and bounded output formats. Remote assets and external data are unavailable in demos. Syntax errors identify the input to correct.

Website demos use small inputs and an anonymous allowance. Production limits depend on your marketplace plan.

Demo limits & data handling

FAQ

Which marketplace should I pick?

Choose an available listing for the capability you need. Compare its current plans, allowance and billing units. Examples on this site support both providers.

How does the demo allowance work?

When enabled, demos share 10 light and 2 heavy dispatched attempts per UTC day, with browser and network limits. This is an anonymous allowance, not a guaranteed per-person entitlement.

What if a live demo is paused?

Use the supplied sample preview and integration examples. Available marketplace listings provide production access independently of the website’s demo gate.

Can I use my own files?

Use the editable input fields to preview your request. Review processing and retention details before submitting sensitive data.