Automate Your Link Management with Our Powerful API

Create, manage, and track short links programmatically. Integrate LinkTwin with N8N, Airtable, Zapier, Google Sheets, or any custom software. RESTful API with complete documentation.

View Documentation
RESTful JSON API Instant API key cURL, PHP, Node.js examples
# Create a short link with one API call
curl -X POST "https://linktw.in/api/url/add" \
     -H "Authorization: Bearer YOUR_API_KEY" \
     -H "Content-Type: application/json" \
     -d '{"url": "https://example.com/your-long-url"}'
Integrations

Connect to Your Favorite Tools

Our RESTful API integrates seamlessly with automation platforms, spreadsheets, CRMs, and custom applications. If it can make HTTP requests, it can use LinkTwin.

N8N N8N
Zapier
Airtable
Google Sheets
Slack
Custom Apps
Use Cases

What Can You Build with Our API?

From simple automations to complex enterprise integrations, our API powers thousands of use cases.

Automated Link Generation

Automatically create short links when new products are added, blog posts are published, or content is uploaded. Perfect for e-commerce and content platforms.

Shopify WordPress WooCommerce

Bulk Link Management

Import thousands of URLs from spreadsheets, generate short links in bulk, and export them back. Ideal for marketing campaigns and affiliate programs.

Google Sheets Excel CSV Import

Analytics Integration

Pull click data, referrer stats, and conversion metrics directly into your analytics dashboards, BI tools, or custom reporting systems.

Data Studio Tableau Power BI

Email & SMS Campaigns

Generate unique tracking links for each recipient in your email or SMS campaigns. Track individual engagement and optimize your outreach.

Mailchimp SendGrid Twilio

Mobile App Integration

Create deep links on-the-fly from your mobile app. Share content with smart links that open directly in other apps instead of browsers.

iOS Android React Native

Dynamic QR Codes

Generate QR codes programmatically for print materials, product packaging, or event tickets. Update the destination URL anytime without reprinting.

Print Systems Label Printers POS Systems
API Capabilities

Everything You Need to Build

Complete RESTful API with endpoints for links, QR codes, analytics, pixels, and more. Full CRUD operations with detailed responses.

Link Management

Create, update, delete, and list shortened URLs. Set custom aliases, expiration dates, password protection, and geo-targeting rules via API.

Analytics & Stats

Retrieve click counts, referrer data, device breakdowns, geographic distribution, and time-series data for any link or date range.

QR Code Generation

Generate QR codes for any link with customizable size, colors, and formats. Get QR codes as PNG, SVG, or base64-encoded data.

Pixels & Retargeting

Attach Facebook Pixel, Google Analytics, or custom tracking pixels to links. Manage pixel configurations programmatically.

Popular API Endpoints

POST /api/url/add

Create a new shortened URL with optional customization options.

url string The long URL to shorten (required)
custom string Custom alias for the short URL (optional)
expiry datetime Expiration date for the link (optional)
password string Password protect the link (optional)
GET /api/url/:id/stats

Retrieve detailed click analytics for a specific link.

id integer The link ID (required)
from date Start date for stats range (optional)
to date End date for stats range (optional)
GET /api/urls

List all your shortened URLs with pagination support.

limit integer Number of results per page (default: 15)
page integer Page number for pagination (default: 1)
Code Examples

Ready-to-Use Code Snippets

Get started in minutes with our code examples in cURL, PHP, Node.js, and Python. Copy, paste, and customize.

PHP Example
<?php
// Shorten a URL with LinkTwin API
$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => "https://linktw.in/api/url/add",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer YOUR_API_KEY",
        "Content-Type: application/json",
    ],
    CURLOPT_POSTFIELDS => json_encode([
        'url' => 'https://example.com/long-url',
        'custom' => 'my-custom-alias'
    ])
]);

$response = json_decode(curl_exec($curl));
echo $response->shorturl;
// Output: https://linktw.in/my-custom-alias
Node.js Example
// Shorten a URL with LinkTwin API
const axios = require('axios');

async function shortenUrl(longUrl) {
    const response = await axios.post(
        'https://linktw.in/api/url/add',
        { url: longUrl },
        {
            headers: {
                'Authorization': `Bearer ${API_KEY}`,
                'Content-Type': 'application/json'
            }
        }
    );

    return response.data.shorturl;
}

shortenUrl('https://example.com')
    .then(url => console.log(url));
Python Example
import requests

# Shorten a URL with LinkTwin API
response = requests.post(
    'https://linktw.in/api/url/add',
    headers={
        'Authorization': 'Bearer YOUR_API_KEY',
        'Content-Type': 'application/json'
    },
    json={
        'url': 'https://example.com/long-url'
    }
)

data = response.json()
print(data['shorturl'])
# Output: https://linktw.in/abc123
N8N Workflow Example
// N8N HTTP Request Node Configuration
{
  "method": "POST",
  "url": "https://linktw.in/api/url/add",
  "authentication": "genericCredentialType",
  "genericAuthType": "httpHeaderAuth",
  "sendBody": true,
  "bodyParameters": {
    "parameters": [
      {
        "name": "url",
        "value": "={{ $json.url }}"
      }
    ]
  }
}
Why Choose Our API

Built for Developers, By Developers

A robust API with everything you need to integrate link management into your applications.

Fast & Reliable

Sub-100ms response times. Our globally distributed infrastructure ensures your links work instantly, every time.

Response Time: 47ms avg Global CDN: 12 edge locations

Secure Authentication

Bearer token authentication with the ability to regenerate your API key anytime. All requests are encrypted via HTTPS.

RESTful Design

Clean, intuitive endpoints following REST conventions. JSON responses with detailed error messages and status codes.

Generous Rate Limits

High rate limits for all plans. Free plan includes 60 requests/minute. Paid plans scale up to 1000+ requests/minute.

Complete Documentation

Detailed docs with code examples in cURL, PHP, Node.js, and more. Interactive API explorer to test endpoints.

Developer Support

Stuck on something? Our developer support team is here to help you integrate successfully. Priority support for paid plans.

FAQ

Developer
Questions

Common questions about our API, authentication, rate limits, and integrations.

Read full API docs

Create a free account and your API key is automatically generated. Go to your dashboard Settings page to view and copy your API key. You can regenerate it anytime if needed. The API is included in all plans, including the free tier.

Rate limits depend on your plan. Free accounts get 60 requests per minute. Paid plans start at 120 requests/minute and can scale to 1000+ for enterprise needs. Rate limit headers are included in every response so you can monitor usage in real-time.

Absolutely! Our API works with any automation platform that supports HTTP requests. Use the HTTP Request node in N8N, Webhooks in Zapier, or HTTP modules in Make.com. We provide detailed guides and examples for each platform in our documentation.

Our API includes endpoints for: URL shortening (create, update, delete, list), analytics (clicks, referrers, devices, locations), QR codes (generate with custom styles), campaigns/collections, pixels/tracking, and account management. View all endpoints in our documentation.

Yes! API access is available on all plans, including the free tier. Free accounts can create links, retrieve analytics, and use all core API features. The main limitations are rate limits (60 requests/minute) and the monthly click cap on your account.

We provide ready-to-use code examples in cURL, PHP, Node.js, and Python directly in our documentation. Each endpoint includes copy-paste examples showing authentication, request format, and response handling. Community SDKs are also available on GitHub for popular languages.

Start Building with Our API Today

Get your free API key in seconds. No credit card required. Full documentation and code examples included.

Read Documentation

Free API access included with every account

Build something great.