Minecraft

查询 Minecraft Java 状态与 MOTD

GET/minecraft/java
公开访问

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

请求参数

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

响应

200 服务器状态;latencyMs 包括 SRV、地址解析、TCP 连接与状态响应

application/json

{
  "type": "object",
  "properties": {
    "host": {
      "type": "string"
    },
    "port": {
      "type": "integer",
      "minimum": 1,
      "maximum": 65535
    },
    "address": {
      "type": "string"
    },
    "resolved": {
      "type": "object",
      "properties": {
        "host": {
          "type": "string"
        },
        "port": {
          "type": "integer",
          "minimum": 1,
          "maximum": 65535
        },
        "srv": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "target": {
              "type": "string"
            },
            "port": {
              "type": "integer",
              "minimum": 1,
              "maximum": 65535
            },
            "priority": {
              "type": "integer",
              "minimum": 0,
              "maximum": 65535
            },
            "weight": {
              "type": "integer",
              "minimum": 0,
              "maximum": 65535
            }
          },
          "required": [
            "target",
            "port",
            "priority",
            "weight"
          ]
        }
      },
      "required": [
        "host",
        "port",
        "srv"
      ]
    },
    "version": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "protocol": {
          "type": "integer"
        }
      },
      "required": [
        "name",
        "protocol"
      ]
    },
    "players": {
      "type": "object",
      "properties": {
        "online": {
          "type": "integer",
          "minimum": 0
        },
        "max": {
          "type": "integer",
          "minimum": 0
        },
        "sample": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "id": {
                "type": "string"
              }
            },
            "required": [
              "name",
              "id"
            ]
          }
        }
      },
      "required": [
        "online",
        "max",
        "sample"
      ]
    },
    "motd": {},
    "motdText": {
      "type": "string"
    },
    "motdFormatted": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string"
          },
          "color": {
            "type": "string",
            "pattern": "^#[0-9a-fA-F]{6}$"
          },
          "bold": {
            "type": "boolean"
          },
          "italic": {
            "type": "boolean"
          },
          "underlined": {
            "type": "boolean"
          },
          "strikethrough": {
            "type": "boolean"
          },
          "obfuscated": {
            "type": "boolean"
          }
        },
        "required": [
          "text",
          "color",
          "bold",
          "italic",
          "underlined",
          "strikethrough",
          "obfuscated"
        ]
      }
    },
    "favicon": {
      "type": [
        "string",
        "null"
      ]
    },
    "rawStatus": {
      "type": "object",
      "additionalProperties": true,
      "description": "服务器返回的完整状态 JSON,保留嵌套对象中的扩展字段。"
    },
    "extensions": {
      "type": "object",
      "additionalProperties": true,
      "description": "除 version、players、description、favicon 外的全部原始顶层字段,包含 Forge、其他服务端和自定义元数据。"
    },
    "modLoaders": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "encoding": {
            "type": "string",
            "enum": [
              "json",
              "optimized"
            ]
          },
          "fmlNetworkVersion": {
            "type": [
              "integer",
              "null"
            ]
          },
          "truncated": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "mods": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "version": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "marker": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "version",
                "marker"
              ]
            }
          },
          "channels": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "version": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "integer"
                    }
                  ]
                },
                "required": {
                  "type": "boolean"
                }
              },
              "required": [
                "name",
                "version",
                "required"
              ]
            }
          }
        },
        "required": [
          "type",
          "source",
          "encoding",
          "fmlNetworkVersion",
          "truncated",
          "mods",
          "channels"
        ]
      },
      "description": "从 modinfo 和 forgeData 整理的模组及通道信息;marker 为兼容性标记;truncated 为 null 表示服务器未声明列表完整性。"
    },
    "latencyMs": {
      "type": "integer",
      "minimum": 0
    },
    "timings": {
      "type": "object",
      "properties": {
        "dnsMs": {
          "type": "integer",
          "minimum": 0
        },
        "connectMs": {
          "type": "integer",
          "minimum": 0
        },
        "statusMs": {
          "type": "integer",
          "minimum": 0
        }
      },
      "required": [
        "dnsMs",
        "connectMs",
        "statusMs"
      ]
    }
  },
  "required": [
    "host",
    "port",
    "address",
    "resolved",
    "version",
    "players",
    "motdText",
    "motdFormatted",
    "favicon",
    "rawStatus",
    "extensions",
    "modLoaders",
    "latencyMs",
    "timings"
  ],
  "description": "原始 MOTD、纯文本与格式片段;favicon 为经过校验的 64×64 PNG data URL;players.sample 为服务器提供的样本,缺少时为 null。port 保留请求端口(省略时 25565),resolved 表示实际连接目标。timings 各阶段之和等于 latencyMs,均由 Worker 测量。"
}
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?host=mc.hypixel.net'

响应

等待请求