API Documentation
Complete guides and reference for integrating NiceQRCode into your applications. Generate QR codes programmatically with our powerful API featuring presets, custom styling, and advanced customization options.
Complete API Documentation
Comprehensive guide to integrating NiceQRCode into your applications with detailed endpoint documentation, code examples, and styling options.
View API ReferenceGetting Started
1. API Overview
NiceQRCode provides a RESTful API that allows you to programmatically create, manage, and track QR codes. Our API is designed to be simple, intuitive, and powerful, with support for custom styling, presets, and advanced customization options.
Base URL: https://generate.niceqrcodes.com2. Authentication
All API requests require authentication using an API key. You can generate an API key from your account dashboard. Include your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY
3. Create Your First QR Code
Creating a QR code is simple! Here's a basic example using a preset for easy styling:
curl -X POST https://generate.niceqrcodes.com/qr/generate \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "https://example.com",
"type": "url",
"title": "My Website",
"style": {
"width": 300,
"height": 300,
"dotsColor": "#000000"
}
}'For even easier styling, use one of our presets! This creates the same QR code with a professional gradient design:
curl -X POST https://generate.niceqrcodes.com/qr/generate \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "https://example.com",
"type": "url",
"title": "My Website",
"preset": "modern-blue"
}'4. Response Format
QR generation returns a job ID immediately (since QR codes are generated asynchronously). Use the job ID to check status:
{
"jobId": "qr_job_123456",
"status": "queued",
"message": "QR generation job started"
}Check the job status using the jobId:
curl "https://generate.niceqrcodes.com/qr/generate?jobId=qr_job_123456" \ -H "Authorization: Bearer YOUR_API_KEY"
When complete, you'll receive the QR code data:
{
"jobId": "qr_job_123456",
"status": "completed",
"qrCode": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
"content": "https://example.com",
"type": "url",
"style": { ... },
"preset": "modern-blue",
"qrRecordId": "qr_123456"
}5. Rate Limits & Generation Limits
Generation limits and API rate limits vary by plan. View our complete pricing details for specific limits:
View Pricing & LimitsEach plan includes different limits for:
- Active QR codes: Maximum number of QR codes that can be live and redirecting
- Resolution: Maximum QR code size (e.g., 250px to 2000px+)
- API access: Whether you can use the API for programmatic generation
- Advanced features: AI styling suggestions, bulk generation, team management
6. Using Presets for Easy Styling
Presets are pre-configured styling templates that make it easy to create beautiful QR codes without complex customization. Instead of specifying individual style properties, you can simply use a preset name.
Available Preset Categories:
- Basic: Clean, simple designs (square, dots, minimal)
- Modern: Contemporary styles with gradients and rounded corners
- Elegant: Sophisticated, professional designs
- Custom: User-created presets (available on higher plans)
Example with Preset:
curl -X POST https://generate.niceqrcodes.com/qr/generate \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "https://myrestaurant.com",
"type": "url",
"title": "Visit Our Restaurant",
"preset": "modern-blue"
}'Advanced: Preset with Overrides:
You can also start with a preset and override specific properties:
curl -X POST https://generate.niceqrcodes.com/qr/generate \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "https://myrestaurant.com",
"type": "url",
"title": "Visit Our Restaurant",
"preset": "modern-blue",
"styleOverrides": {
"width": 400,
"dotsColor": "#ff6b6b"
}
}'7. Custom Styling Parameters
For full control over your QR code appearance, you can specify detailed styling parameters:
Core Parameters:
{
"content": "https://example.com",
"type": "url",
"title": "My QR Code",
"style": {
"width": 300,
"height": 300,
"margin": 16,
"dotsColor": "#000000",
"backgroundColor": "#ffffff",
"dotsType": "square",
"cornersType": "square",
"cornersDotType": "square",
"dotsGradient": {
"type": "linear",
"rotation": 0,
"colorStops": [
{ "offset": 0, "color": "#ff0000" },
{ "offset": 1, "color": "#0000ff" }
]
},
"logoImage": "data:image/png;base64,...",
"logoSize": 0.4
}
}Parameter Details:
- width/height: QR code dimensions (must be equal for square codes)
- dotsType: "square", "dots", "rounded", "extra-rounded", "classy", "classy-rounded"
- dotsColor: Hex color for QR code dots
- dotsGradient: Linear or radial gradient for dots
- logoImage: Base64 data URL of center logo
- logoSize: Logo size relative to QR code (0.05 to 0.8)
8. Error Handling
Errors are returned with appropriate HTTP status codes and error messages. Common errors include:
- 401 Unauthorized: Invalid or missing API key
- 400 Bad Request: Missing required parameters or invalid data
- 403 Forbidden: Plan limits exceeded (upgrade required)
- 429 Too Many Requests: Rate limit exceeded
- 500 Internal Server Error: Server-side processing error
{
"error": "Content and type are required",
"status": 400
}{
"error": "QR code size cannot exceed 250x250 pixels for your plan. Upgrade for larger sizes.",
"status": 403
}Need Help?
Check out our Help Center or contact support if you have questions.
Ready to start generating QR codes? Check our pricing to find the right plan for your needs.
For detailed technical documentation, see our complete API reference.