Shorten Single URL

Shortening of a single URL endpoint

/shorten/single

POST https://shrtnr.co/api/v1/shorten/single

This endpoint allows you to shorten a single long URL.

Headers

Name
Type
Description

Content-Type

string

Let the API know what type of content you are sending.

Accept

string

Let the API know what type of content you will accept..

Authentication

string

Authentication Bearer token to track who is making the request.

Request Body

Name
Type
Description

url

string

The long URL you want to shorten. Has to be a valid URL that starts with http or https. Max 2048 characters.

{
    "data": {
        "used": 1,
        "urls": {
            "https://www.example/very-long-url": "https://shrtnr.co/xAmPLe1"
        }
    },
    "message": "OK",
    "errors": null
}

Request Example

curl -X POST https://shrtnr.co/api/v1/shorten/single \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {ACCESS_TOKEN}' \
  -d '{
  "url": "https://www.example/very-long-url"
}'

Last updated

Was this helpful?