API Documentation

hi4.in URL Shortener API - Complete Reference Guide

Available Endpoints

Explore the available API endpoints for the hi4.in URL shortener service.

POST /api/shorten
Shorten URL

Create a shortened URL with optional custom slug, password protection, and expiration date.

GET /api/info/{slug}
Get URL Info

Retrieve information about a shortened URL including clicks, creation date, and metadata.

GET /{slug}
Redirect to Original URL

Access the original URL through the shortened link.

GET /api/health
Health Check

Check the API service status and database connectivity.

OpenAPI Specification

Download the complete OpenAPI 3.0 specification for integration with your development tools.


Quick Start

To use the API, send a POST request to /api/shorten with your URL in JSON format:

{
  "long_url": "https://example.com",
  "custom_slug": "optional",
  "title": "Optional Title",
  "password": "optional",
  "expires_at": "2024-12-31T23:59:59Z"
}

Authentication

Some endpoints require JWT authentication. Include the token in the Authorization header:

Authorization: Bearer YOUR_JWT_TOKEN