0
Total API Keys
0
Active Keys
0
Total API Requests

✨ Generate New API Key

Create a new API key for domain integration

📋 Your API Keys

API Key Domain Name Requests Rate Limit Status Expires Actions
No API keys yet. Generate your first API key above!

📖 API Documentation

How to use your API keys

Base URL

https://mbsm.ch/api/v2/

Authentication

# Using Header
X-API-Key: YOUR_API_KEY

# Using Query Parameter
?api_key=YOUR_API_KEY

Create Short Link (POST)

curl -X POST https://mbsm.ch/api/v2/shorten \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com/long/url","custom":"mycode"}'

Get Statistics (GET)

curl -X GET "https://mbsm.ch/api/v2/stats" \
  -H "X-API-Key: YOUR_API_KEY"

Get All Links (GET)

curl -X GET "https://mbsm.ch/api/v2/links?limit=50&offset=0" \
  -H "X-API-Key: YOUR_API_KEY"

JavaScript Example

// Using fetch API
fetch('https://mbsm.ch/api/v2/shorten', {
    method: 'POST',
    headers: {
        'X-API-Key': 'YOUR_API_KEY',
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({url: 'https://example.com'})
})
.then(res => res.json())
.then(data => console.log(data));

PHP Example

<?php
$ch = curl_init('https://mbsm.ch/api/v2/shorten');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'X-API-Key: YOUR_API_KEY',
    'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
    'url' => 'https://example.com'
]));
$response = curl_exec($ch);
$data = json_decode($response, true);
print_r($data);
?>