Retrieve aggregated visit statistics
curl --request GET \
--url https://ishortn.ink/api/v1/analytics/{alias} \
--header 'x-api-key: <api-key>'import requests
url = "https://ishortn.ink/api/v1/analytics/{alias}"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://ishortn.ink/api/v1/analytics/{alias}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://ishortn.ink/api/v1/analytics/{alias}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://ishortn.ink/api/v1/analytics/{alias}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://ishortn.ink/api/v1/analytics/{alias}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://ishortn.ink/api/v1/analytics/{alias}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"clicksPerDate": {
"2024-07-01": 150,
"2024-07-02": 200
},
"clicksPerCountry": {
"US": 300,
"CA": 50
},
"clicksPerCity": {
"New York": 100,
"Los Angeles": 150
},
"clicksPerDevice": {
"Desktop": 250,
"Mobile": 100
},
"clicksPerOS": {
"Windows": 200,
"iOS": 100,
"Android": 50
},
"clicksPerBrowser": {
"Chrome": 150,
"Firefox": 100,
"Safari": 50
},
"clicksPerModel": {
"iPhone 12": 50,
"Galaxy S21": 30
}
}"<string>""Invalid or missing API key""Link not found"Endpoint Examples
Retrieve analytics for a link
Retrieves aggregated visit statistics for a shortened link using its alias.
GET
/
analytics
/
{alias}
Retrieve aggregated visit statistics
curl --request GET \
--url https://ishortn.ink/api/v1/analytics/{alias} \
--header 'x-api-key: <api-key>'import requests
url = "https://ishortn.ink/api/v1/analytics/{alias}"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://ishortn.ink/api/v1/analytics/{alias}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://ishortn.ink/api/v1/analytics/{alias}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://ishortn.ink/api/v1/analytics/{alias}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://ishortn.ink/api/v1/analytics/{alias}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://ishortn.ink/api/v1/analytics/{alias}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"clicksPerDate": {
"2024-07-01": 150,
"2024-07-02": 200
},
"clicksPerCountry": {
"US": 300,
"CA": 50
},
"clicksPerCity": {
"New York": 100,
"Los Angeles": 150
},
"clicksPerDevice": {
"Desktop": 250,
"Mobile": 100
},
"clicksPerOS": {
"Windows": 200,
"iOS": 100,
"Android": 50
},
"clicksPerBrowser": {
"Chrome": 150,
"Firefox": 100,
"Safari": 50
},
"clicksPerModel": {
"iPhone 12": 50,
"Galaxy S21": 30
}
}"<string>""Invalid or missing API key""Link not found"Authorizations
Path Parameters
The alias of the shortened link.
Response
Aggregated visit statistics retrieved successfully
Number of clicks per date.
Show child attributes
Show child attributes
Number of clicks per country.
Show child attributes
Show child attributes
Number of clicks per city.
Show child attributes
Show child attributes
Number of clicks per device.
Show child attributes
Show child attributes
Number of clicks per operating system.
Show child attributes
Show child attributes
Number of clicks per browser.
Show child attributes
Show child attributes
Number of clicks per device model.
Show child attributes
Show child attributes
⌘I