URL Shortener API

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.

T.LY API Docs on the t.ly domain showing authenticated documentation, endpoint sections, code language tabs, and the Tim Leland profile.

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 shorten
  • domain: 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].


Author Tim Leland

Tim Leland

Tim Leland brings over 20 years of software development experience to the table, creating products used by millions around the globe. He founded T.LY with a vision to build the world’s shortest URL shortener—and since then, the platform’s popularity has soared. Under Tim’s leadership, T.LY has evolved into a top-tier solution recognized for its reliability and ease of use, now serving millions of satisfied users worldwide.

Editorial Policy

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
About T.LY
T.LY is the best link management service to track, brand, and share short URLs, QR codes, and OneLinks. Install our free Browser Extension with over 450,000 users from the extension store to automatically shorten links in one easy click! We support Chrome, Firefox, Edge and Opera.