"<?php\n// PHP 8.5 recommended (latest stable in Jan 2026)\n\n$api_url = \"https://apidevelopers.ir/api/v1/qrcode-generator\";\n\n$params = [\n    'apiKey' => 'YOUR_API_KEY',\n    'text' => 'string', // required\n    'quality' => '30', // optional\n    'format' => 'png', // optional\n];\n\n$options = [\n    'http' => [\n        'header'  => \"Content-type: application/x-www-form-urlencoded\",\n        'method'  => 'POST',\n        'content' => http_build_query($params),\n        'ignore_errors' => true,\n    ],\n];\n\n$context  = stream_context_create($options);\n$response = file_get_contents($api_url, false, $context);\n\nif ($response === false) {\n    echo \"Error occurred\\n\";\n    // you can read $http_response_header for more info\n} else {\n    echo $response;\n}\n?>"
#ParameterTypeDefaultDescriptionStatus
1apiKeystring-Your API key for authenticationRequired
2textstring-Accepts characters between 1 and 5,000 in lengthRequired
3qualityint30Accepts integer between 1 and 100Optional
4formatstringpngAccepts one of these: png, jpg, jpeg, webpOptional
نمونه ورودی:
{
  "apiKey": "YOUR_API_KEY",
  "text": "https://apidevelopers.ir/services",
  "format": "png",
  "quality": "50"
}
نمونه خروجی:
{
  "ok": true,
  "code": 200,
  "result": {
    "base64code": "iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAYAAACprHcmAAAAAklEQVR4AewaftIAAABpSURBVI3BAWoDMRDAQMn4/19WvBDDEQ7aGTv4p82hMipURoXK0+JFhUrFqBh28EJlVFybQ2VUvFEZm6NC5VKpGCoVY3GoVKioVDypjM1Dxa+Ka3FUqAwVFZWhci0OlYpR8VRxLb5U/vIBK9U+Hm7QW0sAAAAASUVORK5CYII=",
    "format": "png",
    "description": "To use this QR code, first decode the Base64 string, then save it as a png image file."
  },
  "meta": {
    "webService": "qrcode-generator",
    "cost": "100.00"
  },
  "message": "SUCCESS"
}