API Documentation
Authentication
Most API endpoints require authentication. You can authenticate by providing either a Firebase ID Token or an API Key. You can generate an API Key from your user profile on the main page.
Provide your token or key in the Authorization header as a Bearer token.
Authorization: Bearer YOUR_API_KEY
Shorten a URL
POST /shorten
Creates a new short URL. If you provide an authentication token/key, the URL will be associated with your account.
Example Request (cURL)
curl -X POST https://ouh.la/shorten \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"url": "https://your-long-url.com/example"}'
Success Response (200)
{
"short_url": "https://ouh.la/aBc12D"
}
Get My URLs
GET /api/my-urls
Retrieves a paginated list of short URLs created by the authenticated user. Requires authentication.
Query Parameters
page(optional): The page number to retrieve. Defaults to 1.
Example Request (cURL)
curl -X GET "https://ouh.la/api/my-urls?page=1" \
-H "Authorization: Bearer YOUR_API_KEY"
Success Response (200)
{
"urls": [
{
"ShortURL": "aBc12D",
"LongURL": "https://your-long-url.com/...",
"UserID": "user-id",
"CreatedAt": "2025-10-30T12:00:00Z",
"AccessCount": 42
}
],
"totalPages": 5,
"currentPage": 1
}
Manage API Key
Note: The easiest way to manage your API Key is to log in to the website. Once logged in, scroll down to the bottom of the page to find the API Key management section where you can view, generate, or delete your key.
The endpoints below are available if you need to manage keys programmatically using a Firebase ID Token.
Get API Key
GET /api/api-key
Example Request
curl -X GET https://ouh.la/api/api-key \
-H "Authorization: Bearer YOUR_FIREBASE_ID_TOKEN"
Success Response (200)
{
"apiKey": "your-generated-api-key"
}
Generate API Key
POST /api/api-key
Generates a new API key. This will overwrite any existing key.
Example Request
curl -X POST https://ouh.la/api/api-key \
-H "Authorization: Bearer YOUR_FIREBASE_ID_TOKEN"
Success Response (200)
{
"apiKey": "your-newly-generated-api-key"
}