├── api └── show │ ├── show.md │ └── show.js ├── README.md └── object ├── page_info.md └── data.md /api/show/show.md: -------------------------------------------------------------------------------- 1 | ## GET statuses/show 2 | 以JSON格式返回单条微博内容 3 | 4 | Endpoint: https://m.weibo.cn/statuses/show 5 | 6 | ### 请求头 7 | 不必要 8 | 9 | ### 参数 10 | |参数|说明|必要| 11 | |:--:|:--:|:--:| 12 | |id|单条微博id,可以为全数字(id)或9位数字/字母混合(bid)|是| 13 | 14 | ### 返回 15 | |名称|类型|说明| 16 | |:--:|:--:|:--:| 17 | |data|Object|[data object](https://github.com/Ninzore/weibo-api/blob/main/object/data.md)包含单条微博所有内容| 18 | |ok|number|是否成功,成功为1| 19 | -------------------------------------------------------------------------------- /api/show/show.js: -------------------------------------------------------------------------------- 1 | const axios = require("axios"); 2 | 3 | let id = "4558131943713068"; 4 | let bid = "JoohcfzWc"; 5 | 6 | axios({ 7 | url : "https://m.weibo.cn/statuses/show", 8 | method : "GET", 9 | headers : {}, 10 | params : { 11 | id : id 12 | // id : bid 13 | } 14 | }).then(res => { 15 | console.log(res.data); 16 | }).catch(err => { 17 | console.error(err.response); 18 | }); 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # weibo-api 2 | Weibo APIs collection from network traffic analysis of Mobile/Desktop webpages and mobile app 3 | 4 | 新浪微博API,来源为对新浪微博的移动/桌面版网页,以及APP的抓包分析 5 | 6 | ## API 7 | [api](./api)中每一个api都有一个文件夹,文件夹中包含md说明文件以及使用Axios进行示例的js文件 8 | #### api说明包含 9 | * 请求头 : 如果需要特殊请求头会在这里进行说明 10 | * 参数 : 请求时可用的参数 11 | * 返回 : 返回值 12 | 13 | 其中请求头和参数使用以下格式 14 | |参数|说明|必要| 15 | |:--:|:--:|:--:| 16 | |参数名|参数说明|必要或是可选| 17 | 18 | 返回值以下方Object的格式说明 19 | 20 | ## Object 21 | [object](./object)中列出了API返回中可能包含的Object 22 | #### 以如下格式展示API结构: 23 | 仅为举例 24 | ``` 25 | data 26 | |-- mid : number 27 | |-- page_info 28 | |-- blabla : string 29 | |-- count : number 30 | |-- id)str : string 31 | ``` 32 | 33 | #### 以如下格式说明字段内容: 34 | |属性|类型|说明|附加说明| 35 | |:--:|:--:|:--:|:--:| 36 | |属性名称|属性类型|返回值说明|其他,什么都有| -------------------------------------------------------------------------------- /object/page_info.md: -------------------------------------------------------------------------------- 1 | # page_info Object 2 | 视频或超话的页面信息 3 | 4 | ## 视频 5 | #### page_info字段结构 6 | ``` 7 | page_info 8 | |-- content1 : string 9 | |-- content2 : string 10 | |-- media_info 11 | |-- duration : number 12 | |-- stream_url : string 13 | |-- stream_url_hd : string 14 | |-- object_id : string 15 | |-- object_type : number 16 | |-- page_pic 17 | |-- height : number 18 | |-- width : number 19 | |-- is_self_cover : number 20 | |-- pid : string 21 | |-- source : number 22 | |-- type : number 23 | |-- url : string 24 | |-- page_title : string 25 | |-- page_url : string 26 | |-- play_count : string 27 | |-- title : string 28 | |-- type : string 29 | |-- url_ori : string 30 | |-- urls : (列出所有可能值) 31 | |-- hevc_mp4_hd 32 | |-- h265_mp4_hd 33 | |-- mp4_720p_mp4 34 | |-- mp4_hd_mp4 35 | |-- mp4_ld_mp4 36 | |-- video_orientation : string 37 | ``` 38 | #### 说明 39 | |属性|类型|说明|附加说明| 40 | |:--:|:--:|:--:|:--:| 41 | |content1|string|一般为xxxx的微博视频| 42 | |content2|string|微博正文|如果太长会截断| 43 | |media_info|object|视频信息|仅在视频中出现| 44 | |media_info.duration|float|视频时长|单位为秒,精确到小数点后2位| 45 | |media_info.stream_url|string|视频预览|带音频,常见360p| 46 | |media_info.stream_url_hd|string|稍高清视频预览|带音频,常见480p| 47 | |object_id|string|应该是视频id|举例: 1034:4558123386470406| 48 | |object_type|int|页面类型|视频为11| 49 | |page_pic|object|视频封面信息|超话时这里不一样| 50 | |page_pic.height|int|视频封面高度|| 51 | |page_pic.width|int|视频封面宽度|| 52 | |page_pic.is_self_cover|int|不知道干什么用的|只见过1| 53 | |page_pic.pid|string|视频封面图片id|| 54 | |page_pic.source|int|图片来源|不知道干什么的,只见过1| 55 | |page_pic.type|int|图片类型|不知道干什么的,只见过1| 56 | |page_pic.url|string|封面图片网址|`https://wx2.sinaimg.cn/crop.0.33.960.533/006QZngZly1gjj2czqvztj30qo0gonlj.jpg`| 57 | |page_title|string|和content1一样|超话时不一样| 58 | |page_url|string|视频在微博视频的网址|`https://video.weibo.com/show?fid=${object_id}`| 59 | |play_count|string|播放量|上万后仅显示xx万次播放| 60 | |title|string|视频标题| 61 | |type|string|视频时为"video"|超话时不一样| 62 | |url_ori|string|page_url的短链|| 63 | |urls|object|包含各个清晰度的链接,非Dash|`mp4_hd_mp4`和`mp4_ld_mp4`一般都会有,`mp4_720p_mp4`仅出现在高清视频中,其他两个看脸| 64 | |video_orientation|string|视频方向|只有`horizontal`和`vertical`| 65 | *** 66 | 67 | ## 超话 68 | #### page_info字段结构 69 | ``` 70 | page_info 71 | |-- content1 : string 72 | |-- content2 : string 73 | |-- object_type : number 74 | |-- page_pic 75 | |-- url : string 76 | |-- page_title : string 77 | |-- page_url : string 78 | |-- play_count : string 79 | |-- title : string 80 | |-- type : string 81 | ``` 82 | 83 | #### 说明 84 | |属性|类型|说明|附加说明| 85 | |:--:|:--:|:--:|:--:| 86 | |content1|string|超话信息|xx 《超话名称》 超话,xx可以是超话类型,比如`手游`| 87 | |content2|string|超话关注数量|int人关注| 88 | |object_type|int|页面类型|超话为0| 89 | |page_pic|object|包含超话头像url|视频时这里不一样| 90 | |page_pic.url|string|超话头像url| 91 | |page_title|string|标题|【超话】超话名称| 92 | |page_url|string|超话链接| 93 | |type|string|视频时为"topic"|视频时不一样| -------------------------------------------------------------------------------- /object/data.md: -------------------------------------------------------------------------------- 1 | ## data Obejct 2 | 单个微博内容构成 3 | 4 | ### data字段结构 5 | ``` 6 | data 7 | |-- ad_state : number 8 | |-- alchemy_params 9 | |-- ug_red_envelope : boolean 10 | |-- attitudes_count : number 11 | |-- bid : string 12 | |-- buttons : array 13 | |-- can_edit : boolean 14 | |-- cardid : string 15 | |-- comments_count : number 16 | |-- content_auth : number 17 | |-- created_at : string 18 | |-- darwin_tags : array 19 | |-- favorited : boolean 20 | |-- fid : number 21 | |-- hide_flag : number 22 | |-- id : string 23 | |-- isLongText : boolean 24 | |-- is_paid :boolean 25 | |-- is_imported_topic : boolean 26 | |-- mark : string 27 | |-- mblog_vip_type : number 28 | |-- mblogtype : number 29 | |-- mid : string 30 | |-- mlevel : number 31 | |-- more_info_type : number 32 | |-- number_display_strategy 33 | |-- apply_scenario_flag : number 34 | |-- display_text : string 35 | |-- display_text_min_number : number 36 | |-- ok : number 37 | |-- page_info : object 38 | |-- pending_approval_count : number 39 | |-- pic_ids : array 40 | |-- pic_num : number 41 | |-- pic_types : string 42 | |-- pid : number 43 | |-- pidstr : string 44 | |-- pending_approval_count : number 45 | |-- reposts_count : number 46 | |-- repost_type : number 47 | |-- retweeted_status : object 48 | |-- reward_exhibition_type : number 49 | |-- safe_tags : number 50 | |-- show_additional_indication : number 51 | |-- source : string 52 | |-- status_title : string 53 | |-- text : string 54 | |-- raw_text : string 55 | |-- textLength : number 56 | |-- user : object 57 | |-- version : number 58 | |-- visible 59 | |-- list_id : number 60 | |-- type : number 61 | ``` 62 | 63 | ### 说明 64 | |属性|类型|说明|附加说明| 65 | |:--:|:--:|:--:|:--:| 66 | |id|string|单条微博id| 67 | |mid|string|单条微博id,同id|所以为什么又有id又有mid啊明明一样的| 68 | |bid|string|单条微博id,用于短链|区分大小写| 69 | |created_at|string|发布时间,格式为 WWW MM DD HH:MM:SS +0800 YYYY| 70 | |user|object|[user object](./user.md) 该条微博用户信息| 71 | |pid|number|转发链中上条微博id|转发| 72 | |pidstr|string|同pid,但为string|转发| 73 | |status_title|string|原微博标题,一般为微博前20个字+...,或为长微博标题| 74 | |text|string|微博文本,html形式| 75 | |raw_text|string|微博文本,纯文本形式|转发| 76 | |textLength|number|文字数量(去除html标签)|转发不会有这个| 77 | |isLongText|boolean|是否是长文,>140字| 78 | |comments_count|number|评论数量| 79 | |attitudes_count|number|点赞数量| 80 | |favorited|boolean|是否已收藏|不登录总是为false| 81 | |pics|array of object|[pic object](./pic.md) 列表|总是会有,没图就是空的| 82 | |pic_num|number|图片数量|没图为0| 83 | |pic_types|string|图片类型,干什么不知道|没图为空| 84 | |pic_ids|array of string|图片id列表| 85 | |picStatus|string|可能为 0:1 不知道什么意思|必须有图,但不一定会有,待观察| 86 | |pic_rectangle_object|array|不知道|拼图时会有但是是空的| 87 | |pic_focus_point|array of object|pic_focus_point object|拼图时会出现| 88 | |reposts_count|number|转发数量| 89 | |retweeted_status|object|原微博的data obejct|转发| 90 | |repost_type|number|转发类型|转发,但是不一定会有,可能条件是带emoji?| 91 | |thumbnail_pic|string|小图url|单图才会有| 92 | |bmiddle_pic|string|中图url|单图才会有| 93 | |original_pic|string|大图url|单图才会有| 94 | |page_info|object|[page_info object](./page_info.md) 用于超话,视频|没有这俩就没有这条| 95 | |user|object|[user object](./user.md) 该条微博用户信息| 96 | |visible|object|是否可见|不登录应该是全0吧| 97 | |alchemy_params|object|带有ug_red_envelope字段,紧急红信封?什么东西?|只见过false| 98 | |is_imported_topic|boolean|是否为重要内容|有超话时会出现,似乎有关| 99 | |is_paid|boolean|pay了吗?| 100 | |ad_state|number|看名字应该是判断广告| 101 | |buttons|array of object|没什么用,一般长度只有1| 102 | |can_edit|number|判断是否可修改|只见过0| 103 | |cardid|string|不知道是什么,举个栗子:star_072|出现条件未知| 104 | |content_auth|number|不知道是什么|只见过0| 105 | |darwin_tags|array of object|好像如果是蓝V发的就会有?|里面会写“热门手游最新动态”之类的| 106 | |hide_flag|number|应该标识是否隐藏|只见过0| 107 | |mark|string|不知道是什么,举个栗子|999_reallog_mark_ad:999|WeiboADNatural| 108 | |mblogtype|number|只见过0| 109 | |mblog_vip_type|number|只见过0| 110 | |mlevel|number|只见过0| 111 | |more_info_type|number|只见过0| 112 | |number_display_strategy|object|每条都有,不知道用来干什么| 113 | |ok|number|你都200了当然ok啦| 114 | |pending_approval_count|number|只见过0| 115 | |safe_tags|number|不知道是什么,可能值:64|不一定会有| 116 | |source|string|发布来源|可能为超话名称,weibo.com,微博国际版| 117 | --------------------------------------------------------------------------------