Shortly API Documentation

API Documentation

The Shortly API allows you to programmatically create and manage short URLs. All API endpoints return JSON responses and use standard HTTP status codes.

Base URL

https://88d.in/api

Response Format

All responses are in JSON format with the following structure:

{
  "success": true,
  "data": { ... },
  "error": null
}

Authentication

Public API

Currently, all endpoints are public and don't require authentication. User authentication will be added in a future version.

Rate Limits

Free Tier

  • • 100 requests per hour
  • • 1,000 URLs per day
  • • Basic analytics

Headers

Rate limit information is returned in response headers:

  • X-RateLimit-Limit
  • X-RateLimit-Remaining
  • X-RateLimit-Reset

Create Short URL

POST /api/shorten

Request Body

{
  "original_url": "https://example.com/very/long/url",
  "custom_alias": "my-link" // optional
}

Response

{
  "short_url": "https://88d.in/abc123",
  "original_url": "https://example.com/very/long/url",
  "short_code": "abc123",
  "qr_code_url": "https://88d.in/qr/abc123"
}

Example

curl -X POST https://88d.in/api/shorten \
  -H "Content-Type: application/json" \
  -d '{
    "original_url": "https://example.com/very/long/url",
    "custom_alias": "my-link"
  }'

Get URL Info

GET /api/info/{short_code}

Response

{
  "short_code": "abc123",
  "original_url": "https://example.com/very/long/url",
  "title": "Example Page",
  "description": "This is an example page",
  "click_count": 42,
  "created_at": "2024-01-15T10:30:00Z",
  "last_click_at": "2024-01-15T15:45:00Z"
}

Example

curl https://88d.in/api/info/abc123

Get Analytics

GET /api/analytics/{short_code}?days=30

Parameters

  • days - Number of days to include (default: 30, max: 365)

Response

{
  "url": {
    "short_code": "abc123",
    "original_url": "https://example.com/very/long/url",
    "click_count": 42
  },
  "daily_clicks": [
    {"date": "2024-01-15", "count": 5},
    {"date": "2024-01-16", "count": 12}
  ],
  "country_stats": [
    {"country": "United States", "count": 25},
    {"country": "Canada", "count": 17}
  ],
  "total_clicks": 42
}

Example

curl https://88d.in/api/analytics/abc123?days=7

List URLs

GET /api/urls?page=1&limit=20

Parameters

  • page - Page number (default: 1)
  • limit - Results per page (default: 20, max: 100)

Response

{
  "urls": [
    {
      "id": 1,
      "short_code": "abc123",
      "short_url": "https://88d.in/abc123",
      "original_url": "https://example.com/page",
      "title": "Example Page",
      "click_count": 42,
      "created_at": "2024-01-15T10:30:00Z",
      "last_click_at": "2024-01-15T15:45:00Z",
      "is_active": true
    }
  ],
  "total": 150,
  "page": 1,
  "limit": 20,
  "total_pages": 8
}

Example

curl https://88d.in/api/urls?page=2&limit=10

Error Codes

Code Description
400 Bad Request - Invalid input parameters
404 Not Found - Short URL doesn't exist
429 Too Many Requests - Rate limit exceeded
500 Internal Server Error