QR Code REST API

A simple, RESTful API for generating QR codes. Standard HTTP methods, predictable URLs, and JSON error responses. Works with any programming language.

API Endpoints

GET /api/generate

Generate a QR code. Returns the image directly (PNG or SVG).

curl "https://qrcodeapi.io/api/generate?data=https://example.com" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -o qr.png

POST /api/generate

Same as GET, but parameters in request body (useful for long data).

curl -X POST "https://qrcodeapi.io/api/generate" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"data": "https://example.com", "size": 400}' \
  -o qr.png

POST /api/batch

Generate multiple QR codes in one request.

curl -X POST "https://qrcodeapi.io/api/batch" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"items": [{"data": "url1"}, {"data": "url2"}]}'

Request Parameters

ParameterTypeDefaultDescription
datastringrequiredContent to encode
sizenumber300Size in pixels (50-2000)
formatstringpngpng or svg
colorstring000000QR color (hex)
backgroundstringffffffBackground (hex)
errorCorrectionstringML, M, Q, or H
marginnumber4Quiet zone (0-10)

Authentication

Include your API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Or use the X-API-Key header or api_key query parameter.

Response Codes

CodeMeaning
200Success - QR code returned as image
400Bad Request - Invalid parameters
401Unauthorized - Invalid API key
429Rate Limited - Too many requests
500Server Error

Error Response Format

{
  "error": true,
  "message": "API key required"
}

Start Using the REST API

Get your API key and make your first request in minutes.

Get Free API Key