Docs menu

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.

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:

Text
https://siz.la/api

First check that the key works. This returns the account it belongs to:

Shell
curl "https://siz.la/api/account" \
  -H "Authorization: Bearer $SIZLA_API_KEY"
JavaScript
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);
Python
import os
import requests

response = requests.get(
    "https://siz.la/api/account",
    headers={"Authorization": f"Bearer {os.environ['SIZLA_API_KEY']}"},
)
print(response.json())
PHP
$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:

Shell
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"}'
JavaScript
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);
Python
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())
PHP
$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:

JSON
{
  "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:

Shell
curl "https://siz.la/api/url/1042" \
  -H "Authorization: Bearer $SIZLA_API_KEY"
JavaScript
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);
Python
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())
PHP
$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/json with a body.
  • Every answer has error: 0 when it worked, 1 with a message when 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

StartQuick startShorten links, read stats and record conversions from your own code with the siz.la REST API, webhooks and an MCP connector for AI assistants.StartAuthenticationHow to make an API key, send it with each request and keep it safe.REST APILinksCreate, list, read, change and delete short links with the siz.la REST API, with cURL, JavaScript, Python and PHP examples.REST APICampaignsMake, list, change and delete campaigns, put links in them and read the clicks of a whole campaign with the siz.la REST API.REST APIDomainsAdd your own domain, read the DNS records to set, check it and set where the bare domain leads with the siz.la REST API.REST APIPixelsAdd, list, change and delete Meta, Google, TikTok, LinkedIn, Pinterest, X, Snapchat, Microsoft, Reddit and Quora pixels, then fire them on links, with the siz.la REST API.REST APIQR codesMake, list, change and delete QR codes for links, contact cards, Wi-Fi and more, and read their scans, with the siz.la REST API.REST APIOverlaysList the call-to-action messages on your account so you can show one over the page a link opens.REST APIChannelsMake, list, change and delete channels, and put links, QR codes and bio pages in them, with the siz.la REST API.REST APISplash pagesMake, list, change and delete splash pages, then show one for a few seconds before a short link opens, with the siz.la REST API.REST APIAccountRead the account behind an API key and change its email or password.REST APIClick exportDownload every click on your links, with country, device, referrer and UTM fields, as CSV or JSON lines.REST APIConversionsCount sign-ups and sales against the click that brought the visitor, from your server or with the sz.js browser snippet.EventsWebhooksGet a signed message at your own address when a link is made, changed or clicked and when a conversion comes in.EventsIntegrationsStart automations from clicks, QR code scans, new links and email sign-ups, make links from Zapier, Make or n8n, and send sign-ups to Mailchimp or Slack.AI assistantsAI assistant connectorConnect Claude, ChatGPT, Cursor, VS Code or any MCP client to siz.la to make links and QR codes and read stats by asking.ReferenceErrors and rate limitsThe error format, every status the API sends, and how many requests each plan can make a minute.

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.