An API key is essential for the system to process requests effectively.
You can obtain your API key by logging on to your dashboard on linke.to and clicking on "API".
It is crucial to include this API key with every request, as demonstrated in the comprehensive example below. Failure to provide or using an expired API key will result in an error. Please exercise caution and ensure the confidentiality of your API key to prevent any potential misuse.
In order to establish authentication with the API system, it is imperative to transmit your API key as an authorization token alongside every request. You can refer to the example code provided below for guidance.
curl --location --request POST 'https://api.linke.to/account' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.linke.to/account",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 20,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
));
$response = curl_exec($curl);
To maintain the stability of our API and prevent sudden surges in requests, we have implemented a daily rate limiter. Presently, the rate limit is set at 500 requests per day or 15,000 per month for each individual API key.
By default, all API responses are provided in JSON format. To make this data usable, you should utilize the corresponding function based on your programming language.
Example for PHP, you can employ the json_decode()
function to transform the data into either an object (which is the default behavior) or an array (by setting the second parameter to true). It's crucial to examine the "error" key, as it offers insights into whether an error occurred or not. Additionally, you can inspect the header code for further information.
{
"message": "Ok",
"short_link":"https://linke.to/test",
"domain":"linke.to",
"name":"test"
}
To access details about your account, simply send a request to this endpoint, and it will promptly furnish you with the relevant account information.
curl --location --request GET 'https://api.linke.to/account' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.linke.to/account",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"message":"Ok",
"email":"[email protected]",
"phone":"5555555555",
"registration_date":"2021-07-11",
"status":"pro",
"domain_number":21,
"short_links":92,
"bio_pages":43,
"total_hits":2885
}
To obtain a list of your domains, simply send a request to this access point, which will return a list of your domains.
curl --location --request GET 'https://api.linke.to/domains?page=1' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.linke.to/domains?page=1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"message":"Ok",
"data":[
{"domain":"domain.co","redirection_url_error":"https://error.domain.co/404","favicon":null},
{"domain":"subnm.linke.to","redirection_url_error":null,"favicon":"https://www.cdnly.org/9855-1651663634.ico"},
{"domain":"hi.dom.to","redirection_url_error":null,"favicon":null}
]
}
To obtain a list of your short links, simply send a request to this access point, which will return a list of your short links.
curl --location --request GET 'https://api.linke.to/shorts?page=1&domain=mydomain.com&folder=foldername&inpage=linke.to/pagename' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.linke.to/shorts?page=1&domain=mydomain.com&folder=foldername&inpage=linke.to/pagename",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"message":"Ok",
"data":[
{
"short_link":"https://linke.to/test",
"original_link":"https://linke.to/longlink.html",
"domain":"linke.to",
"name":"test",
"title":"All in one URL shortener",
"image":"https://www.cdnly.org/89755-16575557761.png",
"creation_time":"2022-07-11 16:09",
"scheduled_date":null,
"expiration_date":null,
"total_hits":"20"
}
]
}
To shorten a link, send the long URL to this endpoint with the desired parameters to obtain a shortened link.
curl --location --request PUT 'https://api.linke.to/shorts/add' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"url":"https:\/\/www.youtube.com/watch?v=PwILkY9gRrc",
"domain":"linke.to",
"name":"testFUNK",
"title":"my short link",
"folder":"foldername",
"schedule_date":"2024-01-01 12:00",
"expire_date":"2024-01-08 12:00",
"password":"123456789"
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.linke.to/shorts/add",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
CURLOPT_POSTFIELDS => json_encode(array (
"url"=>"https://www.youtube.com/watch?v=PwILkY9gRrc",
"domain"=>"linke.to",
"name"=>"testFUNK",
"title"=>"my short link",
"folder"=>"foldername",
"schedule_date"=>"2024-01-01 12:00",
"expire_date"=>"2024-01-08 12:00",
"password"=>"123456789"
)),
));
$response = curl_exec($curl);
echo $response;
{
"message":"Ok",
"data":
{
"short_link":"https://linke.to/testFUNK",
"original_link":"https://www.youtube.com/watch?v=PwILkY9gRrc",
"domain":"linke.to",
"name":"testFUNK",
"title":"my short link",
"image":null,
"creation_time":"2023-09-12 11:09",
"schedule_date":"2024-01-01 12:00",
"expiration_date":"2024-01-08 12:00",
"total_hits":0
}
}
To update a shortened link, send a request with the parameters to be modified.
curl --location --request PUT 'https://api.linke.to/shorts/update' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"shortlink":"https:\/\/linke.to\/myshort"
"url":"https:\/\/www.youtube.com/watch?v=PwILkY9gRrc",
"title":"my new title",
"schedule_date":"2024-01-01 12:00",
"expire_date":"2024-01-08 12:00",
"password":"123456789"
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.linke.to/shorts/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
CURLOPT_POSTFIELDS => json_encode(array (
"shortlink"=>"https://linke.to/testFUNK",
"url"=>"https://www.youtube.com/watch?v=L93-7vRfxNs",
"title"=>"my new title",
"schedule_date"=>0,
"expire_date"=>"2024-01-08 12:00",
"password"=>""
)),
));
$response = curl_exec($curl);
echo $response;
{
"message": "Ok",
"status": "Short link updated"
}
To delete a shortcut link, send the link's URL to this endpoint.
curl --location --request PUT 'https://api.linke.to/delete' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"link":"https:\/\/linke.to\/Kuz7z"
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.linke.to/delete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
CURLOPT_POSTFIELDS => json_encode(array (
"link"=>"https://linke.to/Kuz7z",
)),
));
$response = curl_exec($curl);
echo $response;
{
"message": "Ok",
"status": "Deleted successfully"
}
To obtain information and basic analytics of a short link, send a request with the address of the short link to this endpoint.
curl --location --request GET 'https://api.linke.to/view?link=https://linke.to/KneO5a' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.linke.to/view?link=https://linke.to/KneO5a",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
)
));
$response = curl_exec($curl);
echo $response;
{
"message":"Ok",
"data":
{
"url":"https://linke.to\/linke",
"title":"Bio and Short link that alert you when your link buzz & more"
..
}
}
To obtain a list of your bio links, simply send a request to this access point, which will return a list of your bio links.
curl --location --request GET 'https://api.linke.to/bios?page=1&domain=mydomain.com&folder=foldername' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.linke.to/bios?page=1&domain=mydomain.com&folder=foldername",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"message":"Ok",
"data":[
{
"bio_link":"https://linke.to/test",
"domain":"linke.to",
"name":"test",
"title":"All in one URL shortener",
"description":"Hello !",
"image":"https://www.cdnly.org/89755-16575557761.png",
"creation_time":"2022-07-11 16:09",
"scheduled_date":null,
"expiration_date":null,
"total_hits":"20"
}
]
}
To create a bio page , send the request to this endpoint with the desired parameters to obtain a bio link.
curl --location --request PUT 'https://api.linke.to/bios/add' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"name":"mybiopage",
"domain":"linke.to",
"title":"my bio link",
"description":"Hello",
"backgroundcolor":"EEEEEE",
"textcolor":"0000FF",
"display":1,
"font":3,
"copystylefrom":"https://linke.to/refpage"
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.linke.to/bios/add",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
CURLOPT_POSTFIELDS => json_encode(array (
"name"=>"mybiopage",
"domain"=>"linke.to",
"title"=>"my bio link",
"description"=>"Hello !",
"backgroundcolor"=>"EEEEEE",
"textcolor"=>"0000FF",
"display"=>1,
"font"=>3,
"copystylefrom"=>"https://linke.to/refpage"
)),
));
$response = curl_exec($curl);
echo $response;
{
"message":"Ok",
"data":
{
"bio_link":"https://linke.to/testFUNK",
"original_link":"https://www.youtube.com/watch?v=PwILkY9gRrc",
"domain":"linke.to",
"name":"testFUNK",
"title":"my short link",
"image":null,
"creation_time":"2023-09-12 11:09",
"schedule_date":"2024-01-01 12:00",
"expiration_date":"2024-01-08 12:00",
"total_hits":0
}
}
To update a bio page , send the request to this endpoint with the desired parameters.
curl --location --request PUT 'https://api.linke.to/bios/update' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"biolink":"https://linke.to/bioname",
"title":"my bio link",
"description":"Hello",
"backgroundcolor":"EEEEEE",
"textcolor":"0000FF",
"display":1,
"font":3,
"copystylefrom":"https://linke.to/refpage"
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.linke.to/bios/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
CURLOPT_POSTFIELDS => json_encode(array (
"biolink"=>"https://linke.to/bioname",
"title"=>"my bio link",
"description"=>"Hello !",
"backgroundcolor"=>"EEEEEE",
"textcolor"=>"0000FF",
"display"=>1,
"font"=>3,
"copystylefrom"=>"https://linke.to/refpage"
)),
));
$response = curl_exec($curl);
echo $response;
{
"message":"Ok",
"status":"bio link updated"
}
To delete a bio link, send the bio link's URL to this endpoint.
curl --location --request PUT 'https://api.linke.to/delete' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"link":"https:\/\/linke.to\/pagename"
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.linke.to/delete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
CURLOPT_POSTFIELDS => json_encode(array (
"link"=>"https://linke.to/pagename",
)),
));
$response = curl_exec($curl);
echo $response;
{
"message": "Ok",
"status": "Deleted successfully"
}
To add a link block inside a bio page, send the long URL to this endpoint with the desired parameters to add it to a bio link.
curl --location --request PUT 'https://api.linke.to/shorts/add' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"inpage":"https:\/\/linke.to\/mypage",
"url":"https:\/\/www.youtube.com/watch?v=PwILkY9gRrc",
"name":"testFUNK",
"title":"my short link",
"schedule_date":"2024-01-01 12:00",
"expire_date":"2024-01-08 12:00",
"password":"123456789"
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.linke.to/shorts/add",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
CURLOPT_POSTFIELDS => json_encode(array (
"inpage"=>"https://linke.to/mypage",
"url"=>"https://www.youtube.com/watch?v=PwILkY9gRrc",
"name"=>"testlink",
"title"=>"my short link",
"schedule_date"=>"2024-01-01 12:00",
"expire_date"=>"2024-01-08 12:00",
"password"=>"123456789"
)),
));
$response = curl_exec($curl);
echo $response;
{
"message":"Ok",
"data":
{
"short_link":"https://linke.to/testlink",
"original_link":"https://www.youtube.com/watch?v=PwILkY9gRrc",
"domain":"linke.to",
"name":"testFUNK",
"title":"my short link",
"image":null,
"creation_time":"2023-09-12 11:09",
"schedule_date":"2024-01-01 12:00",
"expiration_date":"2024-01-08 12:00",
"total_hits":0
}
}
To obtain information and basic analytics of a bio link, send a request with the address of the bio link to this endpoint.
curl --location --request GET 'https://api.linke.to/view?link=https://linke.to/pagename' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.linke.to/view?link=https://linke.to/pagename",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
)
));
$response = curl_exec($curl);
echo $response;
{
"message":"Ok",
"data":
{
"url":"https://linke.to\/pagename",
"title":"My page.."
..
}
}