Shorten Your URLs with shrtlnk.dev API

Do you want to shorten your URLs and make them more manageable? Look no further than shrtlnk.dev API. With the API, you can integrate URL shortening features into your application, website or service.

Getting Started

To use shrtlnk.dev API, you will first need to sign up for an account and get an API key. Once you have your API key, you are ready to start shortening your URLs.

API Endpoints

The shrtlnk.dev API offers the following endpoints:

  1. /api/v1/shorten - Shorten a long URL
  2. /api/v1/expand - Expand a shortened URL

Example Code

1. Shorten a Long URL

const apiKey = 'YOUR_API_KEY';
const url = 'https://www.google.com';
const apiUrl = `https://www.shrtlnk.dev/api/v1/shorten?url=${encodeURIComponent(url)}&api_key=${apiKey}`;

fetch(apiUrl)
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.log(error));

2. Expand a Shortened URL

const apiKey = 'YOUR_API_KEY';
const shortUrl = 'https://shrtlnk.dev/gRgdG';
const apiUrl = `https://www.shrtlnk.dev/api/v1/expand?url=${encodeURIComponent(shortUrl)}&api_key=${apiKey}`;

fetch(apiUrl)
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.log(error));

Conclusion

Integrating shrtlnk.dev API into your application is simple and easy. Using the API, you can shorten your URLs and make them more manageable. So, if you want to shorten your URLs, sign up for a shrtlnk.dev API account today and get started.

Related APIs in URL Shorteners