API 개요로 돌아가기

qr-code

POST1 크레딧

Encodes a payload into a QR code and returns it in the requested format. PNG and SVG are suitable for direct rendering; UTF-8 is useful for terminal UIs and quick previews.

엔드포인트

POST https://x114.org/api/v1/qr-code

요청 본문

POST 본문에 JSON으로 전송합니다.

NameTypeRequiredDescription
textstringrequiredThe payload to encode. Up to 4 KB of UTF-8 (less at higher error correction).
format"png" | "svg" | "utf8"optionalOutput format. "png" returns a base64 data URL; "svg" returns SVG markup; "utf8" returns block characters for terminals. Defaults to "png".
errorCorrectionLevel"L" | "M" | "Q" | "H"optionalQR error correction level. Defaults to "M".
widthnumberoptionalPixel size for PNG (64-2048) or logical width for SVG/UTF-8. Defaults to 256.

응답 본문

성공 시 반환되는 JSON (HTTP 200).

NameTypeRequiredDescription
okbooleanrequiredTrue on success.
formatstringrequiredThe format returned ("png" | "svg" | "utf8").
errorCorrectionLevelstringrequiredThe error correction level that was used.
widthnumberrequiredThe width that was used (after clamping to the allowed range).
mimeTypestringrequiredMIME type of the output: "image/png" for png, "image/svg+xml" for svg, "text/plain" for utf8.
outputstringrequiredThe encoded QR — base64 data URL when format is "png", SVG markup when "svg", block-character text when "utf8".

예시

curl -X POST https://x114.org/api/v1/qr-code \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{"text":"https://x114.org","format":"svg","width":256}'
브라우저에서 시도

무료 도구는 코드 작성 없이 동일한 결과를 제공합니다.

도구 열기