Shorten Link
Shorten a long link
This API DOES NOT require authorization, which means using an anonymous account.
This API converts long URLs into short URLs.
If the same long URL has already been shortened in the same account, it will return the previously shortened URL.
Example #1: Shorten google.com
You can short google.com
by request API URL: https://api.u301.com/v2/shorten?url=https://google.com
,
even if visit the URL directly in the browser.
Example #2: Specify Domain
We assume you have already added your own domain go.example.com
, you can shorten your link by request API:
https://api.u301.com/v2/shorten?domain=go.example.com&url=https://google.com
Which specifies the domain in the query string, and that will override the default domain.
Example #3: Custom Alias
We’d like to create a shortened link u301.co/dashboard
which point to u301 dashboard.
Request with a parameter slug
:
https://api.u301.com/v2/shorten?url=https://u301.com/dashboard/&slug=dashboard
the returned result is
You can see the link in field shortened
is https://u301.co/dashboard
🎉
Query Parameters
The long URL to shorten. the URL MUST starts with a valid schema, such as http://
or https://
The title of the link
Domain that you want to use for the short link.
Custom alias for the short link, must be unique, only accept letter, number, underscore _
and hyphen -
.
Response
The short url code
The normalized original url
Status of the shortened url, it could be 'public', 'under_review' and 'blocked'
The shortened url