Convert SVG documents to PNG images via pay-per-call x402 endpoint on Base or Solana.
What it does
The api2ls.com svg2png endpoint accepts an SVG document (either as a raw body or base64-encoded in JSON) and returns a rasterized PNG image. It supports configurable output dimensions via query parameters including width (max 2048px, default 1024), height (max 2048px), and scale/zoom factor (max 2x). The maximum input SVG size is 256KB.
This is an x402-protocol endpoint priced at $0.10 per call, settling on-chain on Base or Solana. No API keys, accounts, or subscriptions are required — payment is handled per-request via the x402 payment challenge. The endpoint is discoverable through the x402 Bazaar registry.
The service is part of api2ls.com, a collection of utility APIs designed for autonomous AI agents and agentic workflows. Other endpoints on the same host include webpage readability extraction and JSON-to-Excel conversion. Note that during probing the endpoint returned HTTP 400 (not the expected 402 challenge), which may indicate it requires a valid request body before issuing a payment challenge, or there may be a routing issue. The endpoint's liveness could not be fully confirmed via the standard x402 probe.
Capabilities
Use cases
- —AI agents converting generated SVG charts or diagrams to PNG for embedding in reports
- —Automated pipelines rasterizing SVG icons or logos at specific dimensions
- —Agentic workflows producing PNG screenshots of SVG-based visualizations
- —Converting SVG outputs from data visualization libraries to shareable PNG images
Fit
Best for
- —AI agents needing on-demand SVG-to-PNG conversion without API key management
- —Agentic workflows that generate SVG and need raster output for downstream consumers
- —Developers wanting simple pay-per-call image conversion without subscriptions
Not for
- —High-volume batch image conversion where per-call pricing becomes expensive
- —Converting raster-to-raster or non-SVG formats
- —Users who need free or subscription-based pricing models
Quick start
curl -X POST "https://api2ls.com/api/svg2png?width=1024" \
-H "Content-Type: application/json" \
-H "X-Payment: <x402-payment-token>" \
-d '{"svgBase64": "PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIj48Y2lyY2xlIGN4PSI1MCIgY3k9IjUwIiByPSI0MCIgZmlsbD0icmVkIi8+PC9zdmc+"}' \
--output output.pngExample
Request
{
"svgBase64": "PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIj48Y2lyY2xlIGN4PSI1MCIgY3k9IjUwIiByPSI0MCIgZmlsbD0icmVkIi8+PC9zdmc+"
}Endpoint
Quality
The endpoint documentation on the landing page is reasonably detailed with parameters, input formats, and examples. However, the x402 probe did not return a 402 challenge (got 400 on POST, 404 on GET), so liveness could not be confirmed. No OpenAPI schema is available, and /docs returns 404. Pricing is stated on the landing page but not confirmed via a captured 402 challenge.
Warnings
- —Endpoint returned HTTP 400 on POST probe instead of expected 402 payment challenge — liveness not confirmed
- —No OpenAPI or formal schema available; documentation is only on the landing page
- —The /docs, /pricing, and /api paths all return 'Cannot GET' errors
- —Price of $0.10/call is stated on the homepage but not verified via a captured x402 challenge
Citations
- —SVG to PNG conversion endpoint accepts raw SVG body or base64-encoded JSON with configurable width, height, and scale parametershttps://api2ls.com
- —Pay $0.10 per call on-chain via the x402 protocol on Base or Solanahttps://api2ls.com
- —Max SVG input size is 256KB; max output dimensions 2048px; max scale factor 2https://api2ls.com
- —Discoverable via the x402 Bazaarhttps://api2ls.com