# SVGProof API

Source: https://svgproof.com/docs/api · OpenAPI: https://api.svgproof.com/v1/openapi.json

> POST an image to https://api.svgproof.com/v1/vectorize with `Authorization: Bearer <key>`; the response body is the SVG. Batches of up to 100 images: POST /v1/batch (zip back). Inputs up to 5 MB, 17 megapixels / 8192 px a side. One credit per converted image; refused images (photos, broken files) are refunded automatically.

## Example

```sh
curl https://api.svgproof.com/v1/vectorize \
  -H "Authorization: Bearer $SVGPROOF_KEY" \
  -F image=@logo.png \
  -o logo.svg
```

Traces the image and returns the result as a file (SVG by default). Logos, icons, wordmarks and flat illustrations work best; photos are rejected with `photo_like`.

Send `Accept: application/json` to get the SVG inside a JSON body together with stats, the palette and the background.

## Query parameters
| Name | Type | Description |
| --- | --- | --- |
| `format` | svg, png | Output format. |
| `background` | string | `auto`: a baked-in checkerboard (fake transparency) is removed, a solid background is kept. `keep`: everything as in the image. `remove`: transparent background; shapes of the same color on top of it (letter counters) stay. A hex color (`ffffff`, or `%23ffffff`): a solid background in that color, replacing the traced one or added under transparent art. |
| `max_colors` | integer | Merge the palette down to at most this many flat colors. Omit for the automatic palette. |
| `palette` | string | Brand colors, comma-separated hex. Every color of the result is replaced by the nearest one of these (gradients become flat). At most 256. |
| `scale` | number | PNG only: output size relative to the uploaded image. The longest side is capped at 4096 px. |
| `width` | integer | PNG only: output width in pixels (overrides `scale`; the height follows the aspect ratio). |
| `knockout` | boolean | With a `background` edit, shapes inside the art in the background's color (letter counters) go too. `false` keeps them. |
| `mode` | live, test | `test`: free, for integrating: 10 previews per account (unlimited with a subscription), a PNG preview only (`format=png`, up to 512 px on the long side, 512 px when no size is given). Anything else answers `403 test_mode_limit`. Test keys are always `test`. |
