Developer API
Build QR codes from your own app
One endpoint, one key. Free up to 1,000 requests an hour — enough for most production apps.
Authentication
Send your key in the X-API-Key header on every request.
curl "https://qrscanner.in/api/v1/generate.php" \
-H "X-API-Key: qrs_your_key_here" \
-H "Content-Type: application/json" \
-d '{"type":"upi","fields":{"vpa":"shop@okhdfcbank","name":"Anjok","amount":"499"}}'
POST /api/v1/generate.php
| Parameter | Type | What it does |
|---|---|---|
| type | string | Any of the 45+ QR types, for example url, upi, wifi, vcard. |
| fields | object | The values for that type. Field names match the studio form. |
| format | string | json returns the payload. svg or png returns image bytes. |
| ec | string | Error correction: L, M, Q or H. Defaults to Q. |
| scale | int | Pixels per module, 2 to 20. Defaults to 8. |
Response
{
"ok": true,
"type": "upi",
"payload": "upi://pay?pa=shop%40okhdfcbank&pn=Anjok&am=499&cu=INR",
"studio_url": "https://qrscanner.in/generator.php?type=upi"
}
Examples
PHP
$ch = curl_init('https://qrscanner.in/api/v1/generate.php');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['X-API-Key: qrs_your_key_here', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'type' => 'wifi',
'fields' => ['ssid' => 'Cafe-Guest', 'password' => 'welcome123'],
'format' => 'svg',
]),
]);
$svg = curl_exec($ch);
JavaScript
const res = await fetch('https://qrscanner.in/api/v1/generate.php', {
method: 'POST',
headers: { 'X-API-Key': key, 'Content-Type': 'application/json' },
body: JSON.stringify({ type: 'url', fields: { url: 'https://anjok.in' } })
});
const data = await res.json();
Errors
| Status | Meaning | What to do |
|---|---|---|
| 401 | Key missing or invalid | Check the header name and copy the key again from your account page. |
| 422 | Unknown type, or empty result | Confirm the type name and that the required fields are filled. |
| 429 | Hourly quota reached | Wait for the next hour, or ask us for a commercial quota. |