Minecraft

Minecraft Java 服务器状态卡片

GET/minecraft/java/card
公开访问

访问类别:匿名 API,可携带 Token 使用独立额度

请求参数

hostquery必填
string · 最短:1 字符 · 最长:253 字符
portquery
显式填写时使用该端口;省略时对域名查询 SRV,无 SRV 时使用 25565
integer · 显式填写时使用该端口;省略时对域名查询 SRV,无 SRV 时使用 25565 · 最小值:1 · 最大值:65535
themequery
default 现有深蓝、classic 游戏风格、emerald 翡翠深色、light 简洁浅色、compact 紧凑横幅
string · default 现有深蓝、classic 游戏风格、emerald 翡翠深色、light 简洁浅色、compact 紧凑横幅 · 默认值:"default" · 可选:default、classic、emerald、light、compact

响应

200 五种样式的 SVG,含服务器图标、彩色 MOTD、版本、人数和 Worker 查询耗时;缓存 30 秒

image/svg+xml

{
  "type": "string"
}
400 请求校验或执行失败

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "issues": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "location": {
                "type": "string",
                "enum": [
                  "body",
                  "query",
                  "path",
                  "header"
                ]
              },
              "field": {
                "type": "string"
              },
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "location",
              "field",
              "code",
              "message"
            ]
          }
        }
      },
      "required": [
        "code",
        "message"
      ]
    }
  },
  "required": [
    "error"
  ]
}
401 凭据无效、停用、过期或缺少所需 Token

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "issues": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "location": {
                "type": "string",
                "enum": [
                  "body",
                  "query",
                  "path",
                  "header"
                ]
              },
              "field": {
                "type": "string"
              },
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "location",
              "field",
              "code",
              "message"
            ]
          }
        }
      },
      "required": [
        "code",
        "message"
      ]
    }
  },
  "required": [
    "error"
  ]
}
403 需要管理员 Token

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "issues": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "location": {
                "type": "string",
                "enum": [
                  "body",
                  "query",
                  "path",
                  "header"
                ]
              },
              "field": {
                "type": "string"
              },
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "location",
              "field",
              "code",
              "message"
            ]
          }
        }
      },
      "required": [
        "code",
        "message"
      ]
    }
  },
  "required": [
    "error"
  ]
}
413 请求体过大

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "issues": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "location": {
                "type": "string",
                "enum": [
                  "body",
                  "query",
                  "path",
                  "header"
                ]
              },
              "field": {
                "type": "string"
              },
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "location",
              "field",
              "code",
              "message"
            ]
          }
        }
      },
      "required": [
        "code",
        "message"
      ]
    }
  },
  "required": [
    "error"
  ]
}
415 请求内容类型无效

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "issues": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "location": {
                "type": "string",
                "enum": [
                  "body",
                  "query",
                  "path",
                  "header"
                ]
              },
              "field": {
                "type": "string"
              },
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "location",
              "field",
              "code",
              "message"
            ]
          }
        }
      },
      "required": [
        "code",
        "message"
      ]
    }
  },
  "required": [
    "error"
  ]
}
429 请求过于频繁,Retry-After 为建议等待秒数;匿名额度及认证保护在各 Cloudflare 地点近似计数,Token 业务额度使用 D1 原子计数

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "issues": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "location": {
                "type": "string",
                "enum": [
                  "body",
                  "query",
                  "path",
                  "header"
                ]
              },
              "field": {
                "type": "string"
              },
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "location",
              "field",
              "code",
              "message"
            ]
          }
        }
      },
      "required": [
        "code",
        "message"
      ]
    }
  },
  "required": [
    "error"
  ]
}
500 内部执行失败

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "issues": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "location": {
                "type": "string",
                "enum": [
                  "body",
                  "query",
                  "path",
                  "header"
                ]
              },
              "field": {
                "type": "string"
              },
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "location",
              "field",
              "code",
              "message"
            ]
          }
        }
      },
      "required": [
        "code",
        "message"
      ]
    }
  },
  "required": [
    "error"
  ]
}
502 请求校验或执行失败

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "issues": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "location": {
                "type": "string",
                "enum": [
                  "body",
                  "query",
                  "path",
                  "header"
                ]
              },
              "field": {
                "type": "string"
              },
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "location",
              "field",
              "code",
              "message"
            ]
          }
        }
      },
      "required": [
        "code",
        "message"
      ]
    }
  },
  "required": [
    "error"
  ]
}
504 请求校验或执行失败

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "issues": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "location": {
                "type": "string",
                "enum": [
                  "body",
                  "query",
                  "path",
                  "header"
                ]
              },
              "field": {
                "type": "string"
              },
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "location",
              "field",
              "code",
              "message"
            ]
          }
        }
      },
      "required": [
        "code",
        "message"
      ]
    }
  },
  "required": [
    "error"
  ]
}

