API Documentation

Integrate URL shortening capabilities into your applications

Overview

The LinkSnip API allows you to programmatically create, manage, and track shortened URLs. Our RESTful API supports JSON and provides endpoints for all the functionality available in the web interface.

Base URL

https://api.linksnip.com/v1

Format

All requests and responses are in JSON format

Rate Limits

Free
: 60 requests/hour

Pro
: 1,000 requests/hour

Enterprise
: 10,000 requests/hour

API Status

Check the current operational status of the LinkSnip API and its components.

All Systems Operational

Updated 2 minutes ago

Current API response time: 87ms

Core Services

URL Shortening
42ms
Analytics
87ms
Bulk Operations
156ms
Authentication
35ms

Additional Services

QR Code Generation
63ms
Webhooks
51ms
Custom Domains
78ms
Password Protection
44ms

API Load

Current load: 42%42,568 requests/minute

Degraded Performance: Bulk Operations

We're experiencing slightly elevated response times for bulk operations. Our team is investigating the issue. Expected resolution: 30 minutes.

Authentication

All API requests require authentication using an API key. You can obtain an API key from your account dashboard.

API Key Authentication

Include your API key in the request headers

curl -X POST https://api.linksnip.com/v1/shorten \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your_api_key_here" \
  -d '{"url": "https://example.com/very/long/url"}'

Never share your API key or expose it in client-side code. Always make API requests from your server.

API Reference

POST

/shorten

Create a new shortened URL

Request Parameters

ParameterTypeRequiredDescription
urlstringYesThe URL to shorten
aliasstringNoCustom alias for the shortened URL
expiresAtstringNoExpiration date in ISO 8601 format
passwordstringNoPassword to protect the URL (Pro plan only)

Example Request

curl -X POST https://api.linksnip.com/v1/shorten \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your_api_key_here" \
  -d '{
    "url": "https://example.com/very/long/url",
    "alias": "my-custom-link",
    "expiresAt": "2023-12-31T23:59:59Z"
  }'

Example Response

{
  "success": true,
  "data": {
    "id": "a1b2c3d4",
    "originalUrl": "https://example.com/very/long/url",
    "shortUrl": "https://linksnip.com/s/my-custom-link",
    "alias": "my-custom-link",
    "expiresAt": "2023-12-31T23:59:59Z",
    "createdAt": "2023-05-15T14:30:45Z",
    "qrCode": "https://linksnip.com/qr/my-custom-link.png"
  }
}

Error Handling

The API uses standard HTTP status codes to indicate the success or failure of a request. In case of an error, the response body will contain additional information.

Error Response Format

{
  "success": false,
  "error": {
    "code": "invalid_url",
    "message": "The provided URL is invalid",
    "status": 400
  }
}

Common Error Codes

Status CodeError CodeDescription
400invalid_requestThe request is malformed or missing required parameters
400invalid_urlThe provided URL is invalid
401unauthorizedMissing or invalid API key
403forbiddenThe API key doesn't have permission to perform the request
404not_foundThe requested resource was not found
409alias_takenThe requested alias is already in use
429rate_limit_exceededYou've exceeded the rate limit for your plan
500server_errorAn unexpected error occurred on the server

SDKs and Libraries

We provide official client libraries for popular programming languages to make integration easier.

JavaScript/Node.js

npm install linksnip-api

Python

pip install linksnip

PHP

composer require linksnip/api

Support

If you have any questions or need help with the API, please contact our support team.

API Playground

Test our API endpoints directly from your browser. No API key required for the playground.

Interactive API Tester

Select an endpoint and fill in the parameters to see the response

Response

{
  "success": true,
  "data": {
    "id": "a1b2c3d4",
    "originalUrl": "https://example.com/your-long-url",
    "shortUrl": "https://linksnip.com/s/my-custom-link",
    "alias": "my-custom-link",
    "expiresAt": null,
    "createdAt": "2023-05-15T14:30:45Z",
    "qrCode": "https://linksnip.com/qr/my-custom-link.png"
  }
}
Note: This playground simulates API responses and does not make actual API calls.

API Changelog

Track the evolution of our API with the version history and changelog.

Version History

v2.0

Latest

Released on May 1, 2025

New Features

  • Added support for custom domains
  • Added password protection for links
  • Added bulk URL shortening endpoint
  • Added expiration date support
  • Enhanced analytics with device and browser data

Breaking Changes

  • Changed authentication from query parameters to header-based
  • Renamed shortened_url field to shortUrl for consistency
  • Removed deprecated /v1/stats endpoint (use /v1/analytics instead)

Bug Fixes

  • Fixed pagination issues in the list URLs endpoint
  • Improved error handling for invalid URLs
  • Fixed timezone inconsistencies in analytics data

v1.5

Released on October 15, 2024

New Features

  • Added QR code generation endpoint
  • Added support for UTM parameters
  • Enhanced rate limiting with better headers
  • Added webhook support for click events

Improvements

  • Improved response time for all endpoints
  • Added more detailed error messages
  • Enhanced documentation with more examples

v1.0

Released on March 1, 2024

Initial Release

  • Basic URL shortening functionality
  • Custom alias support
  • Simple analytics (click counting)
  • List, create, and delete shortened URLs
  • API key authentication