Free URL Shortener API — REST Endpoint for Testing & Development
Create, manage, and get stats for shortened URLs. Includes a redirector endpoint. This endpoint provides realistic mock data and behaviors, making it perfect for frontend testing, QA, software demos, and programming tutorials.
/api/shorten
Create a new shortened URL. Custom alias (shortCode) and expiration are optional.
/api/stats/{shortCode}
Get statistics for a shortened URL. Replace {shortCode} with an actual short code.
Replace placeholders (e.g., {userId}) with actual values in the path above. You can also add/edit query parameters (e.g., ?key=value).
/api/links
List all shortened URLs. Supports optional `userId` query parameter for filtering.
You can add or change query parameters in the path above (e.g., ?name=User).
/api/links/{linkId}
Get details for a specific short link by its internal ID. Replace {linkId} with an actual link ID.
Replace placeholders (e.g., {userId}) with actual values in the path above. You can also add/edit query parameters (e.g., ?key=value).
/api/links/{linkId}
Delete a specific short link by its internal ID. Replace {linkId} with an actual link ID.
Replace placeholders (e.g., {userId}) with actual values in the path above.
/s/{shortCode}
Redirector endpoint. Accessing this path with a valid shortCode redirects to the original URL and increments the click count. This is not a JSON API but the core functionality.
Replace placeholders (e.g., {userId}) with actual values in the path above. You can also add/edit query parameters (e.g., ?key=value).
cURL Request
curl -X POST https://gen-endpoint.com/api/shortenSample JSON Response
{
"id": "link_nanoid10",
"shortUrl": "http://localhost:3000/s/my-custom-link",
"originalUrl": "https://www.verylongurl.com/path/to/something/interesting?query=param",
"shortCode": "my-custom-link",
"createdAt": "2024-08-20T10:00:00.000Z",
"expiresAt": "2025-12-31T23:59:59Z",
"description": "Link to an interesting article",
"clickCount": 0
}Is this API free?
Yes! This API is completely free to use for personal, learning, and development purposes. There are no strict usage limits for standard personal use.
Does it require authentication?
Most of our endpoints are public and do not require any API keys or authentication. You can start sending requests immediately.
What does the response look like?
Our APIs return standardized JSON responses mimicking real-world data structures, ensuring easy parsing and integration for your frontend or tools.
Can I use this in production?
No. These endpoints are designed solely for testing, development, and demonstration purposes. They provide mock data and do not guarantee uptime or data persistence required for production applications.