URL Shortener API
The T.LY URL Shortener API allows developers to create, manage, and track links. You can shorten a long URL, update it later, and retrieve analytics for your short links. To get started, register an account and generate an API key. If you want the support-center version with SDK links and setup notes, see API basics & SDKs.
Official SDKs
If you prefer using a package instead of making raw HTTP requests, T.LY offers official SDKs for several popular stacks:
Each SDK uses the same T.LY API token, so you can switch languages or services without learning a different API model.
Creating a link
To create a link, make a POST request to the /link/shorten endpoint. The request body supports:
long_url: the URL you want to shortendomain: optional custom domain to use for the short link
Example request body:
{
"long_url": "https://www.google.com",
"domain": "https://example.com"
}
Managing links
Once a link has been created, you can retrieve information about it with the /link endpoint using the {short_url} value.
To view analytics, use the /link/stats endpoint. This returns details such as total clicks, unique clicks, and related analytics data.
If you want to remove a link, send a DELETE request to the /link endpoint with the {short_url} in the request body.
The API documentation includes a playground and examples for JavaScript, Bash, Python, and PHP. We also provide a Postman Collection and OpenAPI spec. If you need help, contact [email protected].
Related Posts
Tim Leland
Useful Tools
Ready to improve how you manage links?
T.LY URL Shortener makes long links look cleaner and easier to share! Add your own Custom Domains to personalize your brand. Create Smart Links to customize a URL's destination. Generate QR codes to promote your business.
Sign Up for Free
