SVG Optimize API - Strip Editor Metadata and Whitespace
Removes XML declarations, doctypes, comments, <title>/<desc>/<metadata> blocks, empty <g>/<defs>, Inkscape and Sodipodi editor attributes and namespaces, unused xmlns:xlink, autogenerated IDs (layer1, g1234), and collapses whitespace. Accepts SVGs up to 500 KB and returns optimized output with byte counts and savings percent.
Code examples
curl -X POST https://api.botoi.com/v1/svg/optimize \
-H "Content-Type: application/json" \
-d '{"svg":"<?xml version=\"1.0\"?>\n<!-- Generated by Inkscape -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\" viewBox=\"0 0 24 24\">\n <title>Circle</title>\n <g id=\"layer1\">\n <circle cx=\"12\" cy=\"12\" r=\"10\"/>\n </g>\n</svg>"}'When to use this API
Strip designer tool metadata before shipping icons
Icons exported from Figma, Illustrator, or Inkscape carry editor metadata (layer names, app namespaces). Optimize before bundling into your icon pack to cut payload weight.
Sanitize user-uploaded SVGs
Users pasting icons from the web often bring editor cruft. Optimize server-side before storage; saves DB space and removes fingerprinting via editor signatures.
Build-step SVG compression
Add as a pre-commit or CI step that optimizes every SVG in your static directory. Keeps the repo lean and page loads fast.
Frequently asked questions
Is this equivalent to SVGO?
Does it touch path data?
What about CSS inside <style>?
Are <title> and <desc> always removed?
What's the size limit?
Get your API key
Free tier includes 5 requests per minute with no credit card required. Upgrade for higher limits.