Render Chem Reaction

POST/visual/v1/render-chem-reaction

What it does

Takes a reaction — either as a reaction SMILES string or structured reactants/products/reagents — and renders a clean 2D reaction scheme diagram (reactants → products with an arrow). The default response includes the image as base64 data in a JSON wrapper, so you can embed it directly as a data URL. Set responseFormat: "file" when you want raw SVG or PNG output instead.

Why use it?

  • Full reaction schemes. Unlike render-chem (single molecule), this renders complete reaction pathways with reactants, reagents, and products in one diagram.
  • Two input modes. Use a reaction SMILES string for quick rendering, or structured input for precise control over each component.
  • Same quality & options. Shares presets, themes, and rendering options with render-chem — publication-ready output out of the box.

Examples

Structured input (recommended)

curl -X POST https://api.creatornode.io/visual/v1/render-chem-reaction \ -H "Content-Type: application/json" \ -H "X-API-Key: YOUR_KEY" \ -d '{ "reaction": { "reactants": ["CCO", "O"], "reagents": ["[Na+].[OH-]"], "products": ["CC[O-].[Na+]"] }, "format": "svg", "theme": "light", "options": { "width": 900, "height": 450 } }'

Response contains data as base64-encoded SVG with all molecules and a reaction arrow.

Reaction SMILES (convenience)

curl -X POST https://api.creatornode.io/visual/v1/render-chem-reaction \ -H "Content-Type: application/json" \ -H "X-API-Key: YOUR_KEY" \ -d '{ "reactionSmiles": "CCO.O>[Na+].[OH-]>CC[O-].[Na+]", "format": "png", "responseFormat": "file", "preset": "social-card" }'

Reaction SMILES format: reactants>reagents>products, where each side is a .-separated list of molecule SMILES.

Tips & tricks

Use structured input when you need precise control over item count and per-molecule validation. Use reaction SMILES for quick, single-string convenience.

For SVG, build a data URL like: data:image/svg+xml;base64,<data>. For PNG, use: data:image/png;base64,<data>.

💡 Tip: For the full request/response schema (including the demo endpoint), use the OpenAPI reference at /api/visual/docs/render-chem-reaction.

Default JSON mode is the better choice when you need item counts and render metadata. File mode is better when the rendered scheme is the final deliverable.

Cost & Limits

FeatureDetail
Base cost5 credits per request (up to 3 items)
Extra items+1 credit per additional item beyond 3
Output formatsSVG, PNG (JSON wrapper by default; raw file mode optional)
Themeslight, dark
Presetsdefault, publication, presentation, thumbnail, social-card

Tier Limits

LimitFreePremium
Max SMILES length per item200 chars4 000 chars
Max items per request630
Max dimensions800×8002048×2048
Dark themeNoYes
Transparent background (SVG)NoYes
Custom element colorsNoYes

Other Endpoints