00:00 / 00:00

Subspace Institute

嗶哩嗶哩頭像即服務

提供一個使用者 UID,即回傳對應的嗶哩嗶哩使用者頭像,此 API 主要用於 LAPLACE Chat 彈幕機 中部分事件的頭像顯示

  • API Base: https://workers.vrp.moe/bilibili/avatar/<uid>
  • Params
    • uid: 使用者 UID
  • Queries
    • size?: 頭像尺寸,預設為 240
  • Backend Caching: 300 秒
  • Client Caching: 600 秒

Why?

由於嗶哩嗶哩的頭像圖片不允許 CORS 跨來源存取,且頭像 URL 以 hash 的形式無序提供,因此需要一個中介服務來代理頭像圖片的取得

function Avatar() {
  return (
    <img
      src={`https://workers.vrp.moe/bilibili/avatar/2132180406`}
      referrerPolicy="no-referrer"
      loading="lazy"
      alt="头像"
    />
  );
}

最後更新於 2026年9月19日

Tech otakus destroy the world