API
DOCUMENTATION.

Integrate MrShort's powerful link shortening and monetization capabilities into your own applications with our simple REST API.

rocket_launch

Quick Start

Get started with MrShort API in minutes. No complex setup required.

1

Create an account at MrShort.io

2

Get your API key from Dashboard

3

Start shortening links via API

link Base URL

Base URL: https://mrshort.io/api

key Authentication

All API requests require authentication using an API token. Include your token in the request header:

Authorization: Bearer YOUR_API_TOKEN
Content-Type: application/json
Accept: application/json
warning

Keep your API token secret. Never share it publicly or commit it to version control.

POST

/shorten

Create a new shortened URL. The shortened link will be monetized and you'll earn revenue for each valid click.

Request Body

Parameter Type Required Description
url string Yes The original URL to shorten (must be a valid URL)
alias string No Custom alias for the short link (alphanumeric, 3-20 chars)

Example Request

curl -X POST https://mrshort.io/api/shorten \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/very-long-url-that-needs-shortening"
  }'

Success Response

{
  "success": true,
  "short_link": "https://mrshort.io/abc123",
  "code": "abc123",
  "original_url": "https://example.com/very-long-url-that-needs-shortening"
}
GET

/stats/{code}

Retrieve statistics for a specific shortened link including click counts, geographic data, and earnings.

Path Parameters

Parameter Type Description
code string The short code of the link

Example Request

curl -X GET https://mrshort.io/api/stats/abc123 \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json"

Success Response

{
  "success": true,
  "data": {
    "code": "abc123",
    "original_url": "https://example.com/...",
    "total_clicks": 1542,
    "unique_clicks": 1203,
    "earnings": 12.45,
    "created_at": "2024-12-01T10:30:00Z",
    "countries": {
      "US": 523,
      "UK": 234,
      "DE": 156
    },
    "devices": {
      "Desktop": 892,
      "Mobile": 587,
      "Tablet": 63
    }
  }
}
GET

/links

Retrieve a paginated list of all your shortened links.

Query Parameters

Parameter Type Default Description
page integer 1 Page number for pagination
per_page integer 20 Number of results per page (max: 100)

Example Request

curl -X GET "https://mrshort.io/api/links?page=1&per_page=20" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json"

error Error Codes

Code Status Description
400 Bad Request Invalid request parameters or malformed JSON
401 Unauthorized Missing or invalid API token
403 Forbidden Access denied to the requested resource
404 Not Found The requested resource was not found
422 Validation Error URL validation failed or invalid input
429 Too Many Requests Rate limit exceeded
500 Server Error Internal server error

speed Rate Limits

Standard Plan

60 requests per minute

1000 requests per day

Premium Plan

300 requests per minute

Unlimited daily requests

Rate limit information is included in the response headers: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset

Need help with the API?

mail Contact API Support