Docs/APIs/QR Code Reader

QR Code Reader

Extract text from QR codes in images

OperationalCredits 10 per callp50 2685msImagesStar

Overview

A server-side QR code decoder: send the image, get back the encoded payload as JSON. This API uses advanced image processing techniques to detect and decode QR codes from images. It supports various QR code formats and can extract URLs, plain text, contact information, and other encoded data.

Live Test QR Code Reader API →

Endpoint

One host, one path per API. The block below shows this call in four languages; every one of them is the same HTTP request. Making requests covers the timeouts, retries and parameter rules that apply to all of them. The SDKs wrap the same call in a typed client.

POSThttps://api.apiverve.com/v1/qrcodereader
curl -X POST https://api.apiverve.com/v1/qrcodereader \
  -H "x-api-key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
  "image": "https://raw.githubusercontent.com/zxing/zxing/master/core/src/test/resources/blackbox/qrcode-1/1.png"
}'

Replace your_api_key_here with the key from your dashboard. When the inputs arrive as a list rather than one at a time, batch requests run up to 200 of them through this same API in a single call.

Authentication

Send your key in the x-api-key header. That is the only auth step — there is no token exchange and no per-endpoint scope to configure. Authentication covers creating, rotating and revoking keys.

401 is the only auth verdict

A 401 means the key is missing, invalid or expired. A 403 means the key is valid but not permitted here — blocked by a key restriction or an IP allow-list. Running out of credits is a 429.

Parameters

Sent as JSON in the request body. Premium parameters are accepted on every plan but only take effect on plans that include them.

ParameterTypeDescription
imageOptionalstringUpload an image file containing a QR code to decode (supported formats: JPG, PNG, GIF)

Response

Every API returns the same three top-level keys, so one response handler covers your whole integration: status, error and data. Only data changes shape. Response format covers the envelope, the other output formats and how premium fields are withheld.

Sample response
{
  "status": "ok",
  "error": null,
  "data": {
    "text": "MEBKM:URL:http\\://en.wikipedia.org/wiki/Main_Page;;",
    "location": {
      "topLeft": {
        "x": 177.3193597934474,
        "y": 136.7505501895766
      },
      "topRight": {
        "x": 448.1679366259464,
        "y": 141.51963536741036
      },
      "bottomLeft": {
        "x": 154.23652635814304,
        "y": 397.91435038456353
      },
      "bottomRight": {
        "x": 467.51014796868805,
        "y": 398.5768252349065
      }
    },
    "payloadType": "text",
    "parsed": null,
    "codeCount": 1,
    "codes": [
      {
        "text": "MEBKM:URL:http\\://en.wikipedia.org/wiki/Main_Page;;",
        "location": {
          "topLeft": {
            "x": 177.3193597934474,
            "y": 136.7505501895766
          },
          "topRight": {
            "x": 448.1679366259464,
            "y": 141.51963536741036
          },
          "bottomLeft": {
            "x": 154.23652635814304,
            "y": 397.91435038456353
          },
          "bottomRight": {
            "x": 467.51014796868805,
            "y": 398.5768252349065
          }
        },
        "payloadType": "text",
        "parsed": null
      }
    ]
  }
}

Response fields

Paths are relative to data. Premium fields are absent rather than zeroed on plans that do not include them, so check for presence instead of comparing to 0.

FieldTypeExampleDescription
textstring"MEBKM:URL:http\://en.wikipedia.org/wiki/Main_Page;;"Decoded text extracted from the QR code image
locationPremiumobject{...}Object containing QR code position and corner coordinates, in the uploaded image's pixels
topLeftPremiumobject{...}Top left corner coordinates with x and y values
xPremiumnumber177.3193597934474X coordinate of top left corner position
yPremiumnumber136.7505501895766Y coordinate of top left corner position
topRightPremiumobject{...}Top right corner coordinates with x and y values
xPremiumnumber448.1679366259464X coordinate of top right corner position
yPremiumnumber141.51963536741036Y coordinate of top right corner position
bottomLeftPremiumobject{...}Bottom left corner coordinates with x and y values
xPremiumnumber154.23652635814304X coordinate of bottom left corner position
yPremiumnumber397.91435038456353Y coordinate of bottom left corner position
bottomRightPremiumobject{...}Bottom right corner coordinates with x and y values
xPremiumnumber467.51014796868805X coordinate of bottom right corner position
yPremiumnumber398.5768252349065Y coordinate of bottom right corner position
payloadTypePremiumstring"text"Kind of payload: url, wifi, vcard, mecard, email, phone, sms, geo or text
parsedPremiumobjectnullThe payload split into fields for its payloadType (for wifi: ssid, password, encryption, hidden; for vcard/mecard: name, phones, emails, organization, title, url, address; for email: address, subject, body; for phone: number; for sms: number, message; for geo: latitude, longitude; for url: url). Null for plain text
codeCountPremiumnumber1Number of QR codes found in the image
codesPremiumarray[1]Every QR code found, first one first: each has text, location, payloadType and parsed
textPremiumstring"MEBKM:URL:http\://en.wikipedia.org/wiki/Main_Page;;"Decoded text extracted from the QR code image
locationPremiumobject{...}Object containing QR code position and corner coordinates, in the uploaded image's pixels
topLeftPremiumobject{...}
xPremiumnumber177.3193597934474
yPremiumnumber136.7505501895766
topRightPremiumobject{...}
xPremiumnumber448.1679366259464
yPremiumnumber141.51963536741036
bottomLeftPremiumobject{...}
xPremiumnumber154.23652635814304
yPremiumnumber397.91435038456353
bottomRightPremiumobject{...}
xPremiumnumber467.51014796868805
yPremiumnumber398.5768252349065
payloadTypePremiumstring"text"Kind of payload: url, wifi, vcard, mecard, email, phone, sms, geo or text
parsedPremiumobjectnullThe payload split into fields for its payloadType (for wifi: ssid, password, encryption, hidden; for vcard/mecard: name, phones, emails, organization, title, url, address; for email: address, subject, body; for phone: number; for sms: number, message; for geo: latitude, longitude; for url: url). Null for plain text

Errors

Read the HTTP status first, then error for the specific reason. The body names the parameter that has to change. Error handling covers the full status list and which of them are worth retrying.

StatusMeaningWhat to do
400Input was rejectedRead error; it names the parameter.
401Key missing or invalidCheck the header name and the key value.
403Key valid, but not permittedA key restriction or IP allow-list; see key scoping.
429Rate limited, or out of creditsRead error to tell them apart; see rate limits.

Start from a template

A working app built on this API, ready to deploy with your own key. Vercel asks for the key when you deploy; the code is on GitHub to change first.

Use cases

Inventory Management
Scan QR codes on products for tracking and management
Event Check-In
Quickly read QR codes for attendee registration and access control
Marketing Campaigns
Decode QR codes from promotional materials to track engagement
Data Extraction
Extract encoded information from QR codes for various applications

Set up QR Code Reader

Ready to put it to work? Set up QR Code Reader on APIVerve.

More in Images:

Was this page helpful?