URL Shortener API
Create, manage, and get stats for shortened URLs. Includes a redirector endpoint.
/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).