Skip to main content
SendURL, home
FeaturesBy MikeUpdated 11 min read

Free URL Shortener API: Keys, Endpoints, Pagination

How to create a SendURL API key, choose workspace or folder access, call the REST API for links and clicks, and page through results with cursors.

SendURL has a free URL shortener API on every plan: create an API key in the console, send POST /links with a destination, and a short link comes back as JSON. The same key lists your links and returns every click on them. Changing a destination and deleting a link need Starter or above, and setting an expiry or a password Pro or above.

One request creates a short link; sample values

How to get a URL shortener API key

Keys are made in the console, on the API keys page in the sidebar. A free account is enough, and if you have none yet you can see what a short link looks like first with the free URL shortener, no sign-up needed.

  1. Open console.sendurl.to/api-keys and choose New key.
  2. Give it a Name you'll recognize later, such as "Production server".
  3. Pick its Access: All folders, or a single folder.
  4. Pick when it Expires: Never, 30 days, 90 days or 1 year, then choose Create key.
  5. Copy the key and store it as an environment variable named SENDURL_API_KEY.

A key starts with snu_. You can copy it again later from the list of keys, which also shows when each was last used. A workspace can have up to 25 active keys.

Keep keys on your server. Anyone who can read a key can use it, so never put one in a web page, a mobile app or a public repository. If a key leaks, revoke it in the same list: it's refused from the very next request.

Every request sends the key as a Bearer token. GET /me is a cheap test: it returns the key's workspace and folder, the plan, and how many links the workspace uses.

Check your keyShell
curl https://api.sendurl.to/api/v1/me \
  -H "Authorization: Bearer $SENDURL_API_KEY"

To shorten a URL, send POST /links. Only destinationUrl is required, and this call works on every plan:

Create a short linkShell
curl -X POST https://api.sendurl.to/api/v1/links \
  -H "Authorization: Bearer $SENDURL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"destinationUrl": "https://example.com/blog/launch", "title": "Launch post"}'

The same call from Node.js 18 or later:

create-link.jsJavaScript
const res = await fetch("https://api.sendurl.to/api/v1/links", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.SENDURL_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ destinationUrl: "https://example.com/blog/launch" }),
});
if (!res.ok) throw new Error(`HTTP ${res.status}: ${await res.text()}`);
const link = await res.json();
console.log(link.shortUrl);

Save it as an .mjs file, or run it in an ES module, for the top-level await. The response is the new link with its shortUrl and qrUrl.

Prefer a client library? The official URL shortener SDK for Node.js and Python (npm install sendurl, pip install sendurl) makes the same call with one method, pages through lists for you and raises typed errors.

Leave out slug for a random five-character one, or send one that follows the slug rules. The body also accepts folderId, and on Pro and above expiresAt (such as "expiresAt": "2030-12-31T23:59:59Z") and password; on Free either one is a 403 plan_upgrade_required. Every field is under Create a link in the API docs.

What the free URL shortener API covers

The base URL is https://api.sendurl.to/api/v1. Everything in this table is on every plan unless the last column says otherwise.

CallWhat it doesPlan note
POST /linksCreate a short linkexpiresAt and password need Pro and above
GET /linksList links, 10 per page; filter with folderId, status or a search q; sort by creation or clicks
GET /links/:idOne link, with totalClicks and qrScans
PATCH /links/:idChange the fields you send: title, active, folderId, iPhone and Android targetsa new destinationUrl needs Starter and above; expiresAt, password or a new iPhone or Android target needs Pro and above
DELETE /links/:idEnd a link for goodpaid plans only
GET /links/:id/clicksEvery click of a link, newest first
GET /links/:id/clicks/:clickIdOne click in full
GET /links/:id/statsClicks per day
GET /links/export.csvAll links in the key's scope as one CSV filePro and above; links only, never clicks
GET /folders, POST /foldersList and create foldersworkspace keys only
GET /meThe key's workspace, folder, plan and usage

PATCH is how you change a link's destination, set or remove an expiry or a password, move a link to another folder, or switch a link off with "active": false.

DELETE has no undelete: the link's clicks drop out of your totals, its slug stays reserved and it still counts toward your link limit, so switching off is usually safer.

The full reference, with every field and error code, is the API docs.

Workspace keys and folder keys

A key reaches either the whole workspace or one folder, and you choose that when you create it.

A workspace key reaches every folder; a folder key reaches one
  • A workspace key works across every folder: it creates links anywhere, lists all of them, and lists or creates folders.
  • A folder key is fenced into one folder. It creates links there and sees only that folder's links and clicks; any other link is a 404.

Folder keys suit a script or an integration that needs one slice of your links and nothing else. The details are in what a folder-scoped API key can reach.

Yes: GET /links/:id/clicks returns each click with its time, country, device, browser, operating system and referrer, on every plan. Lists return at most 10 items per page, newest first.

While pagination.hasMore is true, pass pagination.nextCursor back as cursor. This Python loop reads every click of one link:

all_clicks.pyPython
import os
import requests

API = "https://api.sendurl.to/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['SENDURL_API_KEY']}"}

params = {"limit": 10}
clicks = []
while True:
    res = requests.get(f"{API}/links/LINK_ID/clicks", headers=HEADERS, params=params, timeout=10)
    res.raise_for_status()
    page = res.json()
    clicks.extend(page["clicks"])
    if not page["pagination"]["hasMore"]:
        break
    params["cursor"] = page["pagination"]["nextCursor"]

print(len(clicks), "clicks")

Cursors mark a position rather than a count, so pages don't shift while new clicks arrive. There is no offset parameter; sending one is an error. The links list also carries a summary (total links, active links, total clicks) and the workspace's usage. See Pagination in the API docs.

The console exports links to CSV on Pro and above (CSV export) and has no CSV export of clicks, so this loop is the way to get raw clicks out. To write them to a file, or for longer scripts such as storing clicks in a database, see the URL shortener API in Python guide.

Is this a free Bitly API alternative?

For creating links and reading clicks from code, yes, with one thing to know first: nothing is imported. SendURL has no import from other shorteners, so links already on bit.ly stay with Bitly, and switching means new links get snu.to addresses from now on.

The allowances differ. Bitly's Free plan allows 5 links a month according to Bitly's product page; its pricing page showed 50 when read from India on 15 November 2026. That pricing page, as read that day, showed no API request allowance, so check Bitly's developer pages for it. SendURL's Free plan has no monthly request quota: the limits are 25 links per workspace and the rate limit in "Plans and limits" below.

Both APIs take the key as Authorization: Bearer … and speak JSON (Bitly's API reference, read on 14 November 2026). One difference changes code: a SendURL link is addressed by its id, not by its short address, so store the id from the create response next to your own record.

The wider choice between the two services, API aside, is in free Bitly alternatives.

Errors

Errors share one JSON shape: an error code that is safe to branch on, a message for people, and sometimes issues. Common ones:

  • 401 invalid_api_key: the key is unknown, revoked or expired
  • 403 link_limit_reached: the workspace has used all the links on its plan
  • 403 plan_upgrade_required: the request uses a feature the workspace's plan doesn't include, such as an expiry or a password on Free
  • 404 link_not_found: no such link in the key's scope
  • 409 slug_taken: another link already uses that slug

Check the HTTP status before parsing the body: a request refused for sending too many requests can come back as an HTML page rather than JSON. The Errors section of the API docs lists every code.

Plans and limits

The API is part of every plan. What differs is the workspace's link limit, 25 links on Free and 250 a month on Starter at $9 a month, counted across all folders, and the paid features: changing a destination and deleting need Starter or above, and setting an expiry or a password Pro or above. Every tier is on the Pricing page.

What the Free plan includes for the API:

Free plan
Price$0
Links25 per workspace
Requests a monthNo monthly quota
Rate limit50 requests in 10 seconds per IP address
API keys25 active keys, for the workspace or for one folder
Click dataEvery click of every link, whatever its age, up to 2,500 tracked clicks a month

Fixed caps and limits:

  • 25 active keys per workspace, and folders by plan (3 on Free)
  • 10 items per page on every list
  • 50 requests in 10 seconds per IP address; past that, requests are refused for 10 seconds
  • No bulk endpoint: many links means one POST /links each, paced under the rate limit

For lists of links without writing code, the bulk UTM builder tags a list of URLs and can shorten the whole list with your own key.

More on the API

Before you ship

  • The key is in an environment variable, not in the code
  • The key has the narrowest access that works: one folder if one folder is enough
  • The code checks the HTTP status before it parses the body
  • The link's id is stored with your own record
  • Loops that page through clicks follow nextCursor and pause between requests

Compare each plan's link limit on the Pricing page, then create your key.

Frequently asked questions

  • A way to make and manage short links from code instead of a web page. Your program sends the long URL in an HTTP request and reads the short link from the JSON answer.

Shorten links from your code.

The REST API is on every plan, Free included: create links and read their clicks with an API key.

Keep reading

More: the SendURL blog, all link tracking guides and how-to answers.