Getting link info
Get a long URL by domain name and a path of a short URL
The instructions below demonstrate how to get the information about a link: original URL, date of creation, domainID, mobile URLs, expiration, cloaking etc..
To get short link info
- Create a secret API key from the Integrations and API menu: https://app.short.io/settings/integrations/api-key
- Install prerequisites for requests (if necessary, depending on your programming language):
pip install requests
- Using the code snippet below, create a file: filename.py/ .js/ .rb
Please replace example.com , YOUR_PATH (the URL slug), APIKEY with the appropriate values.
import requests
url = "https://api.short.io/links/expand"
querystring = {"domain":"short.xyz","path":"first-blog-post"}
headers = {
'accept': "application/json",
'authorization': "<<apiKey>>"
}
response = requests.request("GET", url, headers=headers, params=querystring)
print(response.text)
const url = 'https://api.short.io/links/expand?domain=<<domain_name>>&path=YOUR_PATH';
const options = {
method: 'GET',
headers: {accept: 'application/json', Authorization: '<<apiKey>>'}
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.short.io/links/expand?domain=short.xyz&path=first-blog-post")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
request["authorization"] = '<<apiKey>>'
response = http.request(request)
puts response.read_body
- Launch the file:
python filename.py
node filename.js
ruby filename.rb
- Review the JSON response:
{
originalURL: 'YOUR_LONG_URL',
path: 'YOUR_PATH',
idString: 'LINK_ID',
id: 'LINK_ID',
shortURL: 'https://example.com/YOUR_PATH',
secureShortURL: 'https://example.com/YOUR_PATH',
cloaking: false,
title: 'LINK_TITLE',
tags: [],
createdAt: '2025-05-08T08:56:34.967Z',
skipQS: false,
archived: false,
DomainId: 115111,
OwnerId: 141117,
hasPassword: false
}
Updated 6 days ago