• Category: URL Shorteners

Shorten URLs with the API

The Goolnk API provides an easy way to shorten long URLs using a simple

request to
. However, it's important to follow a few guidelines when making requests to avoid errors. Long URLs must be properly URL-encoded, and can not contain spaces. All user input should also be stripped of any leading or trailing whitespace.

5 Benefits of Using Goolnk API for URL Shortening

  1. Saves space by shortening long links
  2. Easier to share short links on social media
  3. Improves the readability of URLs
  4. Provides tracking and analytics of shortened links
  5. Enhances user experience with faster load times

Example Code in JavaScript

fetch('', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ longUrl: '' }) }) .then(response => response.json()) .then(data => console.log(data));

Note: In this example, the

value is properly encoded so it can be successfully shortened by the API.

Similar APIs of URL Shorteners