Skip to content
NodalBeta

Nodal API

Developers

The same tracer that powers the Nodal app, over HTTP. Send an image, get a clean SVG back in one request. Calls use your account's credits or plan, at the prices on the pricing page.

Authentication

Create a key on your account page and send it in the Authorization header as Bearer ndl_…. The key is shown once, so store it somewhere safe, such as an environment variable. Keep it on your server: anyone with the key can spend your credits. You can revoke a key at any time.

Pages on this site can also call the API with the signed-in visitor's session, without a key.

Vectorize an image

POST /api/public/vectorize

Send multipart/form-data. API calls are free and unlimited during the beta.

FieldWhat it is
imagefile, requiredPNG, JPEG or WEBP, up to 50 MB.
modestring, optionalsimple, detailed or auto (default). Simple suits logos and flat art; detailed suits shaded illustrations.

Examples

curl

curl https://nodalvector.com/api/public/vectorize \
  -H "Authorization: Bearer $NODAL_API_KEY" \
  -F "image=@logo.png" \
  -F "mode=auto" \
  | jq -r .svg > logo.svg

Node.js 18+

import { readFile, writeFile } from "node:fs/promises";

const form = new FormData();
form.append("image", new Blob([await readFile("logo.png")], { type: "image/png" }), "logo.png");
form.append("mode", "auto");

const res = await fetch("https://nodalvector.com/api/public/vectorize", {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.NODAL_API_KEY}` },
  body: form,
});
if (!res.ok) throw new Error((await res.json()).error);
const { svg } = await res.json();
await writeFile("logo.svg", svg);

Response

A JSON object.

{
  "svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" ...>…</svg>",
  "png": "iVBORw0KGgo…",
  "width": 1024,
  "height": 768,
  "aspect_ratio": "4:3",
  "stats": { "paths": 212, "colors": 14, "linearGradients": 3, "radialGradients": 1, "detail": "detailed" },
  "account": { "credits": 9, "plan": "none", … }
}
FieldWhat it is
svgThe vector, as an SVG document string.
pngThe source image as base64 PNG, rotated upright.
width, heightSize of the SVG in pixels, matching the source.
aspect_ratioThe image's shape as a simple ratio, e.g. 4:3.
statsCounts from the trace: paths, colors, linearGradients, radialGradients, and the detail level used.
accountCredits and plan left after this call.

Errors

Errors come back as JSON with an error message you can show to people.

StatusMeaning
400Missing image, wrong file type, file over 50 MB, or an unknown mode.
401Missing or invalid API key (or, from the browser, not signed in).
402Out of credits (code: no_credits). Buy a pack or plan, then retry.
5xxThe trace failed. The credit is returned automatically.

Limits