API Documentation

Integrate EziLinks into your applications with our powerful RESTful API

Getting Started

The EziLinks API allows you to programmatically create, manage, and track short URLs. All API requests require authentication using an API key.

Base URL

https://ezilinks.com/api

Response Format

All responses are returned in JSON format. Successful responses return a 2xx status code, while errors return 4xx or 5xx status codes with an error message.

Your API Key

Enter your API key to test the endpoints below. Get your API key from Settings.

Authentication

All API requests must include your API key in the request header:

X-API-Key: your_api_key_here

Example Request

curl -X POST https://ezilinks.com/api/urls \
  -H "X-API-Key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"originalUrl": "https://example.com"}'

Create Short URL

Create a new short URL. Custom aliases and password protection require a Pro plan.

POST /api/urls

Request Body

Parameter Type Required Description
originalUrl string Required The URL to shorten
customAlias string Optional Pro Custom short code (3-50 characters)
title string Optional Title for the URL
description string Optional Description for the URL
expiresAt string Optional Expiration date (ISO 8601 format)
password string Optional Pro Password to protect the link

Example Request

{
  "originalUrl": "https://example.com/very/long/url",
  "title": "My Example Link",
  "description": "This is a test link"
}

Example Response

{
  "id": 123,
  "shortCode": "abc123",
  "shortUrl": "https://ezilinks.com/abc123",
  "originalUrl": "https://example.com/very/long/url",
  "title": "My Example Link",
  "description": "This is a test link",
  "createdAt": "2024-01-01T12:00:00.000Z"
}

🚀 Try It Now

List URLs

Retrieve all short URLs for your account.

GET /api/urls

Example Response

[
  {
    "id": 123,
    "shortCode": "abc123",
    "originalUrl": "https://example.com",
    "title": "My Link",
    "clicks": 42,
    "createdAt": "2024-01-01T12:00:00.000Z"
  }
]

🚀 Try It Now

Update URL

Update an existing short URL's details.

PUT /api/urls/:id

Request Body

Parameter Type Description
title string New title for the URL
description string New description

Delete URL

Delete a short URL permanently.

DELETE /api/urls/:id

Example Response

{
  "message": "URL deleted successfully"
}

Get Analytics

Retrieve detailed analytics for a specific short URL. Requires Pro plan.

GET /api/urls/:id/analytics

Example Response

{
  "totalClicks": 156,
  "uniqueClicks": 98,
  "clicksByDate": [...],
  "clicksByCountry": [...],
  "clicksByDevice": [...]
}

Generate QR Code

Generate a QR code for a short URL.

GET /api/urls/:id/qrcode

Returns a PNG image of the QR code.

Error Codes

Status Code Description
200 Success
400 Bad Request - Invalid parameters
401 Unauthorized - Invalid or missing API key
403 Forbidden - Feature requires Pro plan
404 Not Found - Resource doesn't exist
429 Too Many Requests - Rate limit exceeded
500 Internal Server Error