SWU Stats

Star Wars Unlimited Stats

SWU Stats APIs

SWU Stats APIs

Welcome to the SWU Stats API documentation. This page provides information about available APIs. Please note that some APIs may have rate limits or require authentication. For high-volume usage, please contact us to discuss your needs. There is no charge to use SWU Stats APIs, but we ask that you visibly credit SWU Stats on your site if you use them. If you have any questions or need assistance with our APIs, please join our Discord server.

Deck Statistics API

Access statistical information about decks, including win rates, matchups, and more.

Get Deck Statistics

GET /TCGEngine/Stats/DeckMetaStatsAPI.php

Retrieve statistics for decks based on different parameters.

Query Parameters:

Parameter Type Description
deckId integer The ID of the deck to retrieve stats for
format string (Optional) Filter by game format

Example Response:

{
    "deckId": 12345,
    "numPlays": 42,
    "numWins": 28,
    "winRate": 66.67,
    "matchups": [
        {
            "opponent": "Red Hero",
            "wins": 10,
            "losses": 5,
            "winRate": 66.67
        },
        // More matchups...
    ]
}

Card Statistics API

Access statistical information about individual cards, including play rates, resource rates, and more.

Get Card Statistics

GET /TCGEngine/Stats/CardMetaStatsAPI.php

Retrieve statistics for individual cards based on different parameters.

Query Parameters:

Parameter Type Description
cardId string The ID of the card to retrieve stats for
format string (Optional) Filter by game format

Example Response:

{
    "cardId": "CARD123",
    "name": "Example Card",
    "timesIncluded": 1500,
    "timesPlayed": 850,
    "timesResourced": 420,
    "playRate": 56.7,
    "resourceRate": 28.0,
    "winRateWhenPlayed": 62.3
}

Game Submission API

Coming soon!

Deck API

Access and manage deck information.

Load Deck

GET /TCGEngine/APIs/LoadDeck.php

Load a deck by its ID.

Query Parameters:

Parameter Type Description
gameName integer The ID of the deck to load

Example Response:

{
    "deckId": 12345,
    "name": "Example Deck",
    "hero": "Red Hero",
    "cards": [
        {
            "cardId": "CARD123",
            "count": 3
        },
        // More cards...
    ]
}

Melee Tournaments API

Access information about Melee tournaments including tournament details, links, and dates.

Get Melee Tournaments

GET /TCGEngine/APIs/GetMeleeTournaments.php

Retrieve a list of Melee tournaments with optional filtering and pagination.

Query Parameters:

Parameter Type Description
id integer (Optional) Specific tournament ID to retrieve
limit integer (Optional) Maximum number of tournaments to return (default: 50)
offset integer (Optional) Number of tournaments to skip for pagination (default: 0)
date_from string (Optional) Filter tournaments after this date (YYYY-MM-DD)
date_to string (Optional) Filter tournaments before this date (YYYY-MM-DD)
sort string (Optional) Sort tournaments by field and direction (e.g., "tournamentDate DESC", default: "tournamentDate DESC")
format string (Optional) Response format: "json" or "html" (default: "json")

Example Response:

{
    "success": true,
    "total": 42,
    "count": 20,
    "offset": 0,
    "limit": 20,
    "tournaments": [
        {
            "id": 1,
            "name": "Star Wars: Unlimited Sector Qualifier - Milan, Italy | Melee",
            "date": "2025-03-30",
            "link": 270771,
            "melee_url": "https://melee.gg/tournament/270771"
        },
        // More tournaments...
    ]
}