E-Z Logo

Shortener API Documentation

Learn how to shorten URLs using our API

Endpoint: /shortener/

POSTShorten URLs with the E-Z.host API

Headers

NameValueDescription
Content-Typeapplication/jsonThe type of the request body.
keyYour API keyYour API key for authentication.

Request Body

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

Example Request

bash
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

Successful response example:

json
{
  "success": true,
  "message": "URL Shortened",
  "shortenedUrl": "https://i.e-z.gg/s/xyz123",
  "deletionUrl": "https://i.e-z.gg/shortener/delete?key=random-deletion-key"
}

Error Handling

Possible error responses include:

  • 400 Bad Request: Invalid URL format.
  • 401 Unauthorized: Invalid API key.
  • 422 Unprocessable Entity: Validation error due to missing or invalid parameters.
  • 429 Too Many Requests: Rate limit exceeded.

Need Help?

If you need assistance with our Shortener API, feel free to: