LinQR API Documentation

Powerful REST API for programmatic link shortening and QR code generation

Getting Started

The LinQR API provides a simple REST interface for creating short links, generating QR codes, and managing your links programmatically.

1. Get API Key

Create an API key from your dashboard to authenticate requests.

2. Make Requests

Send HTTP requests with your API key in the Authorization header.

3. Track Analytics

Monitor your link performance through the dashboard or API.

Base URL

https://your-domain.com/api/v1
Authentication

All API requests must be authenticated using an API key in the Authorization header.

Header Format

Authorization: Bearer YOUR_API_KEY

Example Request

curl -X GET \
  -H "Authorization: Bearer lqr_1234567890abcdef..." \
  -H "Content-Type: application/json" \
  https://your-domain.com/api/v1/links

API Key Security

Keep your API keys secure and never commit them to version control. Use environment variables in production.

Rate Limiting

API requests are rate-limited per API key to ensure fair usage and system stability.

General Rate Limits

  • 1000 requests per hour per API key
  • 100 requests per minute per API key
  • • Limits reset every hour

Link Creation Limits

  • 10 links per minute per API key
  • 200 links per hour per API key
  • • Separate from general rate limits

Response Headers

  • X-RateLimit-Limit - Current limit for this operation
  • X-RateLimit-Remaining - Requests left in window
  • X-RateLimit-Reset - Unix timestamp of reset
Note: Link creation endpoints show per-minute limits (10),
while other endpoints show hourly limits (1000).

Rate Limit Exceeded Response

Link Creation (10/minute exceeded):

{
  "error": "Rate limit exceeded",
  "code": "RATE_LIMIT_EXCEEDED",
  "retryAfter": 60,
  "operation": "create_link"
}

General API (1000/hour exceeded):

{
  "error": "Rate limit exceeded",
  "code": "RATE_LIMIT_EXCEEDED",
  "retryAfter": 3600,
  "operation": "general"
}
API Endpoints
Error Handling

The API uses standard HTTP status codes and returns detailed error messages in JSON format.

Error Response Format

{
  "error": "Error message description",
  "code": "ERROR_CODE"
}

Common Status Codes

400Bad Request
401Unauthorized
403Forbidden
404Not Found
429Rate Limited
500Server Error
Code Examples

Create a Link

const apiKey = 'lqr_your_api_key_here';
const apiUrl = 'https://your-domain.com/api/v1';

async function createLink(originalUrl, customSlug, title) {
  const response = await fetch(`${apiUrl}/links`, {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${apiKey}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      originalUrl,
      customSlug,
      title
    })
  });
  
  if (!response.ok) {
    throw new Error(`HTTP ${response.status}: ${response.statusText}`);
  }
  
  return response.json();
}

// Usage
createLink('https://example.com', 'my-link', 'Example Site')
  .then(link => console.log('Created:', link))
  .catch(error => console.error('Error:', error));

Ready to get started?

Create your first API key and start building with the LinQR API today.