响应示例

运行命令前,将环境变量 BASE_URL 设置为站点地址。

成功响应

curl --silent --show-error -H 'User-Agent: simpleWebUtils-example/1.1.0' -H 'Accept: application/json' "$BASE_URL"'/minecraft/java/card?host=mc.hypixel.net&port=25565&theme=emerald'
HTTP 200
content-type: image/svg+xml; charset=utf-8
content-encoding: gzip
cache-control: public, max-age=30

<svg xmlns="http://www.w3.org/2000/svg" width="960" height="350" viewBox="0 0 960 350" role="img" aria-label="mc.hypixel.net:25565 · 19412 / 200000"><title>mc.hypixel.net:25565 · 19412 / 200000</title><desc>                 Hypixel Network [1.8/26.3]
              SKYBLOCK GHOST VISITORS</desc><defs><linearGradient id="background" x2="1" y2="1"><stop stop-color="#102d29"/><stop offset="1" stop-color="#091715"/></linearGradient><clipPath id="motd"><rect x="40" y="137" width="880" height="58"/></clipPath></defs><rect width="960" height="350" rx="24" fill="url(#background)"/><rect x="1" y="1" width="958" height="348" rx="24" fill="none" stroke="#28564b"/><path d="M32 1H220" stroke="#71efac" stroke-width="3"/><g font-family="ui-monospace,monospace" fill="#effff8"><image x="24" y="24" width="64" height="64" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAt0UlEQVR4XnV7B3hc1bX12Oq9Te+9d400TV2yLFndkiXZlm1Z7r3gChibEhwgiQ1JSELCgzyaqYFQQggvCQ/SXx6QkBgMJCZAIGBiMMbdWv86d2Qbkvf7+/Z3PTOambvXWXvttc+9IzObAr/oGh47Om/VCrSNLMD6q67Dpj3XY8boIqT6hpHuH0GaR/H/i9E7B7G2bun4hef/j2icPYLGwamQ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Z8mLVmPQa2X46G4UVQh6jGDg9mD43iRz96Fsc/O4Ezp47jg18/h8G6NEpcYdT2jMDn8OHqzgF8bWgYL94/gbOnbmLC+zA5+W3G7Th39nUc++e72L1iE0aqZ2BIpsd8CfBSVDpi0ormFldANi0LGibvZuJuVWAKACsUZIGizIgSCqIAwMJOJABomTN3qgQuAqCHicnpqOg2rr6NVA8QhBAjUWlCPSlUkVcMWQ5XPLcIeflF7NsyVJ
… 已截断,完整响应 18842 字符

错误示例

curl --silent --show-error -H 'User-Agent: simpleWebUtils-example/1.1.0' -H 'Accept: application/json' "$BASE_URL"'/minecraft/java/card?host=invalid+value&port=25565&theme=emerald'
HTTP 400
content-type: application/json
content-encoding: gzip
cache-control: no-store

{
  "error": {
    "code": "INVALID_INPUT",
    "message": "参数无效",
    "issues": [
      {
        "location": "query",
        "field": "host",
        "code": "custom",
        "message": "Invalid input"
      }
    ]
  }
}

在线调试

必填
Ctrl / ⌘ + Enter
调用示例
curl -X GET 'https://oit.sh/minecraft/java/card?host=mc.hypixel.net'

响应

等待请求

等待发送请求

配置上方请求参数后点击「发送请求」查看实时响应

快捷键:Ctrl / ⌘ + Enter