OnQRCode.com API Documentation

Integrate QR code generation directly into your applications with our simple and powerful API.

Getting Started

The OnQRCode.com API allows you to generate QR codes programmatically. You can use this API to create QR codes for URLs, text, or any other data you need to encode.

Our API is RESTful and returns responses in JSON format. No authentication is required for basic usage.

Rate Limits

Free tier: 100 requests per day

Premium tier: 10,000 requests per day

Enterprise tier: Custom limits available

Endpoints

POST /api/generate

Generate a QR code from a URL or text.

Request Parameters

Parameter Type Required Description
targetUrl String Yes The URL or text to encode in the QR code
size Number No Size of the QR code in pixels (default: 300)
errorCorrectionLevel String No Error correction level: "L", "M", "Q", "H" (default: "H")
margin Number No Margin around the QR code (default: 1)

Example Request

POST /api/generate HTTP/1.1
Host: onqrcode.com
Content-Type: application/json

{
  "targetUrl": "https://example.com",
  "size": 300,
  "errorCorrectionLevel": "H",
  "margin": 1
}
                    

Example Response

{
  "success": true,
  "qrCodeUrl": "/uploads/550e8400-e29b-41d4-a716-446655440000.png",
  "fullUrl": "https://onqrcode.com/uploads/550e8400-e29b-41d4-a716-446655440000.png"
}
                        
GET /api/generate

Generate a QR code from a URL or text using a GET request. This is useful for simple integrations or direct browser access.

Query Parameters

Parameter Type Required Description
targetUrl String Yes The URL or text to encode in the QR code
size Number No Size of the QR code in pixels (default: 300)
errorCorrectionLevel String No Error correction level: "L", "M", "Q", "H" (default: "H")
margin Number No Margin around the QR code (default: 1)

Example Request

GET /api/generate?targetUrl=https://onqrcode.com&size=300&errorCorrectionLevel=H&margin=1 HTTP/1.1
Host: onqrcode.com
                    

Example Response

{
  "success": true,
  "qrCodeUrl": "/uploads/550e8400-e29b-41d4-a716-446655440000.png",
  "fullUrl": "https://onqrcode.com/uploads/550e8400-e29b-41d4-a716-446655440000.png"
}
                        
GET /api/status

Check the API status and current rate limits.

Example Response

{
  "status": "operational",
  "version": "1.0.0",
  "rateLimit": {
    "limit": 100,
    "remaining": 95,
    "reset": 1623456789
  }
}
                    

Error Handling

The API uses standard HTTP status codes to indicate the success or failure of requests.

Status Code Description
200 Success
400 Bad Request - The request was invalid or cannot be served
401 Unauthorized - Authentication is required
403 Forbidden - The request is not allowed
429 Too Many Requests - Rate limit exceeded
500 Internal Server Error - Something went wrong on our end

Error Response Format

{
  "error": "Error message",
  "code": "ERROR_CODE",
  "details": "Additional error details"
}
                

Authentication

For higher rate limits and premium features, authentication is required.

API Keys

To obtain an API key, please contact our support team or sign up for a premium account.

Include your API key in the request headers:

X-API-Key: your_api_key_here
                    

Support

If you have any questions or need assistance with our API, please contact our support team at api-support@onqrcode.com.

For more detailed information, check out our Support Center.