نقطة النهاية
GEThttps://qrwing.com/api/qr
تُعيد صورة مباشرة. يتم تمرير جميع المعلمات كوسائط سلسلة استعلام. CORS مفتوح — يمكن استدعاء نقطة النهاية من أي مصدر.
بدء سريع
# URL QR as PNG (default)
https://qrwing.com/api/qr?type=url&url=https://qrwing.com
# Blue SVG with dots style
https://qrwing.com/api/qr?type=url&url=https://qrwing.com&format=svg&fg=1d4ed8&style=dots
# WiFi QR
https://qrwing.com/api/qr?type=wifi&ssid=HomeNetwork&password=mypassword&encryption=WPA
# curl
curl -o qr.png "https://qrwing.com/api/qr?type=url&url=https://qrwing.com"
# HTML img tag
<img src="https://qrwing.com/api/qr?type=url&url=https://qrwing.com" alt="QR Code" />
المعلمات
| المعامل | النوع | الافتراضي | الوصف |
|---|---|---|---|
| type required | string | — | QR code type. See supported types below. |
| format optional | svg | png | webp | png | Output image format. |
| size optional | integer | 300 | Output size in pixels (50–2000). |
| margin optional | integer | 4 | Quiet zone in modules (0–20). |
| ec optional | L | M | Q | H | M | Error correction level. Higher = more redundancy. |
| fg optional | hex | 000000 | Foreground (dot) color as 6-digit hex (no #). |
| bg optional | hex | ffffff | Background color as 6-digit hex (no #). |
| transparent optional | boolean | false | Transparent background (SVG/WebP/PNG). |
| style optional | square | dots | rounded | square | Dot style. |
أنواع رموز QR
استخدم type= مع إحدى القيم أدناه. يتطلب كل نوع معاملات المحتوى الخاصة به.
urlرابط URLurlFull URL including https://emailبريد إلكترونيemailEmail addresssubjectEmail subject (optional)bodyEmail body (optional)phoneهاتفphonePhone number with country codesmsرسالة SMSphonePhone numbermessagePre-filled message (optional)wifiواي فايssidNetwork name (SSID)passwordWiFi passwordencryptionWPA | WEP | nopasshiddentrue if network is hiddenvcardبطاقة تعريفnameFull name (required)orgOrganizationphonePhone numberemailEmail addressurlWebsite URLaddressStreet addresslocationموقعlatLatitudelngLongitudequerySearch query instead of coordinateswhatsappواتسابphonePhone number with country code (no +)messagePre-filled message (optional)telegramتيليغرامusernameTelegram username (without @)messagePre-filled message (optional)calendarحدثtitleEvent title (required)startStart datetime ISO 8601endEnd datetime ISO 8601locationEvent locationdescriptionEvent descriptionallDaytrue for all-day eventsyoutubeيوتيوبurlYouTube video, channel, or playlist URLtwitterتويتر / XusernameTwitter/X username (without @)facebookفيسبوكurlFacebook page or profile URLlinkedinلينكد إنurlLinkedIn profile or page URLinstagramإنستغرامusernameInstagram username (without @)bitcoinبيتكوينaddressBitcoin address (required)amountAmount in BTC (optional)labelPayment label (optional)messagePayment message (optional)zoomزومurlFull Zoom meeting URL (preferred)meetingIdMeeting ID (if no URL)passwordMeeting password (optional)appstoreمتجر التطبيقاتiosUrlApple App Store URLandroidUrlGoogle Play Store URLpaypalباي بالusernamePayPal.me usernameamountRequest amount (optional)currencyCurrency code (optional)أمثلة حية
انقر على أي عنوان URL لفتحه في متصفحك ومشاهدة رمز QR الذي تم إنشاؤه.
Simple URL QR — PNG
https://qrwing.com/api/qr?type=url&url=https://qrwing.comURL — SVG, blue, large
https://qrwing.com/api/qr?type=url&url=https://qrwing.com&format=svg&fg=1d4ed8&size=500URL — dots style, colored
https://qrwing.com/api/qr?type=url&url=https://qrwing.com&style=dots&fg=7c3aed&bg=faf5ffالرد
عند النجاح، تُعيد API الصورة الثنائية مع عنوان Content-Type المناسب:
| الصيغة | نوع المحتوى |
|---|---|
| png | image/png |
| svg | image/svg+xml |
| webp | image/webp |
عند الخطأ، تُعيد API JSON بحالة 400 أو 500:
{"error": "Missing required parameter: type"}
التخزين المؤقت وحدود المعدل
تتضمن الردود Cache-Control: public, max-age=86400 لذلك يتم تخزين الصور مؤقتًا لمدة 24 ساعة بواسطة المتصفحات وشبكات CDN.
API مجانية ولا تتطلب مصادقة. نطلب منك تجنب الطلبات الآلية المفرطة. للتوليد بكميات كبيرة (>1000 رمز QR/يوم)، يرجى الاتصال بنا.
أمثلة التكامل
HTML
<img
src="https://qrwing.com/api/qr?type=url&url=https://qrwing.com&size=200"
alt="QR Code"
width="200"
height="200"
/>
JavaScript (fetch)
const url = new URL("https://qrwing.com/api/qr");
url.searchParams.set("type", "url");
url.searchParams.set("url", "https://qrwing.com");
url.searchParams.set("format", "svg");
url.searchParams.set("fg", "1d4ed8");
const response = await fetch(url);
const svgText = await response.text();
document.getElementById("qr").innerHTML = svgText;
Python
import requests
response = requests.get(
"https://qrwing.com/api/qr",
params={
"type": "url",
"url": "https://qrwing.com",
"format": "png",
"size": 400,
"style": "dots",
"fg": "7c3aed",
}
)
with open("qr.png", "wb") as f:
f.write(response.content)
PHP
$params = http_build_query([
'type' => 'url',
'url' => 'https://qrwing.com',
'format' => 'png',
'size' => 300,
]);
$img = file_get_contents("https://qrwing.com/api/qr?" . $params);
file_put_contents('qr.png', $img);
