Developer API Documentation

Integrate 4wrd.ing into your applications with our simple and powerful REST API

Authentication

All API requests require authentication

Include your API key in the x-api-key header with every request.

x-api-key: YOUR_API_KEY

Get your API key from the admin dashboard.

Create Short Link

POST
/api/v1/shorten

Request Body

{
  "url": "https://example.com",
  "slug": "my-link"        // optional
}

Example Request

curl -X POST https://4wrd.ing/api/v1/shorten \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://google.com", "slug": "go"}'

Response

{
  "success": true,
  "data": {
    "uuid": "550e8400-e29b-41d4-a716-446655440000",
    "slug": "go",
    "short_link": "https://4wrd.ing/go",
    "admin_link": "https://4wrd.ing/550e8400-e29b-41d4-a716-446655440000",
    "target_url": "https://google.com"
  }
}

Get Link Statistics

GET
/api/v1/stats/{key}

URL Parameters

key - Can be either a UUID or slug

Example Request

curl https://4wrd.ing/api/v1/stats/go \
  -H "x-api-key: YOUR_API_KEY"

Response

{
  "success": true,
  "data": {
    "uuid": "550e8400-e29b-41d4-a716-446655440000",
    "slug": "go",
    "target_url": "https://google.com",
    "clicks": 42,
    "created_at": "2024-01-15T10:30:00Z"
  }
}

Key Features

  • 1
    Dual-Mode Addressing: Every link gets both a UUID and optional custom slug
  • 2
    Smart Lookup: Automatically detects UUID vs slug format
  • 3
    Click Tracking: Built-in analytics for every link
  • 4
    Full-Screen Preview: Links display in iframe for seamless experience

Error Codes

400
Bad Request - Invalid URL or missing parameters
401
Unauthorized - Missing or invalid API key
404
Not Found - Link does not exist
409
Conflict - Slug already exists
500
Internal Server Error