import{_ as t,c as e,b as s,a as i,d as l,e as o,w as p,r as c,o as D}from"./app-Dgsdh8A6.js";const r={};function u(d,n){const a=c("RouteLink");return D(),e("div",null,[n[22]||(n[22]=s("h2",{id:"空间图文",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#空间图文"},[s("span",null,"空间图文")])],-1)),n[23]||(n[23]=s("h2",{id:"获取用户空间图文",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#获取用户空间图文"},[s("span",null,"获取用户空间图文")])],-1)),n[24]||(n[24]=s("blockquote",null,[s("p",null,"https://api.bilibili.com/x/polymer/web-dynamic/v1/opus/feed/space")],-1)),n[25]||(n[25]=s("p",null,[s("em",null,"请求方法: GET")],-1)),s("p",null,[n[1]||(n[1]=l("注: 该接口")),n[2]||(n[2]=s("strong",null,"只能",-1)),n[3]||(n[3]=l("获取图文信息, 无法获取如转发动态一类的内容, 如需获取参见 ")),o(a,{to:"/docs/opus/docs/dynamic/space.html"},{default:p(()=>n[0]||(n[0]=[l("获取用户空间动态")])),_:1,__:[0]})]),n[26]||(n[26]=s("p",null,[s("strong",null,"URL 参数:")],-1)),s("table",null,[n[21]||(n[21]=s("thead",null,[s("tr",null,[s("th",null,"参数名"),s("th",null,"类型"),s("th",null,"内容"),s("th",null,"必要性"),s("th",null,"备注")])],-1)),s("tbody",null,[n[16]||(n[16]=s("tr",null,[s("td",null,"host_mid"),s("td",null,"number"),s("td",null,"被获取用户的 mid (UID)"),s("td",null,"必要"),s("td")],-1)),n[17]||(n[17]=s("tr",null,[s("td",null,"page"),s("td",null,"number"),s("td",null,"假装自己是分页信息"),s("td",null,"不必要"),s("td",null,[l("以 "),s("code",null,"1"),l(" 开始")])],-1)),n[18]||(n[18]=s("tr",null,[s("td",null,"offset"),s("td",null,"number"),s("td",null,"偏移信息"),s("td",null,"不必要"),s("td",null,[l("上一次返回的 "),s("code",null,"offset"),l(" (同时也是最后一条的 opus id), 默认为空")])],-1)),n[19]||(n[19]=s("tr",null,[s("td",null,"type"),s("td",null,"string"),s("td",null,"类型"),s("td",null,"不必要"),s("td",null,[l("all: 全部 (默认)"),s("br"),l("article: 专栏"),s("br"),l("dynamic: 动态")])],-1)),n[20]||(n[20]=s("tr",null,[s("td",null,"web_location"),s("td",null,"string"),s("td",null,[s("code",null,"333.1387")]),s("td",null,"不必要"),s("td")],-1)),s("tr",null,[n[6]||(n[6]=s("td",null,"w_rid",-1)),n[7]||(n[7]=s("td",null,"string",-1)),n[8]||(n[8]=s("td",null,"WBI 签名",-1)),n[9]||(n[9]=s("td",null,"不必要",-1)),s("td",null,[n[5]||(n[5]=l("参见 ")),o(a,{to:"/docs/misc/sign/wbi.html"},{default:p(()=>n[4]||(n[4]=[l("WBI 签名")])),_:1,__:[4]})])]),s("tr",null,[n[12]||(n[12]=s("td",null,"wts",-1)),n[13]||(n[13]=s("td",null,"number",-1)),n[14]||(n[14]=s("td",null,"UNIX 秒级时间戳",-1)),n[15]||(n[15]=s("td",null,"不必要",-1)),s("td",null,[n[11]||(n[11]=l("参见 ")),o(a,{to:"/docs/misc/sign/wbi.html"},{default:p(()=>n[10]||(n[10]=[l("WBI 签名")])),_:1,__:[10]})])])])]),n[27]||(n[27]=i(`

JSON 回复:

根对象:

字段类型内容备注
codenumber返回值0: 成功
dataobject数据本体
messagestring错误信息成功时为 0
ttlnumber1

data 对象:

字段类型内容备注
has_moreboolean是否还有更多
itemsobject[]信息本体
offsetstring偏移信息下次翻页请求时传入的 offest (同时也是最后一条的 opus id)
update_numnumber更新数?0

data.items[] 对象:

字段类型内容备注
contentstring文本内容
coverobject?封面信息
jump_urlstring跳转 URL
opus_idstringopus id
statobject统计信息

data.items[].cover 对象:

字段类型内容备注
heightnumber高度
urlstring图片 URL
widthnumber宽度

data.items[].stat 对象:

字段类型内容备注
likestring点赞数是个字符串
viewstring浏览数仅当获取登录状态下获取自己的时才存在, 也是个字符串

示例:

获取 645769214 空间的最近几条全部图文

curl 'https://api.bilibili.com/x/polymer/web-dynamic/v1/opus/feed/space' \\
--url-query 'host_mid=645769214'
查看响应示例:
{
  "code": 0,
  "data": {
    "has_more": true,
    "items": [
      {
        "content": "我在 Google I/O 2025 的 puzzle 取得了获胜的优异成绩, 你也来试试吧",
        "cover": {
          "height": 1640,
          "url": "http://i0.hdslb.com/bfs/new_dyn/a48c47c07bf19f07c01b489eb6b42e63645769214.jpg",
          "width": 720
        },
        "jump_url": "//www.bilibili.com/opus/1057955152016703512",
        "opus_id": "1057955152016703512",
        "stat": {
          "like": "1"
        }
      },
      {
        "content": "通过 DevTools 绕过 SSR 抓包某站专栏正文接口",
        "cover": {
          "height": 430,
          "url": "http://i0.hdslb.com/bfs/article/9071997152b6fec0ae465fe2a86b580e645769214.jpg",
          "width": 768
        },
        "jump_url": "//www.bilibili.com/opus/1056353752004427792",
        "opus_id": "1056353752004427792",
        "stat": {
          "like": "3"
        }
      },
      {
        "content": "今天也是看上 Minecraft 大电影 了, 看的人几乎没有, 虽然看的是中配, 总体上感觉剧情有趣甚至有点小感动, 音乐也感觉不错, 价格也实惠",
        "cover": {
          "height": 4080,
          "url": "http://i0.hdslb.com/bfs/new_dyn/408d4e2b2ad8df6873c303cf26f571db645769214.jpg",
          "width": 3060
        },
        "jump_url": "//www.bilibili.com/opus/1052711525276450824",
        "opus_id": "1052711525276450824",
        "stat": {
          "like": "3"
        }
      },
      {
        "content": "糟了没注意, 自己成小丑了",
        "cover": {
          "height": 1640,
          "url": "http://i0.hdslb.com/bfs/new_dyn/6ebb3894cfab53966d6e440e4f5a905d645769214.jpg",
          "width": 720
        },
        "jump_url": "//www.bilibili.com/opus/1051313732437671938",
        "opus_id": "1051313732437671938",
        "stat": {
          "like": "3"
        }
      },
      {
        "content": "好消息, 我免费了, 想玩的随时联系\\nhttps://t.me/c/2148747379/77",
        "cover": {
          "height": 720,
          "url": "http://i0.hdslb.com/bfs/new_dyn/fbc2b38406099df0bdaea47d08daa6f1645769214.jpg",
          "width": 1640
        },
        "jump_url": "//www.bilibili.com/opus/1050579658107518984",
        "opus_id": "1050579658107518984",
        "stat": {
          "like": "2"
        }
      },
      {
        "content": "认真的, 我的 Linux 发行版是 Android",
        "cover": {
          "height": 1080,
          "url": "http://i0.hdslb.com/bfs/new_dyn/3e512d84361323c319f79061d2f078d1645769214.jpg",
          "width": 1440
        },
        "jump_url": "//www.bilibili.com/opus/1032607998809210903",
        "opus_id": "1032607998809210903",
        "stat": {
          "like": "8"
        }
      },
      {
        "content": "于学校机房启动 QEMU 珍贵影像",
        "cover": {
          "height": 1080,
          "url": "http://i0.hdslb.com/bfs/new_dyn/2fdc7524449b029f8baf241d94663256645769214.jpg",
          "width": 1440
        },
        "jump_url": "//www.bilibili.com/opus/993403941079220225",
        "opus_id": "993403941079220225",
        "stat": {
          "like": "3"
        }
      },
      {
        "content": "BAC 正处于历史以来最困难的时期 - 中秋考古有感",
        "cover": {
          "height": 188,
          "url": "https://i0.hdslb.com/bfs/article/0c9b5e20356e07f89a8bb7769fef8eeb645769214.jpg",
          "width": 640
        },
        "jump_url": "//www.bilibili.com/opus/985444108243828741",
        "opus_id": "985444108243828741",
        "stat": {
          "like": "7"
        }
      },
      {
        "content": "发送文件到手机的 N 种正确姿势",
        "cover": {
          "height": 420,
          "url": "http://i0.hdslb.com/bfs/article/56a4024abebf7ed1166a1d247bb5cf64645769214.jpg",
          "width": 750
        },
        "jump_url": "//www.bilibili.com/opus/971804623539011587",
        "opus_id": "971804623539011587",
        "stat": {
          "like": "8"
        }
      },
      {
        "content": "我在朝鲜?",
        "cover": {
          "height": 468,
          "url": "http://i0.hdslb.com/bfs/new_dyn/ea12cca6abd75fe3fb5ad1abd1f347d3645769214.png",
          "width": 474
        },
        "jump_url": "//www.bilibili.com/opus/971255284349534210",
        "opus_id": "971255284349534210",
        "stat": {
          "like": "5"
        }
      },
      {
        "content": "一周没上 B 站就 99+ 了?",
        "cover": {
          "height": 284,
          "url": "http://i0.hdslb.com/bfs/new_dyn/9e3b889fd2dc75e9bae38a13e55fee26645769214.png",
          "width": 165
        },
        "jump_url": "//www.bilibili.com/opus/970197833343827970",
        "opus_id": "970197833343827970",
        "stat": {
          "like": "6"
        }
      },
      {
        "content": "今天因为Linux被骂, 决定放弃支持 Windows. 而且明天要开始军训了, 将停更若干时间, 遂发此动态, 望不知.",
        "cover": {
          "height": 1080,
          "url": "http://i0.hdslb.com/bfs/new_dyn/0f6f939334104ddc347566514fa4bfa7645769214.jpg",
          "width": 1440
        },
        "jump_url": "//www.bilibili.com/opus/967717348014293017",
        "opus_id": "967717348014293017",
        "stat": {
          "like": "73"
        }
      },
      {
        "content": "我的萌ICP备案通过了!",
        "cover": {
          "height": 2712,
          "url": "http://i0.hdslb.com/bfs/new_dyn/0a9bb3e82bbefe499b10b7fd02f2a4f4645769214.jpg",
          "width": 1220
        },
        "jump_url": "//www.bilibili.com/opus/956241611959828547",
        "opus_id": "956241611959828547",
        "stat": {
          "like": "1"
        }
      },
      {
        "content": "新年第一个AP",
        "cover": {
          "height": 1220,
          "url": "https://album.biliimg.com/bfs/new_dyn/ea5a39d37a4a1f20f32b25bfed466004645769214.jpg",
          "width": 2712
        },
        "jump_url": "//www.bilibili.com/opus/896448108088524805",
        "opus_id": "896448108088524805",
        "stat": {
          "like": "1"
        }
      },
      {
        "content": "新年快乐?",
        "cover": {
          "height": 605,
          "url": "https://album.biliimg.com/bfs/new_dyn/dab5d3e2ff03027215e5bfd4933abe45645769214.jpg",
          "width": 1220
        },
        "jump_url": "//www.bilibili.com/opus/896342627995090966",
        "opus_id": "896342627995090966",
        "stat": {
          "like": "1"
        }
      },
      {
        "content": "我回苏州了",
        "cover": {
          "height": 1280,
          "url": "https://album.biliimg.com/bfs/new_dyn/65c880f64997fab0c79527649d7fbe1b645769214.png",
          "width": 720
        },
        "jump_url": "//www.bilibili.com/opus/831507996405137432",
        "opus_id": "831507996405137432",
        "stat": {
          "like": "1"
        }
      },
      {
        "content": "Phigros RKS 12 纪念",
        "cover": {
          "height": 720,
          "url": "https://album.biliimg.com/bfs/new_dyn/dab03003aee2166987428857acbf4ffb645769214.png",
          "width": 1280
        },
        "jump_url": "//www.bilibili.com/opus/830690195959447605",
        "opus_id": "830690195959447605",
        "stat": {
          "like": "0"
        }
      },
      {
        "content": "现在知道B站推荐机制有多烂了吧",
        "cover": {
          "height": 1280,
          "url": "https://album.biliimg.com/bfs/new_dyn/05a5f769bed2705d2c8c3c69f60441df645769214.png",
          "width": 720
        },
        "jump_url": "//www.bilibili.com/opus/829284474633060387",
        "opus_id": "829284474633060387",
        "stat": {
          "like": "0"
        }
      },
      {
        "content": "求证: B站创始人们的成分\\n证: [图片]",
        "cover": {
          "height": 1600,
          "url": "https://album.biliimg.com/bfs/new_dyn/830a9bbc3d5179a6d33af97e5baac7c8645769214.jpg",
          "width": 720
        },
        "jump_url": "//www.bilibili.com/opus/828071498582327315",
        "opus_id": "828071498582327315",
        "stat": {
          "like": "1"
        }
      },
      {
        "content": "如果排除掉可能的误差, 14=12.",
        "cover": {
          "height": 720,
          "url": "https://album.biliimg.com/bfs/new_dyn/79823dd0b617af6fc71126d6e042de3f645769214.png",
          "width": 1280
        },
        "jump_url": "//www.bilibili.com/opus/827727935543705620",
        "opus_id": "827727935543705620",
        "stat": {
          "like": "1"
        }
      }
    ],
    "offset": "827727935543705620",
    "update_num": 0
  },
  "message": "0",
  "ttl": 1
}
`,15))])}const v=t(r,[["render",u]]),q=JSON.parse('{"path":"/docs/opus/space.html","title":"","lang":"zh-CN","frontmatter":{},"git":{"updatedTime":1746964133000,"contributors":[{"name":"SessionHu","username":"SessionHu","email":"102411014+SessionHu@users.noreply.github.com","commits":3,"url":"https://github.com/SessionHu"},{"name":"wuziqian211","username":"wuziqian211","email":"65224318+wuziqian211@users.noreply.github.com","commits":1,"url":"https://github.com/wuziqian211"}],"changelog":[{"hash":"9a0475c2fb9e561b3c57424a7fb4d8ea249d4361","time":1746964133000,"email":"102411014+SessionHu@users.noreply.github.com","author":"Session小胡","message":"fix(opus/space.md): typo","coAuthors":[{"name":"晨叶梦春","email":"65224318+wuziqian211@users.noreply.github.com"}]},{"hash":"d02be84dca13f92e4eb603a06ac1ef783f3584d3","time":1746629898000,"email":"102411014+SessionHu@users.noreply.github.com","author":"SessionHu","message":"style(opus/space.md): remove trailing space"},{"hash":"0ff0b6996c39935e38bf6fe0014d8d7e22117345","time":1746072249000,"email":"102411014+SessionHu@users.noreply.github.com","author":"SessionHu","message":"feat: 获取用户空间图文"}]},"filePathRelative":"docs/opus/space.md"}');export{v as comp,q as data};