E-Z LogoE-Z Wiki

URL Shortener API

Create short, shareable links from long URLs using the E-Z.host URL shortener.

Endpoint

POST /shortener

Authentication Required

Headers

HeaderValueDescription
Content-Typeapplication/jsonThe type of the request body
keyYOUR_API_KEYYour API key for authentication

Request Body

JSON object with the following field:

FieldTypeDescription
urlstringThe URL to shorten

Example Request Body

{
  "url": "https://example.com"
}

Example Request

curl -X POST https://api.e-z.host/shortener \
  -H "Content-Type: application/json" \
  -H "key: YOUR_API_KEY" \
  -d '{"url": "https://example.com"}'

Response

Success Response

{
  "success": true,
  "message": "URL shortened",
  "shortendUrl": "https://hentai.expert/s/4mijx5",
  "deletionUrl": "https://api.e-z.host/shortener/delete?key=random-deletion-key"
}

Response Fields

FieldDescription
successBoolean indicating if the request was successful
messageStatus message
shortendUrlThe shortened URL
deletionUrlURL to delete the shortened link

Error Handling

Common error responses:

  • 400 Bad Request: Invalid URL format
  • 401 Unauthorized: Invalid or missing API key
  • 422 Unprocessable Entity: Validation error due to missing or invalid parameters
  • 429 Too Many Requests: Rate limit exceeded (3 requests per 15 seconds)

Error Response Format

{
  "success": false,
  "error": "Error description"
}

Rate Limiting

This endpoint is subject to the global rate limit of 3 requests per 15 seconds per API key.

URL Requirements

  • URLs must be valid and properly formatted
  • URLs should include the protocol (http:// or https://)

Need Help?

If you need assistance with the URL shortener API: