QR Kod Oluşturucu
Resim Üretici Veri Üretici Kredi / istek: 5Metin, URL, E-posta, Telefon Numarası, SMS, Geo, vCard veya Wi-Fi bilgisi içeren QR kod oluşturur.
POST
https://api.apikodu.com/api/v1/qrcodegenerator
Dokümantasyon
Genel bakış
QR kod üretir ve indirilebilir dosya URL'si döner.
Kimlik doğrulama
Her istekte x-api-key başlığı zorunludur. Kullanılan kredi ve kalan kota yanıt başlıklarında (x-api-credits-used, x-api-remaining-credits, x-rate-limit-*) döner.
İstek
POST
https://api.apikodu.com/api/v1/qrcodegenerator
JSON gövde. type alanına göre ek alanlar değişir (url, text, email, wifi, vcard ...).
Parametreler
| Ad | Tip | Zorunlu | Varsayılan | Seçenekler | Açıklama |
|---|---|---|---|---|---|
type |
integer | * Zorunlu | — | 1=text 2=url 3=email 4=phone 5=sms 6=geo 7=wifi 8=vcard |
QR içeriği tipi. |
url / text / ... |
string | * Zorunlu | — | — | type'a göre asıl içerik alanı. Örn. type=2 için url zorunlu. |
encryption |
string | Opsiyonel | png |
png webp jpeg svg |
Çıktı formatı. Playground alanı format içindir. |
size |
integer | Opsiyonel | 200 |
— | Kenar boyutu piksel. 50–2048. |
foregroundcolor |
string | Opsiyonel | #000000 |
— | Ön plan rengi (hex). JSON alanı: foregroundColor. |
backgroundcolor |
string | Opsiyonel | #FFFFFF |
— | Arka plan rengi (hex). JSON alanı: backgroundColor. |
usemargin |
boolean | Opsiyonel | false |
true false |
Sessiz bölge (quiet zone). JSON alanı: useMargin. |
iconbase64 |
string | Opsiyonel | — | — | Orta ikon (base64). Playground dosya gönderir. JSON: iconBase64. |
iconsizepercent |
integer | Opsiyonel | 20 |
— | İkon alanı %. 1–50. JSON: iconSizePercent. |
iconborderwidth |
integer | Opsiyonel | 5 |
— | İkon çerçeve kalınlığı. JSON: iconBorderWidth. |
Yanıt
| Ad | Tip | Açıklama |
|---|---|---|
downloadUrl |
string | İmzalı (X-Amz-Expires) indirme URL'si. expires dolunca geçersiz olur. |
type |
string | Üretilen içerik tipi. Örn. Url, Text, Wifi, Vcard. |
format |
string | Dosya formatı: png, webp, jpeg veya svg. |
correction |
string | QR hata düzeltme seviyesi. L / M / Q / H. Varsayılan M. |
expires |
number | İndirme URL'sinin unix epoch bitiş zamanı (saniye). |
Hatalar
| HTTP | code | Açıklama |
|---|---|---|
400 |
-187 |
JSON gövde yok. |
400 |
-195 |
type desteklenmiyor. 1–8 olmalı (text, url, email, phone, sms, geo, wifi, vcard). |
400 |
-189 |
type=1 (text) ve text boş. |
400 |
-190 |
type=2 (url) ve url geçersiz. |
400 |
-191 |
type=3 (email) ve e-posta geçersiz. |
400 |
-192 |
type=4/5 (phone/sms) ve phone boş. |
400 |
-193 |
type=7 (wifi) SSID boş, veya type=8 (vcard) firstName boş. |
400 |
-202 |
iconBase64 çözülemedi veya desteklenmeyen görsel. |
500 |
-196 |
Üretilen QR depolanamadı. |
500 |
-197 |
İndirme URL'si oluşturulamadı. |
401 |
-100 |
x-api-key yok, boş, prefix/uzunluk hatalı, pasif, yasaklı, süresi dolmuş, IP kısıtına takıldı veya bu API anahtara izinli değil. |
429 |
-221 |
Dakikalık istek limiti aşıldı. Yanıt başlıkları: x-rate-limit-limit, x-rate-limit-remaining, x-rate-limit-reset. |
429 |
— | Paket kredi kotası bu isteğin kredisini karşılamıyor. Gövde { error, limit, currentUsage, requestCost } olabilir (code alanı yok). |
500 |
-1 |
Beklenmeyen sunucu hatası. message genel bir hata metnidir; teknik ayrıntı içermez. |
Notlar
- Başarılı gövde { data: { ... } } şeklindedir. Hata gövdesi { code, message } şeklindedir. code alanı ApiResponseCode enum değeridir (negatif tam sayı).
Örnek yanıt
{
"data": {
"downloadUrl": "https://files.erseapi.com/images/sample/output.png?X-Amz-Expires=86400",
"type": "Url",
"format": "png",
"correction": "M",
"expires": 1771891200
}
}
Kod örnekleri
const response = await fetch('https://api.apikodu.com/api/v1/qrcodegenerator', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY'
},
body: JSON.stringify({
name: 'example',
value: 123
})
});
const data = await response.json();
console.log(data);
import requests
headers = {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY'
}
payload = {
'name': 'example',
'value': 123
}
response = requests.post('https://api.apikodu.com/api/v1/qrcodegenerator', headers=headers, json=payload)
data = response.json()
print(data)
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("x-api-key", "YOUR_API_KEY");
var payload = new { name = "example", value = 123 };
var json = JsonSerializer.Serialize(payload);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.apikodu.com/api/v1/qrcodegenerator", content);
response.EnsureSuccessStatusCode();
var data = await response.Content.ReadAsStringAsync();
Console.WriteLine(data);
$data = [
'name' => 'example',
'value' => 123
];
$response = file_get_contents('https://api.apikodu.com/api/v1/qrcodegenerator', false, stream_context_create([
'http' => [
'header' => "x-api-key: YOUR_API_KEY"
],
'method' => 'POST',"
'content' => json_encode($data)
]));
print_r(json_decode($response, true));
curl -X POST 'https://api.apikodu.com/api/v1/qrcodegenerator' \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY' \
-d '{
"name": "example",
"value": 123
}'
Hemen denemeye başlayın
Ücretsiz hesap açın, API anahtarınızı alın ve ilk isteğinizi dakikalar içinde gönderin.