siz.la developer docs
Shorten links, read stats and record conversions from your own code with the siz.la REST API, webhooks and an MCP connector for AI assistants.
siz.la makes short links, QR codes and link-in-bio pages, and counts every click. Whatever you can do in the members area you can do from your own code with the REST API, hear about it as it happens with webhooks, or ask an AI assistant to do it with the connector.
Your first short link
You need a siz.la account and an API key. Make the key under Settings, then Developers. It is shown once, so copy it and keep it in an environment variable called SIZLA_API_KEY.
Every call goes to one base address, over HTTPS:
https://siz.la/api
First check that the key works. This returns the account it belongs to:
curl "https://siz.la/api/account" \
-H "Authorization: Bearer $SIZLA_API_KEY"const response = await fetch("https://siz.la/api/account", {
headers: {
Authorization: `Bearer ${process.env.SIZLA_API_KEY}`,
},
});
const data = await response.json();
console.log(data);import os
import requests
response = requests.get(
"https://siz.la/api/account",
headers={"Authorization": f"Bearer {os.environ['SIZLA_API_KEY']}"},
)
print(response.json())$ch = curl_init('https://siz.la/api/account');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('SIZLA_API_KEY'),
],
]);
$data = json_decode(curl_exec($ch), true);Then shorten a link:
curl -X POST "https://siz.la/api/url/add" \
-H "Authorization: Bearer $SIZLA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com/a/long/address","custom":"lunch-menu"}'const response = await fetch("https://siz.la/api/url/add", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SIZLA_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"url": "https://example.com/a/long/address",
"custom": "lunch-menu"
}),
});
const data = await response.json();
console.log(data);import os
import requests
response = requests.post(
"https://siz.la/api/url/add",
headers={"Authorization": f"Bearer {os.environ['SIZLA_API_KEY']}"},
json={
"url": "https://example.com/a/long/address",
"custom": "lunch-menu",
},
)
print(response.json())$ch = curl_init('https://siz.la/api/url/add');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('SIZLA_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'url' => 'https://example.com/a/long/address',
'custom' => 'lunch-menu',
]),
]);
$data = json_decode(curl_exec($ch), true);The answer has the short address and the link's id:
{
"error": 0,
"id": 1042,
"shorturl": "https://siz.la/lunch-menu"
}
Open the short address and you are sent to the long one. The click is counted. Read the link back with its id to see how it is doing:
curl "https://siz.la/api/url/1042" \
-H "Authorization: Bearer $SIZLA_API_KEY"const response = await fetch("https://siz.la/api/url/1042", {
headers: {
Authorization: `Bearer ${process.env.SIZLA_API_KEY}`,
},
});
const data = await response.json();
console.log(data);import os
import requests
response = requests.get(
"https://siz.la/api/url/1042",
headers={"Authorization": f"Bearer {os.environ['SIZLA_API_KEY']}"},
)
print(response.json())$ch = curl_init('https://siz.la/api/url/1042');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('SIZLA_API_KEY'),
],
]);
$data = json_decode(curl_exec($ch), true);How it works
- Requests and answers are JSON. Send
Content-Type: application/jsonwith a body. - Every answer has
error:0when it worked,1with amessagewhen it did not. See (https://siz.la/docs/errors). - Each plan allows a number of requests a minute. See (https://siz.la/docs/errors).
- A key acts as the account it belongs to. It can see and change that account's links and nothing else.
Machine-readable description
The whole API is described in an OpenAPI 3.1 file at https://siz.la/openapi.json. Import it into Postman, Insomnia or a code generator. The same file, the examples and these pages are kept in the public repository at https://github.com/NeoReader/sizla-docs.
Where to go next
Questions
Does siz.la have an API?
Yes. The REST API makes, reads, changes and deletes short links, exports clicks and records conversions. Every plan, including the free one, has API access.
How do I get a siz.la API key?
Sign in, open Settings, then Developers, and choose Make a key. The key is shown once. Send it as a bearer token in the Authorization header.
Is there an OpenAPI file for siz.la?
Yes. The OpenAPI 3.1 description is at https://siz.la/openapi.json and can be imported into Postman, Insomnia or a code generator.