You can click through a dashboard to shorten a link, or you can do it from a script. This tutorial covers the script route with the Elido SDKs for TypeScript, Python and Go, then the assistant route: an MCP server that lets Claude Desktop or Cursor create links and read stats for you.

We ran every snippet below against the live API on a fresh free account, using the published packages (@elido/sdk 0.1.1, elido-sdk 0.1.0, elido-go v0.1.1, @elido/mcp-server 0.1.1). The outputs shown are the real ones from that run; swap in your own key and ids.

What you need

  • A free Elido account. The free plan has 25 links and 500 tracked clicks a month (pricing).
  • An API key from the dashboard (API keys section). Keys start with elido_.
  • A workspace id. Every link call is scoped to one. The SDKs can list the workspaces your key sees, so you don't have to dig it out of the UI.
  • A domain id. A link has to live on a domain. The TypeScript SDK can fetch your workspace's primary redirect domain, which is a verified custom domain if you attached one, or the shared domain for your plan otherwise.

The API keys page in the Elido dashboard: one key named tutorial-demo, shown only by its prefix

The API base is https://api.elido.app and auth is Authorization: Bearer <key>. The SDKs set that for you. Put the key in an environment variable, not in source:

export ELIDO_API_KEY="elido_..." 

TypeScript

npm install @elido/sdk 

The snippets use top-level await, so run them as ES modules: name the file .mjs/.mts, or set "type": "module" in package.json. Under CommonJS, tsx stops with ERR_REQUIRE_ASYNC_MODULE.

Start by finding your ids:

import { ElidoApi } from "@elido/sdk"; const sdk = new ElidoApi({ baseUrl: "https://api.elido.app", token: process.env.ELIDO_API_KEY!, }); const { items } = await sdk.workspaces.list(); const workspaceId = items[0].id; const domain = await sdk.workspaceDomains.primary(workspaceId); console.log(workspaceId, domain.id); // 74 1 (a fresh free workspace gets the shared domain f.elido.me) 

Create a link. domain_id and destination_url are what the README example passes; slug, title and tags are optional:

const link = await sdk.links.create(workspaceId, { domain_id: domain.id, destination_url: "https://example.com/landing", slug: "spring-sale", tags: ["spring-2026"], }); console.log(link.slug); 

Every POST gets an Idempotency-Key header automatically. If you run this from a cron job and want retries to be safe, pass your own stable key as the third argument:

await sdk.links.create(workspaceId, input, { idempotencyKey: "job-2026-11-18" }); 

List links, filtered by tag if you like:

const page = await sdk.links.list(workspaceId, { limit: 20, tags: ["spring-2026"] }); for (const l of page.items) console.log(l.id, l.slug, l.destination_url); 

In the dashboard, the same links show up with their tag and click counts:

The Links page listing six short links on f.elido.me tagged spring-2026, with 30-day click counts

To walk everything, links.iterate pages for you:

for await (const l of sdk.links.iterate(workspaceId)) { console.log(l.slug); } 

Click stats come from analytics. Dates are YYYY-MM-DD. from is inclusive and to is exclusive, so to include today, pass tomorrow's date. linkId narrows the series to one link. A link you created a minute ago has no clicks yet, so the output below is from a demo link that already had five:

const series = await sdk.analytics.timeseries(workspaceId, { from: "2026-11-01", to: "2026-11-19", interval: "day", linkId: link.id, }); console.log(series.items); // [ { ts: '2026-11-18T00:00:00Z', count: 5 } ] 

Days without clicks are left out of items, so fill the gaps yourself if you chart it.

There are also breakdowns such as analytics.byCountry, byDevice and byReferrer, plus analytics.topLinks for a ranking. On the demo workspace, after a handful of test clicks:

const top = await sdk.analytics.topLinks(workspaceId, { from: "2026-11-01", to: "2026-11-19" }); console.log(top.items.slice(0, 2)); // [ { link_id: 592, slug: 'newsletter-nov-wi35', count: 5 }, // { link_id: 593, slug: 'podcast-ep12-wi35', count: 4 } ] const devices = await sdk.analytics.byDevice(workspaceId, { from: "2026-11-01", to: "2026-11-19" }); console.log(devices.items); // [ { key: 'desktop', count: 14 } ] 

Python

pip install elido-sdk 

The package is elido-sdk and the import is elido.

