One GET request, no authentication, no sign up. JSON or plain text.
The fastest way to shorten a link. No account, no API key, no POST body:
curl "https://urlvanish.com/api/shorten?format=simple&url=https://example.com/a/very/long/address"
https://urlvanish.com/a1b2c3d4
Or as JSON:
curl "https://urlvanish.com/api/shorten?url=https://example.com/page"
{
"shorturl": "https://urlvanish.com/a1b2c3d4",
"alias": "a1b2c3d4",
"originalUrl": "https://example.com/page"
}
Compatibility: the same request also works against
https://urlvanish.com/create.php?format=simple&url=…, which is the
shape other no-key shorteners use. Both routes are the same endpoint.
| Parameter | Required | Description |
|---|---|---|
url | Yes | The address to shorten. u, long_url and originalUrl are accepted as aliases. |
format | No | json (default), or simple/text for the bare short URL as plain text. |
shorturl | No | Request a custom alias. Letters, numbers, hyphens and underscores, up to 50 characters. |
base64 | No | Set to 1 if url is base64 encoded. Base64 input is auto-detected too. |
The reverse operation resolves a URLVanish short link back to its destination. It does not count as a click and never consumes a single-use link:
curl "https://urlvanish.com/api/expand?format=simple&url=https://urlvanish.com/a1b2c3d4"
https://example.com/page
The destination of a password-protected link is deliberately withheld and returns 403. Suspended, expired and used-up links return 410.
Authorization: Bearer <key> with a
free key for 1,000. Every response carries
X-RateLimit-Remaining.
Welcome to the URLVanish API! Our API allows you to integrate URL shortening capabilities directly into your applications. Create shortened URLs programmatically while maintaining the same privacy-focused approach that makes URLVanish unique.
GET https://urlvanish.com/api/shorten for the one-request form above, and
POST https://urlvanish.com/create_api.php for the JSON-body form documented below.
Neither requires an API key.
URLVanish API supports optional API key authentication. Authenticated requests link shortened URLs to your account so you can manage them from your dashboard.
Authorization: Bearer YOUR_API_KEY
To ensure fair usage for all users, we implement the following rate limits:
Every response carries your current allowance, so you do not have to guess:
X-RateLimit-Limit — requests allowed in the current hourX-RateLimit-Remaining — requests leftX-RateLimit-Reset — Unix timestamp when the window resetsExceeding the limit returns 429 Too Many Requests with a Retry-After header giving the number of seconds to wait.
https://urlvanish.com/create_api.php
Creates a new shortened URL.
| Header | Required | Description |
|---|---|---|
Content-Type |
Yes | Must be application/json |
Authorization |
No | Bearer token for authenticated requests: Bearer YOUR_API_KEY |
| Parameter | Type | Required | Description |
|---|---|---|---|
originalUrl |
string | Yes | The URL to shorten |
customAlias |
string | No | Custom alias for the short URL (letters, numbers, dashes, underscores, up to 50 characters) |
Checking a link without following it: append a + to any
short URL — https://urlvanish.com/abc12345+ — to get a page showing
the destination, the click count and whether the link carries a password or an expiry.
It needs no authentication, does not count as a click, and does not consume a single-use
link. The destination of a password-protected link is withheld.
Note: password protection, expiry dates, click limits and
self-destructing links are available on the
website but are not yet exposed through the API.
A link created through the API has none of those controls. Any extra fields
you send are ignored — including userId, which is
deliberately not accepted: a link belongs to the account whose API key
created it, or to nobody.
{
"originalUrl": "https://example.com/very-long-url",
"customAlias": "my-custom-link"
}
{
"status": "success",
"alias": "https://urlvanish.com/my-custom-link",
"originalUrl": "https://example.com/very-long-url"
}
authenticated_as field with your username, confirming the URL was linked to your account.
{
"status": "success",
"alias": "https://urlvanish.com/my-custom-link",
"originalUrl": "https://example.com/very-long-url",
"authenticated_as": "your_username"
}
{
"status": "error",
"message": "Missing required parameter: originalUrl."
}
This endpoint is planned for a future release. It will allow you to retrieve information about a shortened URL including click statistics.
This endpoint is planned for a future release. It will allow you to delete shortened URLs via the API. Currently, you can manage your URLs from your dashboard.
This endpoint is planned for a future release. It will allow you to list all URLs created by your account with pagination and sorting. Currently, you can view your URLs from your dashboard.
The API uses HTTP response codes alongside a JSON response to indicate success or failure.
| Status Code | Description |
|---|---|
| 200 | Success — URL created |
| 400 | Bad Request — missing originalUrl, malformed JSON, an invalid URL, or an invalid custom alias |
| 401 | Unauthorized — Invalid or inactive API key |
| 405 | Method Not Allowed — use POST |
| 409 | Conflict — the requested custom alias is already taken |
| 429 | Too Many Requests — hourly rate limit reached. See the Retry-After and X-RateLimit-* headers. |
| 500 | Internal Server Error |
{
"status": "error",
"message": "Description of what went wrong"
}
| Message | Cause |
|---|---|
Missing required parameter: originalUrl. |
The originalUrl field is missing or empty in the request body |
Invalid or inactive API key. |
The Bearer token is not a valid API key or has been deleted |
Alias already exists. Please choose a different alias. |
The customAlias you requested is already taken |
Invalid HTTP method. Please use POST. |
The request was not a POST request |
curl -X POST https://urlvanish.com/create_api.php \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"originalUrl": "https://example.com/long-url",
"customAlias": "my-link"
}'
curl -X POST https://urlvanish.com/create_api.php \
-H "Content-Type: application/json" \
-d '{
"originalUrl": "https://example.com/long-url"
}'
const response = await fetch('https://urlvanish.com/create_api.php', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
originalUrl: 'https://example.com/long-url',
customAlias: 'my-link'
})
});
const data = await response.json();
console.log(data);
// { status: "success", alias: "https://urlvanish.com/my-link", originalUrl: "...", authenticated_as: "..." }
import requests
url = "https://urlvanish.com/create_api.php"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
"originalUrl": "https://example.com/long-url",
"customAlias": "my-link"
}
response = requests.post(url, json=data, headers=headers)
print(response.json())
# {'status': 'success', 'alias': 'https://urlvanish.com/my-link', 'originalUrl': '...', 'authenticated_as': '...'}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://urlvanish.com/create_api.php');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer YOUR_API_KEY',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'originalUrl' => 'https://example.com/long-url',
'customAlias' => 'my-link'
]));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$data = json_decode($response, true);
curl_close($ch);
print_r($data);
// Array ( [status] => success [alias] => https://urlvanish.com/my-link [originalUrl] => ... [authenticated_as] => ... )