العودة إلى نظرة 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

جسم الطلب

أرسل كـ JSON في جسم POST.

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}'
جرّب في المتصفح

الأداة المجانية تعطيك نفس النتيجة دون كتابة أي شفرة.

افتح الأداة