API Documentation

Generate URL Example: GET https://xzx.ro/api?url=https://google.com&name=test600

This will generate a short link for the URL https://google.com with the custom name test600.

URL Parameters

If no url parameter is passed, the API will return a JSON object status with the value of fail.

If no name parameter is passed, a random string will be generated.

If the passed name parameter already exists, a random string will be generated.

Examples

Requesting the API using curl:


# curl --location --request GET 'https://xzx.ro/api?url=https://google.com&name=testing123'

Output:
{"status":"success","name":"testing123","url":"https://xzx.ro/testing123"}
        

Requesting the API using Axios within Node.JS:


        const axios = require('axios')

        axios.get('https://xzx.ro/api?url=https://google.com&name=testing123')
          .then(function (response) {
            console.log(response.data);
          })
          .catch(function (error) {
            console.log(error);
          })
        

Output:


{
    status: 'success',
    name: 'testing123',
    url: 'https://xzx.ro/testing123'
  }