QuickLink

    API Documentation

    Get Your API Key

    You need an API key to make requests to our service.

    How to Use

    Follow these steps to shorten URLs using our API.

    1. Generate an API key (if you haven't already).
    2. Use the API key in the header of your requests.
    3. Send a POST request to our endpoint with the URL you want to shorten.
    4. Receive the shortened URL in the response.

    API Endpoints

    POST    /api

    Shorten a URL

    Request Body

    {
      "long": "https://quicklink.soorajrao.in",
      "custom": "mywebsiteurl" // optional
    }
    

    long - Your long URL to be shortened
    Custom (optional) - Custom backhalf for your URL( Only letters, numbers, hyphens, and underscores allowed )

    Query Params (optional)

    https://sj1.xyz/api?size=15

    size - Size refers to the number of characters in the link. By default, it is 10

    Response (sample)

    {
      "error": false,
      "message": "Short URL created",
      "data": {
        "short": "ju5whysf"
      }
    }

    GET    /api/count/[shortUrl]

    Track the number of clicks on your shortened URL.

    Response (sample)

    {
      "error": false,
      "message": "Click count retrieved",
      "data": {
        "shortUrl": "https://sj1.xyz/ju5whysf",
        "clicks": 2,
        "lastClicked": "25/08/2024, 11:48:20",
        "timestamp": [
          "25/08/2024, 11:39:45",
          "25/08/2024, 11:48:20",
        ]
      }
    }

    shortUrl - The shortened URL you want to track
    clicks - Number of times the URL has been clicked
    lastClicked - Timestamp of the last click
    timestamp - The list of click timestamps


    GET    /api/getall

    Retrieve all shortened URLs and their associated history for the API key provided.

    Response (sample)

    {
      "error": false,
      "message": "Success",
      "data": [
        {
          "shortUrl": "https://sj1.xyz/bwvsjzvS",
          "longUrl": "https://example.com",
          "clickHistory": "No clicks yet"
        },
        {
          "shortUrl": "https://sj1.xyz/lYScRgyv",
          "longUrl": "https://example2.com",
          "clickHistory": [
            "26/08/2024, 19:15:05",
            "26/08/2024, 19:39:34"
          ]
        }
      ]
    }
                  

    shortUrl - The shortened URL
    longUrl - The original long URL
    clickHistory - A list of timestamp recording when the URL was accessed

    Code Examples

    curl -X POST https://sj1.xyz/api \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{"long": "https://example.com/very-long-url-that-needs-shortening"}'

    Usage Conditions and Limitations

    • The API is free to use indefinitely. If you lose your API key, you can generate a new one at no cost.
    • URL length: Minimum 8 characters, maximum 32 characters.
    • Shortened URLs expire after 1 year of inactivity.
    • Already shortened URLs cannot be shortened again.
    • If you get any issue please report ithere