URL Shortner

FREEMIUM
By Gautham Vijayan | Updated 2 months ago | Social
Health Check

N/A

Back to All Tutorials (2)

Creating Short URL with Litz

To create a short url with Litz API with axios use the following code

const createShortURL = async (shortURL) => {
const res = await axios.post(
https://url-shortner8.p.rapidapi.com/create-short-link”,
{ longURL: longURL },
{
headers: {
“X-RapidAPI-Key”: “yourkey”,
“X-RapidAPI-Host”: “url-shortner8.p.rapidapi.com”,
},
}
);

console.log(res.data.shortURL);
};

You can call this url to get the shortURL and you can share it across the internet.