import os from elido import Client elido = Client(base_url="https://api.elido.app", token=os.environ["ELIDO_API_KEY"]) workspace_id = elido.workspaces.list()["items"][0]["id"] link = elido.links.create( workspace_id, domain_id=1, # your domain id destination_url="https://example.com/landing", tags=["spring-2026"], ) print(link["slug"]) # 1nxR0z page = elido.links.list(workspace_id, limit=20) for row in page["items"]: print(row["id"], row["slug"]) series = elido.analytics.timeseries( workspace_id, from_="2026-11-01", to="2026-11-19", interval="day", link_id=link["id"] ) print(series) # {'items': [{'ts': '2026-11-18T00:00:00Z', 'count': 5}]} 

Note from_ with the trailing underscore, because from is a Python keyword. Results are plain dicts. The Python client has no domain lookup, so grab the domain id with the TypeScript snippet above or from the dashboard.

Go

go get github.com/elidoapp/elido-go@latest 
c, err := elido.New(elido.Options{ BaseURL: "https://api.elido.app", Token: os.Getenv("ELIDO_API_KEY"), }) if err != nil { log.Fatal(err) } defer c.Close() ctx := context.Background() domains, err := c.Domains.List(ctx, 42) // 42 = your workspace id // ... link, err := c.Links.Create(ctx, 42, elido.CreateLinkInput{ DomainID: domains.Items[0].ID, DestinationURL: "https://example.com/landing", Tags: []string{"spring-2026"}, }) if err != nil { log.Fatal(err) } fmt.Println(link.Slug) // na9pN ts, err := c.Analytics.Timeseries(ctx, 42, elido.TimeseriesOptions{ From: "2026-11-01", To: "2026-11-19", Interval: "day", LinkID: link.ID, }) if err != nil { log.Fatal(err) } for _, p := range ts.Points { fmt.Println(p.TS, p.Count) } // 2026-11-18T00:00:00Z 5 

Import path is github.com/elidoapp/elido-go/elido. One catch: Domains.List returns only custom domains, so on a fresh workspace with none attached the list is empty. Use a domain id from the dashboard in that case. Use v0.1.1 or later; in v0.1.0 Timeseries always came back empty.

QR codes

The SDKs don't have a "generate a QR image" method. What the TypeScript SDK has is links.getQRDesign, saveQRDesign and deleteQRDesign, which store the styling for a link's QR code. To get the image itself from code, use the MCP server's generate_qr tool, covered next, or the QR page in the dashboard.

Letting an AI assistant do it

The MCP server exposes the same operations as tools. For Claude Desktop, edit claude_desktop_config.json (on macOS it lives in ~/Library/Application Support/Claude/):

{ "mcpServers": { "elido": { "command": "npx", "args": ["-y", "@elido/mcp-server"], "env": { "ELIDO_API_KEY": "elido_...", "ELIDO_WORKSPACE_ID": "42" } } } } 

ELIDO_API_KEY is required. ELIDO_WORKSPACE_ID is optional: if you leave it out, the server uses the only workspace your key can see, so set it when the key has more than one. ELIDO_API_BASE overrides the API host and defaults to https://api.elido.app. Cursor takes the same block in .cursor/mcp.json. Restart the client and the tools appear.

There are five tools: create_link, list_links, query_analytics, generate_qr and list_workspaces. Three prompts and what they map to:

  1. "Shorten https://example.com/pricing with the slug pricing-q4 and tag it q4." Claude calls create_link with destination_url, slug and tags. If it passes no domain_id, the server takes the first domain from the workspace's domain list, and errors out asking for an explicit domain_id when that list is empty.
  2. "Show clicks per day for the last two weeks in Europe/Berlin time." This is query_analytics with from, to, interval: "day" and tz. Pass a link_id to look at a single link.
  3. "Make a 512px PNG QR code for link 118." That is generate_qr with link_id, format: "png" and size: 512. Use "list my last 10 links" first if you don't know the id; that is list_links.

If a prompt misfires, look at which tool Claude actually called before blaming the model.

Errors you will hit

The TypeScript SDK throws ElidoApiError with status and body. Python raises ElidoApiError (with status, body, message) for non-2xx responses and ElidoError for transport failures. Go returns *elido.APIError with Status, Message and Body; check it with errors.As.

import { ElidoApiError } from "@elido/sdk"; try { await sdk.links.create(workspaceId, input); } catch (err) { if (err instanceof ElidoApiError && err.status === 409) { // pick another slug } else { throw err; } } 

Branch on the HTTP status, not on a code string. Today the body carries only a human-readable message; reusing a slug on the same domain returned exactly this in all three SDKs:

409 {"error": "slug already exists for this domain"} 

A 400 means the input failed validation; log the error message, it says which field. On a 429, back off before retrying, and honour Retry-After when the response includes it.

In the MCP server, a missing ELIDO_API_KEY prints a warning at start and every tool call then fails, so check that first if nothing works.

Where to go next

Full reference is at elido.app/docs. The SDKs are MIT licensed: elido-js, elido-python, elido-go, and the MCP server.

Elido is a hosted link shortener with custom domains, QR codes and click analytics, built EU-first: elido.app.