Minecraft

Minecraft Java 在线人数徽章

GET/minecraft/java/badge
公开访问

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

请求参数

hostquery必填
string · 最短:1 字符 · 最长:253 字符
portquery
显式填写时使用该端口;省略时对域名查询 SRV,无 SRV 时使用 25565
integer · 显式填写时使用该端口;省略时对域名查询 SRV,无 SRV 时使用 25565 · 最小值:1 · 最大值:65535

响应

200 人数 SVG 徽章,缓存 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"
  ]
}

在线调试

必填
调用示例
curl -X GET 'https://evax.top/minecraft/java/badge?host=mc.hypixel.net'

响应

等待请求