{
  "openapi": "3.1.0",
  "info": {
    "title": "DropSiren public API",
    "version": "1.0.0",
    "summary": "Casino bonus drop codes from the official Telegram channels of ten casinos, as JSON or CSV.",
    "description": "Two read-only GET endpoints. Free, no API key, no sign-up, CORS open (Access-Control-Allow-Origin: *).\n\n- /api/v1/codes: the latest codes. Cached for 60 seconds at the edge (Cache-Control: s-maxage=60, stale-while-revalidate=120, so a copy up to 2 minutes older can be served while a fresh one loads).\n- /api/v1/export: every code we tracked in a month, or every month for the kinds you name. Cached for an hour (max-age=3600, s-maxage=3600).\n\nThe data is CC BY 4.0: credit DropSiren (dropsiren.com) wherever it is shown; a link is appreciated, and nofollow is fine. Every status is derived from the code's age (and from a casino's own stated expiry where it prints one), not from testing the code on an account. Reader reports are unverified. claimUrl may carry DropSiren's referral parameter, which can earn us a commission.",
    "contact": { "name": "DropSiren", "url": "https://dropsiren.com/about" },
    "license": { "name": "CC BY 4.0", "identifier": "CC-BY-4.0" }
  },
  "externalDocs": { "description": "Widget and API docs", "url": "https://dropsiren.com/widget" },
  "servers": [{ "url": "https://dropsiren.com" }],
  "tags": [
    { "name": "codes", "description": "The latest codes." },
    { "name": "export", "description": "Monthly and per-kind downloads. Columns are described on https://dropsiren.com/data." }
  ],
  "paths": {
    "/api/v1/codes": {
      "get": {
        "tags": ["codes"],
        "operationId": "listCodes",
        "summary": "Latest codes, newest first",
        "description": "Newest first by postedAt. With status set, the newest min(400, limit × 8) codes are read and then filtered, so count can come back below limit even when older codes with that status exist.",
        "parameters": [
          { "$ref": "#/components/parameters/CodesPlatform" },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Age-based status to keep. Omit for every status. Any other value returns no items.",
            "schema": { "$ref": "#/components/schemas/Status" }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many codes to return. Values outside 1 to 100 are clamped; a missing, zero or non-numeric value means 25.",
            "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 25 }
          }
        ],
        "responses": {
          "200": {
            "description": "The latest codes.",
            "headers": {
              "Access-Control-Allow-Origin": { "$ref": "#/components/headers/AllowOrigin" }
            },
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/CodesResponse" }
              }
            }
          }
        }
      },
      "options": {
        "tags": ["codes"],
        "operationId": "codesPreflight",
        "summary": "CORS preflight",
        "responses": {
          "204": {
            "description": "No body. Allows GET and OPTIONS from any origin, with any request header.",
            "headers": {
              "Access-Control-Allow-Origin": { "$ref": "#/components/headers/AllowOrigin" },
              "Access-Control-Allow-Methods": { "schema": { "type": "string", "const": "GET, OPTIONS" } },
              "Access-Control-Allow-Headers": { "schema": { "type": "string", "const": "*" } }
            }
          }
        }
      }
    },
    "/api/v1/export": {
      "get": {
        "tags": ["export"],
        "operationId": "exportCodes",
        "summary": "Every code in a month (or every month for the kinds named), as CSV or JSON",
        "description": "Oldest first by postedAt, at most 20,000 rows per request. month is required unless kind is set; with kind set and month left out, every month is returned. Example: /api/v1/export?kind=weekly_boost&platform=stakecom&format=csv is every Stake weekly boost so far.",
        "parameters": [
          {
            "name": "month",
            "in": "query",
            "required": false,
            "description": "UTC calendar month, YYYY-MM. Required unless kind is set.",
            "schema": { "type": "string", "pattern": "^\\d{4}-(0[1-9]|1[0-2])$" },
            "example": "2026-10"
          },
          {
            "name": "platform",
            "in": "query",
            "required": false,
            "description": "One platform. Omit for all. An unknown value is a 400.",
            "schema": { "$ref": "#/components/schemas/Platform" }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "description": "One or more kinds, comma-separated (for example drop,promo_drop). Omit for every kind. An unknown kind is a 400.",
            "style": "form",
            "explode": false,
            "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Kind" } }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "csv (the default) or json. Any value other than json returns CSV.",
            "schema": { "type": "string", "enum": ["csv", "json"], "default": "csv" }
          }
        ],
        "responses": {
          "200": {
            "description": "The rows. CSV comes as an attachment (dropsiren-codes-<month or all>[-<platform>][-<kinds>].csv) with a header row in the order of ExportRow; empty cells are nulls. JSON comes inline with the same rows under items.",
            "headers": {
              "Access-Control-Allow-Origin": { "$ref": "#/components/headers/AllowOrigin" },
              "X-License": { "description": "Always CC BY 4.0.", "schema": { "type": "string", "const": "CC BY 4.0" } },
              "X-Attribution": { "description": "Data by DropSiren (dropsiren.com), CC BY 4.0", "schema": { "type": "string" } },
              "Content-Disposition": { "description": "attachment for CSV, inline for JSON, with the file name.", "schema": { "type": "string" } }
            },
            "content": {
              "text/csv": {
                "schema": { "type": "string" },
                "example": "code,platform,casino,kind,currency,value,pool,wagerReq,wagerDays,claims,validUntil,postedAt,sourceChannel,sourceUrl,workedReports,failedReports,title\nUNSCRAM_LE-03-adi8,winna,winna,drop,USD,3,600,9000,7,200,,2026-10-01T07:29:01.000Z,winna,https://t.me/Winna/1162,0,0,"
              },
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ExportResponse" }
              }
            }
          },
          "400": {
            "description": "Bad parameters: a missing or malformed month (with no kind), an unknown kind, or an unknown platform.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["error"],
                  "properties": { "error": { "type": "string" } }
                },
                "examples": {
                  "month": { "value": { "error": "month=YYYY-MM required (or kind=... for every month)" } },
                  "platform": { "value": { "error": "unknown platform" } }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "headers": {
      "AllowOrigin": { "description": "CORS is open to every origin.", "schema": { "type": "string", "const": "*" } }
    },
    "parameters": {
      "CodesPlatform": {
        "name": "platform",
        "in": "query",
        "required": false,
        "description": "One platform. Omit for all. An unknown value is ignored, and every platform is returned.",
        "schema": { "$ref": "#/components/schemas/Platform" }
      }
    },
    "schemas": {
      "Platform": {
        "type": "string",
        "description": "stakecom = Stake.com, stakeus = Stake.us, shuffleus = Shuffle.us.",
        "enum": ["stakecom", "stakeus", "rainbet", "shuffle", "shuffleus", "thrill", "goated", "gamba", "duelbits", "winna"]
      },
      "Casino": {
        "type": "string",
        "description": "Casino family: stake covers stakecom and stakeus, shuffle covers shuffle and shuffleus.",
        "enum": ["stake", "rainbet", "shuffle", "thrill", "goated", "gamba", "duelbits", "winna"]
      },
      "Kind": {
        "type": "string",
        "description": "drop = an everyday drop code; promo_drop = a code embedded in a main-channel promo post; weekly_boost and monthly_bonus = Stake's VIP links (most relayed by a community-run channel, some posted on Stake's main channel; see origin and sourceChannel); weekly_giveaway, forum_result, monthly_promo and forum = Stake Community forum codes; bonus = another named Stake bonus link; community = reader-submitted, unverified.",
        "enum": ["drop", "promo_drop", "weekly_boost", "monthly_bonus", "weekly_giveaway", "forum_result", "monthly_promo", "forum", "bonus", "community"]
      },
      "Status": {
        "type": "string",
        "description": "Derived from the code's age, with windows that depend on its kind (and a casino's stated expiry where it prints one). Never from testing the code. See https://dropsiren.com/methodology.",
        "enum": ["live", "likely_claimed", "expired"]
      },
      "Origin": {
        "type": "string",
        "description": "telegram = an official casino channel; forum = Stake's official community forum; relay = a community-run channel relaying Stake's own claim link; reader = submitted by a reader, unverified.",
        "enum": ["telegram", "forum", "relay", "reader"]
      },
      "Currency": {
        "type": "string",
        "description": "USD, or SC (sweepstakes coins: Stake.us and Shuffle.us). Every amount on a code is in this currency.",
        "enum": ["USD", "SC"]
      },
      "Code": {
        "type": "object",
        "additionalProperties": false,
        "required": ["code", "platform", "kind", "title", "value", "currency", "pool", "claims", "wagerRequirement", "wagerWindowDays", "gateNote", "postedAt", "status", "statusBasis", "origin", "url", "claimUrl"],
        "properties": {
          "code": { "type": "string", "description": "The code as posted (emoji removed where a casino puts them inside codes)." },
          "platform": { "$ref": "#/components/schemas/Platform" },
          "kind": { "$ref": "#/components/schemas/Kind" },
          "title": { "type": ["string", "null"], "description": "Named codes only: our label, for example a weekly boost's week range and the total Stake announced." },
          "value": { "type": ["number", "null"], "description": "The stated value of the code, in currency." },
          "currency": { "$ref": "#/components/schemas/Currency" },
          "pool": { "type": ["number", "null"], "description": "The claim pool in currency: stated by Stake, claims × value for casinos that state a claim count." },
          "claims": { "type": ["integer", "null"], "description": "The published claim count, or pool ÷ value rounded where only a pool is published." },
          "wagerRequirement": { "type": ["number", "null"], "description": "Amount wagered (or SC played) the code asks for in the trailing window, in currency. Null when the code has no wager gate." },
          "wagerWindowDays": { "type": ["integer", "null"], "description": "Length of that window in days. Null when the code has no wager gate." },
          "gateNote": { "type": ["string", "null"], "description": "Set only when the code states no wager amount and its source asks for something else instead (Duelbits: a deposit in the last 7 days). Null otherwise." },
          "postedAt": { "type": "string", "format": "date-time", "description": "UTC time of the source post." },
          "status": { "$ref": "#/components/schemas/Status" },
          "statusBasis": { "type": "string", "const": "age-based; see url for details" },
          "origin": { "$ref": "#/components/schemas/Origin" },
          "url": { "type": "string", "format": "uri", "description": "The code's record page on dropsiren.com." },
          "claimUrl": { "type": "string", "format": "uri", "description": "Where to use the code: the casino's offers or redeem page where it has a direct one (Stake.com, Stake.us, Goated), otherwise its home page; for named Stake codes, Stake's own claim link. May carry DropSiren's referral parameter." }
        }
      },
      "CodesResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": ["source", "docs", "license", "attribution", "claimUrlNote", "generatedAt", "count", "items"],
        "properties": {
          "source": { "type": "string", "format": "uri", "const": "https://dropsiren.com" },
          "docs": { "type": "string", "format": "uri", "const": "https://dropsiren.com/widget" },
          "license": { "type": "string", "const": "CC BY 4.0" },
          "attribution": { "type": "string" },
          "claimUrlNote": { "type": "string" },
          "generatedAt": { "type": "string", "format": "date-time", "description": "When this response was built (UTC); with the edge cache it can be older than the request." },
          "count": { "type": "integer", "minimum": 0, "maximum": 100 },
          "items": { "type": "array", "items": { "$ref": "#/components/schemas/Code" } }
        },
        "example": {
          "source": "https://dropsiren.com",
          "docs": "https://dropsiren.com/widget",
          "license": "CC BY 4.0",
          "attribution": "Credit DropSiren (dropsiren.com) wherever this data is shown; a link is appreciated, nofollow is fine.",
          "claimUrlNote": "claimUrl may carry DropSiren's referral parameter, which can earn us a commission.",
          "generatedAt": "2026-10-31T23:20:30.403Z",
          "count": 1,
          "items": [
            {
              "code": "5NGG0CIJ",
              "platform": "rainbet",
              "kind": "drop",
              "title": null,
              "value": 5,
              "currency": "USD",
              "pool": 1000,
              "claims": 200,
              "wagerRequirement": 15000,
              "wagerWindowDays": 3,
              "gateNote": null,
              "postedAt": "2026-10-31T21:37:00.000Z",
              "status": "live",
              "statusBasis": "age-based; see url for details",
              "origin": "telegram",
              "url": "https://dropsiren.com/codes/5NGG0CIJ",
              "claimUrl": "https://rainbet.com/?r=dropsiren"
            }
          ]
        }
      },
      "ExportRow": {
        "type": "object",
        "additionalProperties": false,
        "required": ["code", "platform", "casino", "kind", "currency", "value", "pool", "wagerReq", "wagerDays", "claims", "validUntil", "postedAt", "sourceChannel", "sourceUrl", "workedReports", "failedReports", "title"],
        "properties": {
          "code": { "type": "string" },
          "platform": { "$ref": "#/components/schemas/Platform" },
          "casino": { "$ref": "#/components/schemas/Casino" },
          "kind": { "$ref": "#/components/schemas/Kind" },
          "currency": { "$ref": "#/components/schemas/Currency" },
          "value": { "type": ["number", "null"], "description": "Stated value, in currency." },
          "pool": { "type": ["number", "null"], "description": "Claim pool, in currency." },
          "wagerReq": { "type": ["number", "null"], "description": "Wager (or SC played) gate, in currency." },
          "wagerDays": { "type": ["integer", "null"], "description": "The gate's window in days, as the post states it. Null without a wager gate." },
          "claims": { "type": ["integer", "null"], "description": "Published claim count, or pool ÷ value rounded." },
          "validUntil": { "type": ["string", "null"], "format": "date-time", "description": "Stated expiry, where the casino prints one." },
          "postedAt": { "type": "string", "format": "date-time", "description": "UTC time of the source post." },
          "sourceChannel": { "type": "string", "description": "Channel slug: an official channel, community:<board> for Stake's forum, StakeCasinoVIP for the community relay of Stake's own claim links, reader:<platform> for reader submissions." },
          "sourceUrl": { "type": ["string", "null"], "format": "uri", "description": "Link to the source post." },
          "workedReports": { "type": "integer", "minimum": 0, "description": "Reader reports that the code worked, at export time. Unverified." },
          "failedReports": { "type": "integer", "minimum": 0, "description": "Reader reports that it didn't, at export time. Unverified." },
          "title": { "type": ["string", "null"], "description": "Named codes only: our label." }
        }
      },
      "ExportResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": ["source", "license", "licenseUrl", "attribution", "month", "platform", "kind", "count", "columns", "items"],
        "properties": {
          "source": { "type": "string", "format": "uri", "const": "https://dropsiren.com" },
          "license": { "type": "string", "const": "CC BY 4.0" },
          "licenseUrl": { "type": "string", "format": "uri", "const": "https://creativecommons.org/licenses/by/4.0/" },
          "attribution": { "type": "string" },
          "month": { "type": "string", "description": "The month asked for, or all." },
          "platform": { "type": "string", "description": "The platform asked for, or all." },
          "kind": { "type": "string", "description": "The kinds asked for, comma-separated, or all." },
          "count": { "type": "integer", "minimum": 0, "maximum": 20000 },
          "columns": {
            "type": "array",
            "description": "Column order, the same as the CSV header row.",
            "items": { "type": "string" },
            "const": ["code", "platform", "casino", "kind", "currency", "value", "pool", "wagerReq", "wagerDays", "claims", "validUntil", "postedAt", "sourceChannel", "sourceUrl", "workedReports", "failedReports", "title"]
          },
          "items": { "type": "array", "items": { "$ref": "#/components/schemas/ExportRow" } }
        }
      }
    }
  }
}
