
URL Shortener API
The T.LY URL Shortener API allows developers to create, manage, and track links. You can easily shorten a long URL and update it in the future. You can also retrieve click analytics for your short links. To start using the API, you first need to register an account, and then generate an API key.
Are you using Laravel? Check out our Laravel API Package for creating short urls.
Creating a Link
The first thing you need to do is create a link. To do this, you’ll need to make a POST request to the /link/shorten endpoint. The body of the request should include the following parameters:
–long_url: the long URL you want to shorten
–domain (optional): the domain you want to use for the shortened URL. We’ll use our default domain if you don’t specify a domain (https://t.ly).
Here’s an example request body:
{ "long_url": "https://www.google.com", "domain": "https://example.com" }
Managing Links
Once you’ve created a link, you can view information about that link by making a GET request to the /link endpoint, with the {short_url} as a parameter of the link you want to view information about. This endpoint will return information such as the date the link was created, the expiration date, QR code info, etc.
To view the stats about that link, make a GET request to the /link/stats endpoint, with the {short_url} as a parameter of the link you want to view the stats for. This endpoint will return information such as the number of clicks, unique clicks, and other additional analytics.
Finally, if you want to delete a link, you can make a DELETE request to the /link endpoint with the {short_url} in the request’s body. This endpoint will return information about the deleted link, including when it was deleted and how many clicks it had received up until that point.
The API documentation includes a playground and examples of how to use it in Javascript, Bash, Python, and PHP. Reach out to support if you need additional help implementing the API. We also offer a Postman Collection and OpenAPI Spec.
Tim Leland
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