Welcome to the official documentation for the MBD CDN API. This API allows file uploads, statistics retrieval, and regional content serving.
All API routes are found at https://cdn.madebydanny.uk/
Endpoint: POST /upload
Description: Upload a file to all regions. Maximum file size: 100 MB.
Form data parameter:
file — The file to upload.Response: JSON with a universal URL and file key.
{
"url": "https://cdn.madebydanny.uk/user-content/2025-10-18/123456_file.png",
"key": "user-content/2025-10-18/123456_file.png"
}
Endpoint: GET /stats
Description: Fetch global statistics about uploaded files and bandwidth.
Response: JSON object:
{
"filesUploaded": 10,
"totalBandwidth": 1.23, // in GB
"regionsSupported": 6
}
Endpoint: GET /user-content/{path}
Description: Redirects to the nearest regional copy of the file based on the user's location.
Example:
GET /user-content/2025-10-18/123456_file.png
Redirects to:
https://asia-public-cdn.madebydanny.uk/user-content/2025-10-18/123456_file.png
All endpoints support CORS. Preflight requests (OPTIONS) are handled automatically.
400 — Bad request (e.g., no file uploaded or file too large).404 — Endpoint not found.500 — Internal server error.const fileInput = document.querySelector('#file');
const formData = new FormData();
formData.append('file', fileInput.files[0]);
fetch('https://cdn.madebydanny.uk/upload', {
method: 'POST',
body: formData
})
.then(res => res.json())
.then(console.log)
.catch(console.error);