API Documentation - QR100 QR Code Generator

API Documentation

Welcome to the QR100 API documentation. Here you can find your API token and instructions for using the API endpoints.

Your API Token

Endpoints

POST /api/short-url

Create a new short URL with QR code.

Request Body

Parameter Type Required Description Default
targetContent string Yes Target URL to shorten N/A
name string No Name for the short URL First 20 characters of targetContent
style object No QR code style configuration N/A
style.size number No QR code size (must be 128, 256, 512, or 1024) 512
style.fgColor string No Foreground color (must be hex format like #000000) #000000
style.bgColor string No Background color (must be hex format like #ffffff) #ffffff
style.iconUrl string No Icon URL undefined
style.showUrl boolean No Whether to show URL in QR code true
{ "targetContent": "https://example.com", "name": "Example URL", "style": { "size": 512, "fgColor": "#000000", "bgColor": "#ffffff", "iconUrl": "https://example.com/icon.png", "showUrl": true } }

Response

New record response:

{ "success": true, "id": "abc123", "shortUrl": "https://qr100.cc/abc123", "targetContent": "https://example.com", "isExists": false }

Existing record response:

{ "success": true, "id": "abc123", "shortUrl": "https://qr100.cc/abc123", "targetContent": "https://example.com", "isExists": true }

GET /api/short-url/:id

Retrieve short URL data and QR code.

Query Parameters

Parameter Type Required Description Default
qrPhoto boolean No Whether to generate and return QR code PNG file false

Response

Response without QR code (default):

{ "success": true, "id": "abc123", "shortUrl": "https://qr100.cc/abc123", "targetContent": "https://example.com", "isDelete": false, "isAccelerated": false, "createdAt": 1634567890000, "style": { "size": 512, "fgColor": "#000000", "bgColor": "#ffffff", "iconUrl": "https://example.com/icon.png", "showUrl": true } }

Response with QR code (when qrPhoto=true):

{ "success": true, "id": "abc123", "shortUrl": "https://qr100.cc/abc123", "qrUrl": "/uploads/qr-codes/qr100.cc_abc123.png", "targetContent": "https://example.com", "isDelete": false, "isAccelerated": false, "createdAt": 1634567890000, "style": { "size": 512, "fgColor": "#000000", "bgColor": "#ffffff", "iconUrl": "https://example.com/icon.png", "showUrl": true } }

PUT /api/short-url/:id

Update short URL data.

Request Body

Parameter Type Required Description Default
targetContent string No Target URL to shorten Existing value
isDelete boolean No Whether to mark as deleted Existing value
isAccelerated boolean No Whether to enable acceleration Existing value
style object No QR code style configuration N/A
style.size number No QR code size (must be 128, 256, 512, or 1024) Existing value or 512
style.fgColor string No Foreground color (must be hex format like #000000) Existing value or #000000
style.bgColor string No Background color (must be hex format like #ffffff) Existing value or #ffffff
style.iconUrl string No Icon URL Existing value
style.showUrl boolean No Whether to show URL in QR code Existing value or true
{ "targetContent": "https://updated-example.com", "isDelete": false, "isAccelerated": true, "style": { "size": 256, "fgColor": "#FF0000", "bgColor": "#FFFFFF", "showUrl": true } }

Response

{ "success": true }

Usage Examples

JavaScript (Fetch API)

// Create short URL const response = await fetch('https://qr100.cc/api/short-url', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer YOUR_API_TOKEN' }, body: JSON.stringify({ targetContent: 'https://example.com', name: 'Example URL' }) }); const data = await response.json(); console.log(data);

Python (Requests)

import requests import json url = 'https://qr100.cc/api/short-url' headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer YOUR_API_TOKEN' } data = { 'targetContent': 'https://example.com', 'name': 'Example URL' } response = requests.post(url, headers=headers, data=json.dumps(data)) print(response.json())

cURL

curl -X POST https://qr100.cc/api/short-url \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -d '{"targetContent": "https://example.com", "name": "Example URL"}'