🎮 swdl

📖 API Documentation

Integrate swdl into your applications

Getting Started

The swdl API allows you to programmatically access game entries and download information. To use the API, you'll need an API key.

🔑 Obtaining an API Key

  1. Create an account or log in
  2. Go to your API Keys settings
  3. Generate a new API key with a descriptive name
  4. Copy and store your API key securely

⚠️ Keep your API key secure and never share it publicly!

Authentication

There are two ways to authenticate API requests:

1. Using API Key in Header (Recommended)

Authorization: Bearer YOUR_API_KEY_HERE

2. Using API Key as Query Parameter

?api_key=YOUR_API_KEY_HERE

Base URL

https://swdld.obnoxious.lol/api

Endpoints

GET /api/list

Retrieve all game entries from the database.

Request Example

curl -H "Authorization: Bearer YOUR_API_KEY" \
  https://swdld.obnoxious.lol/api/list

Response Example

{
  "entries": [
    {
      "id": "123456",
      "name": "Super Mario Odyssey",
      "source": "/games/super_mario_odyssey.nsp",
      "type": "filepath",
      "file_type": "nsp",
      "size": 5606900000,
      "created_at": "2026-02-13T12:00:00",
      "created_by": "admin",
      "metadata": {
        "description": "A 3D platform game",
        "version": "1.3.0"
      }
    }
  ]
}
GET /api/download/{entry_id}

Download a specific game entry by its ID.

Parameters

  • entry_id (path parameter) - The unique ID of the entry

Request Example

curl -H "Authorization: Bearer YOUR_API_KEY" \
  https://swdld.obnoxious.lol/api/download/123456

Response

If the entry is a URL, the API will redirect to it. If it's a local file, the API will serve the file for download.

Code Examples

🐍 Python

import requests

API_KEY = "YOUR_API_KEY_HERE"
BASE_URL = "https://swdld.obnoxious.lol/api"

headers = {
    "Authorization": f"Bearer {API_KEY}"
}

# List all entries
response = requests.get(f"{BASE_URL}/list", headers=headers)
entries = response.json()["entries"]

for entry in entries:
    print(f"{entry['name']} - {entry['file_type']}")

# Download an entry
entry_id = entries[0]["id"]
download_response = requests.get(
    f"{BASE_URL}/download/{entry_id}",
    headers=headers,
    allow_redirects=True
)

# Save file
with open(f"{entries[0]['name']}.{entries[0]['file_type']}", "wb") as f:
    f.write(download_response.content)

📜 JavaScript (Node.js)

const axios = require('axios');

const API_KEY = 'YOUR_API_KEY_HERE';
const BASE_URL = 'https://swdld.obnoxious.lol/api';

const headers = {
    'Authorization': `Bearer ${API_KEY}`
};

// List all entries
async function listEntries() {
    const response = await axios.get(`${BASE_URL}/list`, { headers });
    return response.data.entries;
}

// Download an entry
async function downloadEntry(entryId) {
    const response = await axios.get(
        `${BASE_URL}/download/${entryId}`,
        { 
            headers,
            responseType: 'stream'
        }
    );
    return response.data;
}

// Usage
listEntries().then(entries => {
    console.log(`Found ${entries.length} entries`);
    entries.forEach(entry => {
        console.log(`${entry.name} - ${entry.file_type}`);
    });
});

🔧 cURL

# List all entries
curl -H "Authorization: Bearer YOUR_API_KEY" \
  https://swdld.obnoxious.lol/api/list

# Download an entry
curl -H "Authorization: Bearer YOUR_API_KEY" \
  -L -o game.nsp \
  https://swdld.obnoxious.lol/api/download/123456

Rate Limits

Currently, there are no enforced rate limits, but please be respectful and avoid making excessive requests. We monitor API usage and may implement rate limits in the future if necessary.

Error Codes

Status Code Description
200 Success
401 Unauthorized - Invalid or missing API key
404 Not Found - Entry doesn't exist
500 Internal Server Error

Support

If you need help or have questions about the API: