You need an API key to make requests to our service.
Follow these steps to shorten URLs using our API.
Shorten a URL
{ "long": "https://quicklink.soorajrao.in", "custom": "mywebsiteurl" // optional }
long - Your long URL to be shortened
Custom (optional) - Custom backhalf for your URL( Only letters, numbers, hyphens, and underscores allowed )
https://sj1.xyz/api?size=15
size - Size refers to the number of characters in the link. By default, it is 10
{ "error": false, "message": "Short URL created", "data": { "short": "ju5whysf" } }
Track the number of clicks on your shortened URL.
{ "error": false, "message": "Click count retrieved", "data": { "shortUrl": "https://sj1.xyz/ju5whysf", "clicks": 2, "lastClicked": "25/08/2024, 11:48:20", "timestamp": [ "25/08/2024, 11:39:45", "25/08/2024, 11:48:20", ] } }
shortUrl - The shortened URL you want to track
clicks - Number of times the URL has been clicked
lastClicked - Timestamp of the last click
timestamp - The list of click timestamps
Retrieve all shortened URLs and their associated history for the API key provided.
{ "error": false, "message": "Success", "data": [ { "shortUrl": "https://sj1.xyz/bwvsjzvS", "longUrl": "https://example.com", "clickHistory": "No clicks yet" }, { "shortUrl": "https://sj1.xyz/lYScRgyv", "longUrl": "https://example2.com", "clickHistory": [ "26/08/2024, 19:15:05", "26/08/2024, 19:39:34" ] } ] }
shortUrl - The shortened URL
longUrl - The original long URL
clickHistory - A list of timestamp recording when the URL was accessed
curl -X POST https://sj1.xyz/api \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"long": "https://example.com/very-long-url-that-needs-shortening"}'