Gen-Endpoint
Back to API List

Free URL Shortener API — REST Endpoint for Testing & Development

Utilities
6 Endpoints

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.

Internal API - Hosted by this App
API Endpoints & Usage
Explore and interact with the available endpoints for the URL Shortener API. These API routes are live!
POST

/api/shorten

Create a new shortened URL. Custom alias (shortCode) and expiration are optional.

Try it out
GET

/api/stats/{shortCode}

Get statistics for a shortened URL. Replace {shortCode} with an actual short code.

Try it out

Replace placeholders (e.g., {userId}) with actual values in the path above. You can also add/edit query parameters (e.g., ?key=value).

GET

/api/links

List all shortened URLs. Supports optional `userId` query parameter for filtering.

Try it out

You can add or change query parameters in the path above (e.g., ?name=User).

GET

/api/links/{linkId}

Get details for a specific short link by its internal ID. Replace {linkId} with an actual link ID.

Try it out

Replace placeholders (e.g., {userId}) with actual values in the path above. You can also add/edit query parameters (e.g., ?key=value).

DELETE

/api/links/{linkId}

Delete a specific short link by its internal ID. Replace {linkId} with an actual link ID.

Try it out

Replace placeholders (e.g., {userId}) with actual values in the path above.

GET

/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.

Try it out

Replace placeholders (e.g., {userId}) with actual values in the path above. You can also add/edit query parameters (e.g., ?key=value).

Example Usage

cURL Request

curl -X POST https://gen-endpoint.com/api/shorten

Sample 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
}
Frequently Asked Questions (FAQ)

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.

    URL Shortener API - Free Public API | Gen-Endpoint