meshalive
Blog→Developer
Developer · 8 min read

Free URL Shortener API — Shorten Links Programmatically

The Meshalive REST API lets you shorten URLs from any application, automation, or script. The public endpoint requires no API key. Authenticated endpoints unlock custom slugs, analytics, and no click limits.

Updated June 2026 · By Meshalive team · Full API docs →
⚡ Instant Free Tool

Test the URL Shortener Engine Live

Powered by Meshalive v1 API
Free — No signup required

Anonymous links expire after 7 days and are limited to 20 clicks. Sign up free for unlimited links with full analytics.

API overview
Base URL:https://api.meshalive.com/v1
Auth:Bearer token (optional for public endpoint)
Rate limit (no auth):20 req/min per IP
Rate limit (authenticated):300 req/min
Public endpoint click limit:20 clicks per link
Authenticated click limit:Unlimited
Response format:JSON
API access:100% Free Forever

1. Public endpoint — no API key required

POST to https://api.meshalive.com/v1/shorten with a JSON body containing the URL to shorten. No account or API key is needed.

Request
curl -X POST https://api.meshalive.com/v1/shorten \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com/very/long/path?with=params"}'
Response
{
  "slug": "abc123",
  "short_url": "https://msha.live/abc123",
  "click_limit": 20
}
Public endpoint limits: Links created without authentication have a 20-click limit and are not saved to any account. For unlimited clicks and saved links with analytics, use the authenticated endpoint.

2. Authenticated endpoint — unlimited clicks

Create a free account, then go to Dashboard → Settings → API Tokens to generate a token. Pass it in the Authorization header.

Create a short link with custom slug
curl -X POST https://api.meshalive.com/v1/links \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
    "destination": "https://example.com/page",
    "slug": "my-campaign",
    "title": "Summer Campaign 2026"
  }'
Get analytics for a link
curl https://api.meshalive.com/v1/links/my-campaign/analytics \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Code examples

JavaScript / Node.js

// Public endpoint (no auth, 20-click limit)
const res = await fetch('https://api.meshalive.com/v1/shorten', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ url: 'https://example.com/long-path' }),
});
const { slug, short_url } = await res.json();
console.log(short_url); // https://msha.live/abc123

// Authenticated (unlimited clicks, custom slug)
const res2 = await fetch('https://api.meshalive.com/v1/links', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer YOUR_API_TOKEN',
  },
  body: JSON.stringify({
    destination: 'https://example.com/long-path',
    slug: 'my-link',
    title: 'My link title',
  }),
});
const link = await res2.json();
console.log(link.short_url);

Python

import requests

# Public endpoint
resp = requests.post(
    "https://api.meshalive.com/v1/shorten",
    json={"url": "https://example.com/long-path"},
)
data = resp.json()
print(data["short_url"])  # https://msha.live/abc123

# Authenticated
TOKEN = "YOUR_API_TOKEN"
resp = requests.post(
    "https://api.meshalive.com/v1/links",
    headers={"Authorization": f"Bearer {TOKEN}"},
    json={
        "destination": "https://example.com/long-path",
        "slug": "my-link",
        "title": "My link title",
    },
)
print(resp.json()["short_url"])

Go

package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "net/http"
)

func shortenURL(dest, token string) (string, error) {
    body, _ := json.Marshal(map[string]string{
        "destination": dest,
    })
    req, _ := http.NewRequest("POST",
        "https://api.meshalive.com/v1/links",
        bytes.NewBuffer(body))
    req.Header.Set("Content-Type", "application/json")
    req.Header.Set("Authorization", "Bearer "+token)

    resp, err := http.DefaultClient.Do(req)
    if err != nil {
        return "", err
    }
    defer resp.Body.Close()

    var result map[string]interface{}
    json.NewDecoder(resp.Body).Decode(&result)
    return result["short_url"].(string), nil
}

func main() {
    url, _ := shortenURL("https://example.com", "YOUR_API_TOKEN")
    fmt.Println(url)
}

Endpoint reference

MethodEndpointAuth?Description
POST/v1/shortenNoShorten a URL (public, 20-click limit)
POST/v1/linksYesCreate a tracked link with optional custom slug
GET/v1/linksYesList all links in your workspace
GET/v1/links/:slugYesGet details for a specific link
PATCH/v1/links/:slugYesUpdate destination URL or title
DELETE/v1/links/:slugYesDelete a short link
GET/v1/links/:slug/analyticsYesGet click analytics for a link

Using the API with Zapier or Make

You can use the Meshalive API from Zapier or Make (formerly Integromat) using the Webhooks/HTTP action. Set the method to POST, URL to https://api.meshalive.com/v1/links, add your token in the Authorization header, and map the destination URL from your trigger. Common use cases:

  • Automatically shorten URLs from a Google Sheet column
  • Create a short link every time a new blog post is published in WordPress
  • Generate a short link for each new product in Shopify
  • Shorten URLs in a CRM when a new deal or lead is created

Frequently asked questions

Is the Meshalive API free?

The public /v1/shorten endpoint is free and requires no API key. Links created through it have a 20-click limit. For unlimited clicks, custom slugs, and analytics, API access is included on the Starter plan ($4/month). There is no per-request charge.

What is the rate limit?

Unauthenticated requests are limited to 20 requests per minute per IP. Authenticated requests (with an API token) are limited to 300 requests per minute. If you need higher limits, contact support.

How do I get an API token?

Create a free account at meshalive.com/register. Then go to Dashboard → Settings → API Tokens → Create token. Tokens are workspace-scoped — one token per workspace. You can create multiple tokens and revoke them individually.

Can I use the API to retrieve analytics programmatically?

Yes. The GET /v1/links/:slug/analytics endpoint returns click data including total clicks, clicks by day, country breakdown, device type, and referrer. This is available on Starter and above plans.

Does Bitly offer a free API?

No. Bitly requires the Enterprise plan ($199/month) for API access. Every other URL shortener on this list offers API access for $20/month or less. Meshalive includes it from $4/month.

Is there an SDK or just a REST API?

Currently only a REST API is available. The API follows standard REST conventions and works with any HTTP client or language. An official JavaScript/TypeScript SDK is planned for Q3 2026. Until then, the curl examples above work directly in Node.js with the native fetch API.

Get your free API token

100% Free Forever · No credit card · Full REST API included