Per sviluppatori

API per accorciare URL, server MCP ed estensione browser

Crea link brevi con l'API REST direttamente dal tuo codice, dai accesso agli assistenti IA tramite il nostro server MCP oppure accorcia qualsiasi scheda con un clic con l'estensione per Chrome e Firefox. Gratis e senza pubblicità, il riferimento completo è qui sotto.

Crea una chiave API

Serve un account gratuito: così teniamo lontano lo spam.

Creare un link breve con l'API
curl https://mkasl.com/api/v1/links \
  -H "Authorization: Bearer mkasl_…" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://tuo-sito.it/offerta"}'
Risposta (abbreviata)
{
  "id": 4182,
  "short_code": "k7m2qx",
  "original_url": "https://tuo-sito.it/offerta",
  "short_domain": null
}

API REST con chiave

L'API si trova su https://mkasl.com/api/v1 e richiede una chiave nell'header «Authorization: Bearer». La chiave la crei nella dashboard, alla voce Sviluppatori. Viene mostrata una sola volta e da noi è salvata solo come checksum.

Con la chiave crei, elenchi, modifichi e disattivi i link, richiami le statistiche di un link ed esporti tutti i link come CSV, JSON o file dei redirect. Ogni nuova destinazione viene controllata contro i siti dannosi prima della creazione, esattamente come nella dashboard.

  • Creare, leggere, modificare e disattivare i link
  • Statistiche per link da 24 ore a tutto il periodo
  • Esportazione come CSV, JSON o file dei redirect

Limiti per chiave

Nel piano gratuito sono possibili, per chiave e per ora, 20 nuovi link e 200 altre richieste; con Pro 1.000 e 6.000. Oltre, l'API risponde con stato 429 e indica nell'header «Retry-After» quando si può riprendere. Free consente una chiave, Pro fino a dieci.

Perché le chiavi non vengano usate per ondate di spam, ti serve un account con almeno sette giorni di anzianità e un indirizzo e-mail confermato.

Un flusso tipico

Un sistema di e-commerce, quando pubblica un prodotto, crea con l'API un link breve e lo stampa come QR code sull'etichetta. Se poi il prodotto viene tolto dal catalogo e la pagina non è più raggiungibile in modo permanente, un webhook segnala il link morto e il sistema può cambiare la destinazione con l'API verso una pagina sostitutiva.

Server MCP per assistenti IA

Su https://mkasl.com/api/v1/mcp è attivo un server MCP che usa la stessa chiave. Assistenti come Claude possono così creare link, elencare i tuoi link, richiamare le statistiche e controllare i link brevi prima di aprirli. I limiti sono gli stessi dell'API REST.

Webhook ed estensione

I webhook segnalano al tuo indirizzo i nuovi link, i link con destinazione morta, le destinazioni segnate come pericolose e il numero di clic orari, firmati con un checksum HMAC. Free consente tre webhook, Pro 50.

L'estensione browser per Chrome e Firefox accorcia la scheda aperta o un link con il tasto destro, mostra le statistiche nel popup e usa i tuoi modelli UTM.

Domande frequenti

Esiste un SDK ufficiale?
No. L'API è JSON essenziale su HTTPS, basta una chiamata con curl o fetch. Il riferimento qui sotto mostra tutti i campi.
Posso usare l'API anche se non ho un account?
No, ogni chiamata richiede una chiave di un account. Gli accorciamenti anonimi li abbiamo disattivati a causa dello spam.
I link creati con l'API contano per la quota giornaliera?
Sì. I link da API, MCP, estensione e dashboard contano insieme per la quota giornaliera del tuo account.

Crea una chiave e parti

Crea un account gratuito, genera una chiave API e accorcia il tuo primo link con il codice.

Crea una chiave API

Serve un account gratuito: così teniamo lontano lo spam.

Riferimento API (in inglese)

Con l'API e il server MCP crei link brevi dai tuoi programmi o dagli assistenti IA. La documentazione tecnica è in inglese.Gestisci le chiavi API

Base URL: https://mkasl.com/api/v1

Authentication

Create an API key in your account settings (accounts older than 7 days with a verified email address). The key is shown once; store it safely. Send it as:

Authorization: Bearer mkasl_XXXXXXXXXXXXXXXXXXXXXXXXXX

Keys can be named and revoked at any time. A key has the same rights as your own account for links, but never admin rights, and can’t manage keys or import CSV files.

Rate limits

Per key and clock hour, depending on the plan of the key’s owner (pricing):

Bucket Free Pro
Creating links (POST /links, MCP create_link) 20 1000
Everything else 200 6000

Until the new Free limits start (announced by mail at least 14 days ahead), Free keys keep 60 and 600.

Over the limit: 429 {"error":"rate_limit_exceeded"} with a Retry-After header (seconds). New links per account and UTC day (all ways, also the web app): Free 330 (50 in the first 7 days), Pro 10000; over that 429 {"error":"quota_exceeded"}.

Method Path Description
GET /links?q=&tag=&sort=newest|oldest|clicks|title Your active links
POST /links Create: {"url", "slug"?, "title"?, "tags"?, "slug_style"?: "random"|"readable"|"words", "analytics_mode"?, "forward_query"?, "is_printed"?, "domain_id"?}. domain_id: one of your active custom domains (GET /domains); the link object then has short_domain
GET /links/{id} One link
PUT /links/{id} Update (same fields; "active": false deactivates, "domain_id": 0 back to the default domain)
DELETE /links/{id} Deactivate
GET /links/{id}/analytics?period=24h|7d|30d|90d|all Aggregated statistics
GET /links/export?format=csv|json|redirects Export all your links
GET /preview/{code} Public transparency data of any link (no key needed)

Every destination is checked against URLhaus and Spamhaus DBL. Only http and https destinations are accepted.

Errors: {"error": "code", "message": "..."}. Common codes: invalid_url, destination_blocked (422), invalid_tags, not_found, unauthorized, rate_limit_exceeded.

Example:

curl -X POST https://mkasl.com/api/v1/links \
  -H "Authorization: Bearer $MKASL_KEY" -H "Content-Type: application/json" \
  -d '{"url":"https://example.org/article","tags":["blog"]}'

MCP server

MakeAShortLink speaks the Model Context Protocol (Streamable HTTP, JSON responses) at https://mkasl.com/api/v1/mcp, authenticated with your API key.

Tools: create_link, list_links, get_link_stats, preview_link.

Client configuration (example):

{
  "mcpServers": {
    "makeashortlink": {
      "type": "http",
      "url": "https://mkasl.com/api/v1/mcp",
      "headers": { "Authorization": "Bearer mkasl_..." }
    }
  }
}