moddingcartel

📖 API Documentation

Integrate moddingcartel into your applications

Getting Started

The moddingcartel 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://www.moddingcartel.com/api

Endpoints

GET /api/list

Retrieve all game entries from the database.

Request Example

curl -H "Authorization: Bearer YOUR_API_KEY" \
  https://www.moddingcartel.com/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://www.moddingcartel.com/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.

POST /api/send-to-switch

Add a game to your Send to Switch queue. Supports both API key and cookie-based authentication.

Request Body

  • entry_id (required) - The unique ID of the entry to send

Request Example (API Key)

curl -X POST -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"entry_id": "123456"}' \
  https://www.moddingcartel.com/api/send-to-switch

Request Example (Session Cookie)

curl -X POST -H "Content-Type: application/json" \
  -b "session=YOUR_SESSION_COOKIE" \
  -d '{"entry_id": "123456"}' \
  https://www.moddingcartel.com/api/send-to-switch

Response Example

{
  "success": true,
  "message": "Game added to send queue"
}
GET /api/send-queue

Get pending items from your send queue. Used by the send_to_switch client.

Request Example

curl -H "Authorization: Bearer YOUR_API_KEY" \
  https://www.moddingcartel.com/api/send-queue

Response Example

{
  "success": true,
  "queue": [
    {
      "queue_item_id": "789",
      "entry_id": "123456",
      "entry_name": "Super Mario Odyssey",
      "entry_source": "/games/super_mario_odyssey.nsp",
      "entry_size": 5606900000,
      "status": "pending",
      "created_at": "2026-02-17T02:00:00"
    }
  ]
}
POST /api/send-queue/progress

Update progress information for a queue item. Used by the send_to_switch client.

Request Body

  • queue_item_id (required) - The unique ID of the queue item
  • progress_percent (optional) - Progress percentage (0-100)
  • bytes_transferred (optional) - Number of bytes transferred
  • transfer_speed (optional) - Transfer speed in bytes per second
  • status (optional) - Status update ('processing', 'completed', 'failed')
  • error_message (optional) - Error message if failed

Request Example

curl -X POST -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "queue_item_id": "789",
    "progress_percent": 45,
    "bytes_transferred": 2523105000,
    "transfer_speed": 5242880
  }' \
  https://www.moddingcartel.com/api/send-queue/progress

Response Example

{
  "success": true,
  "message": "Progress updated"
}

Authentication Methods

1. API Key Authentication

Best for programmatic access and client applications.

Authorization: Bearer YOUR_API_KEY

2. Cookie-Based Authentication

For web applications making requests from the browser. Cookies are automatically included when using credentials: 'same-origin' in fetch() or withCredentials: true in axios.

// JavaScript fetch with cookies
fetch('/api/send-to-switch', {
    method: 'POST',
    credentials: 'same-origin',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ entry_id: '123456' })
});

Code Examples

🐍 Python

import requests

API_KEY = "YOUR_API_KEY_HERE"
BASE_URL = "https://www.moddingcartel.com/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']}")

# Send a game to Switch
entry_id = entries[0]["id"]
send_response = requests.post(
    f"{BASE_URL}/send-to-switch",
    headers=headers,
    json={"entry_id": entry_id}
)

if send_response.json()["success"]:
    print(f"Added {entries[0]['name']} to send queue!")

# Download an entry
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://www.moddingcartel.com/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;
}

// Send to Switch
async function sendToSwitch(entryId) {
    const response = await axios.post(
        `${BASE_URL}/send-to-switch`,
        { entry_id: entryId },
        { headers }
    );
    return response.data;
}

// 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://www.moddingcartel.com/api/list

# Download an entry
curl -H "Authorization: Bearer YOUR_API_KEY" \
  -L -o game.nsp \
  https://www.moddingcartel.com/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: