If you're building an app, running automated workflows, or just tired of shortening links manually — the Shortix REST API lets you do it all programmatically. In this guide we'll walk through every available endpoint, authentication methods, and working code examples you can drop straight into your project.
What the API Can Do
The Shortix API currently exposes four endpoints that cover the full link lifecycle:
- Create a short link, with or without a custom alias
- Read metadata for any existing short link by its code
- Stats — fetch platform-wide counters in real time (public, no auth needed)
- Delete a short link permanently
All requests and responses use JSON. The base URL for every endpoint is https://shortix.xyz/api.
Authentication
Most endpoints require authentication. The API supports two methods — use whichever fits your use case.
Method 1 — Firebase ID Token (for logged-in users)
If you're building a client-side app where users sign in with their Shortix account, obtain a Firebase ID token from the authenticated user and pass it as a Bearer token:
Method 2 — API Key (for server-to-server integrations)
For backend scripts and automation where no user is involved, use a static API key in the X-API-Key header:
GET /api/stats endpoint is fully public — no authentication header is required.
Endpoint Reference
1. Create a Short Link
Creates a new short link and returns its full metadata including the generated short URL, click count (starts at 0), and creation timestamp.
Request body (JSON):
Example with curl:
Example with JavaScript (fetch):
2. Get Link Metadata
Fetches metadata for any existing short link by its short code. No authentication is required — this is a public endpoint. Returns the original URL, click count, and creation date.
This is useful for checking how many clicks a link has received or verifying where a short code currently points before using it in automation.
3. Platform Statistics
Returns real-time platform-wide counters: total links shortened, total image conversions, and total QR codes generated. No authentication required.
4. Delete a Short Link
Permanently removes a short link. This action is irreversible. Token-authenticated users can only delete links they own. API key users can delete any link.
Practical Use Cases
Automate link creation from a spreadsheet
If you manage a large list of URLs — affiliate links, campaign URLs, or redirects — you can write a short script that reads from a CSV and hits POST /api/shorten for each row, writing the resulting short URLs back out. No manual copying required.
Embed link shortening in your own product
If you're building a SaaS tool, CMS, or internal dashboard that deals with URLs, the API lets you add a "Shorten" button that calls Shortix in the background. Your users get clean links without ever leaving your interface.
Monitor click performance in real time
By polling GET /api/info/:code at regular intervals, you can track click growth on any link — useful for campaign monitoring, A/B comparisons, or simply knowing when a link has gone viral.
Error Codes
The API returns standard HTTP status codes. A 200 or 201 means success. Common errors include 400 (invalid request body or missing fields), 401 (missing or invalid credentials), 409 (alias already taken), and 404 (short code not found). All error responses include a JSON body with a message field explaining what went wrong.
Full API Reference
The interactive API documentation — with full request/response schemas, live examples, and a try-it interface — is available at shortix.xyz/api-docs. It's the best place to explore the endpoints before writing code.
Explore the Full API Docs
Interactive reference with full schemas, code examples, and live endpoint explorer.
Open API Docs →