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.
Test the URL Shortener Engine Live
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.
curl -X POST https://api.meshalive.com/v1/shorten \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/very/long/path?with=params"}'{
"slug": "abc123",
"short_url": "https://msha.live/abc123",
"click_limit": 20
}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.
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"
}'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
| Method | Endpoint | Auth? | Description |
|---|---|---|---|
| POST | /v1/shorten | No | Shorten a URL (public, 20-click limit) |
| POST | /v1/links | Yes | Create a tracked link with optional custom slug |
| GET | /v1/links | Yes | List all links in your workspace |
| GET | /v1/links/:slug | Yes | Get details for a specific link |
| PATCH | /v1/links/:slug | Yes | Update destination URL or title |
| DELETE | /v1/links/:slug | Yes | Delete a short link |
| GET | /v1/links/:slug/analytics | Yes | Get 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.
100% Free Forever · No credit card · Full REST API included