SmartyLabels API

Create and manage trackable QR codes programmatically. Perfect for integrating QR code functionality into your applications or workflows.

Base URL

https://smartylabels.com/api/v1

Authentication

All API requests require authentication using a Bearer token. Include your API key in the Authorization header:

Authorization: Bearer sl_your_api_key_here

Getting Your API Key

  1. Register for a SmartyLabels account
  2. Go to your Dashboard
  3. Click "Generate API Key" in the API Access section
  4. Copy and securely store your API key

URL Endpoints

POST /urls

Create a new trackable URL

Request Body

{
  "title": "My Landing Page",
  "destination": "https://example.com/landing",
  "description": "Optional description"
}

Response

{
  "success": true,
  "url": {
    "id": "507f1f77bcf86cd799439011",
    "urlCode": "Xy7kM",
    "title": "My Landing Page",
    "shortUrl": "https://smartylabels.com/Xy7kM",
    "qrCodeUrl": "https://smartylabels.com/urls/.../qr",
    "destination": "https://example.com/landing",
    "status": "active",
    "clicks": 0
  }
}
GET /urls

List all URLs for your account

Query Parameters

limit Max results (default: 50, max: 100)
offset Skip N results for pagination
status Filter by: active, inactive, pending
GET /urls/:id

Get details for a specific URL

PUT /urls/:id

Update a URL's destination, title, or status

Request Body

{
  "destination": "https://example.com/new-page",
  "status": "active"
}
DELETE /urls/:id

Permanently delete a URL

GET /urls/:id/stats

Get click statistics and analytics

Response

{
  "success": true,
  "stats": {
    "totalClicks": 142,
    "last24Hours": 23,
    "last7Days": 89,
    "deviceBreakdown": { "mobile": 98, "desktop": 44 },
    "topReferrers": [
      { "host": "google.com", "count": 45 }
    ]
  }
}

Batch Endpoints

POST /batches

Create multiple URLs at once

{
  "name": "Campaign",
  "count": 100,
  "titlePrefix": "Product-"
}
GET /batches

List all batches

GET /batches/:batchId

Get batch details including all URLs

Account

GET /account

Get account information

Code Examples

cURL

curl -X POST https://smartylabels.com/api/v1/urls \
  -H "Authorization: Bearer sl_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"title": "My QR Code", "destination": "https://example.com"}'

JavaScript

const response = await fetch('https://smartylabels.com/api/v1/urls', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer sl_your_api_key',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    title: 'My QR Code',
    destination: 'https://example.com'
  })
});
const data = await response.json();
console.log(data.url.shortUrl);

Python

import requests

response = requests.post(
    'https://smartylabels.com/api/v1/urls',
    headers={'Authorization': 'Bearer sl_your_api_key'},
    json={'title': 'My QR Code', 'destination': 'https://example.com'}
)
print(response.json()['url']['shortUrl'])