1
+ // B站开放接口 - 数据开放服务 bilibili-webapp
2
+
3
+ syntax = "proto3" ;
4
+ package member.bilibili.com ;
5
+ import "google/api/annotations.proto" ;
6
+
7
+ option go_package = "github.com/dev-openapi/bilibili-webapp" ;
8
+
9
+ service OpendataService {
10
+ // 获取用户数据 https://openhome.bilibili.com/doc/4/90936ab5-7c06-e24f-2ad0-0fd6e10c7386
11
+ rpc GetUserData (GetUserDataReq ) returns (GetUserDataRes ) {
12
+ option (google.api.http ) = {
13
+ get : "/arcopen/fn/data/user/stat" ,
14
+ };
15
+ }
16
+ // 获取单视频数据 https://openhome.bilibili.com/doc/4/3f46ac2e-1318-3aa0-5548-0d9fd624d520
17
+ rpc GetArchiveData (GetArchiveDataReq ) returns (GetArchiveDataRes ) {
18
+ option (google.api.http ) = {
19
+ get : "/arcopen/fn/data/arc/stat" ,
20
+ };
21
+ }
22
+ // 获取整体视频增量数据 https://openhome.bilibili.com/doc/4/708a4ce5-5a6e-d8ce-b2e8-ff8a26a83b05
23
+ rpc GetArchiveIncData (GetArchiveIncDataReq ) returns (GetArchiveIncDataRes ) {
24
+ option (google.api.http ) = {
25
+ get : "/arcopen/fn/data/arc/inc-stats" ,
26
+ };
27
+ }
28
+ // 获取单一专栏数据 https://openhome.bilibili.com/doc/4/46903ddc-1264-ddac-a3c7-559d12f32118
29
+ rpc GetArticleData (GetArticleDataReq ) returns (GetArticleDataRes ) {
30
+ option (google.api.http ) = {
31
+ get : "/arcopen/fn/data/art/stat" ,
32
+ body : "body" ,
33
+ };
34
+ }
35
+ // 获取整体专栏增量数据 https://openhome.bilibili.com/doc/4/f5d81e34-ab1b-ac92-2c5e-34c3c0d33828
36
+ rpc GetArticleIncData (GetArticleIncDataReq ) returns (GetArticleIncDataRes ) {
37
+ option (google.api.http ) = {
38
+ get : "/arcopen/fn/data/art/inc-stats" ,
39
+ };
40
+ }
41
+ }
42
+
43
+ message GetUserDataReq {
44
+ string client_id = 1 ;
45
+ string access_token = 2 ;
46
+ }
47
+
48
+ message GetUserDataRes {
49
+ int32 code = 1 ;
50
+ string message = 2 ;
51
+ int32 ttl = 3 ;
52
+ message Data {
53
+ int64 following = 1 ;
54
+ int64 follower = 2 ;
55
+ int64 arc_passed_total = 3 ;
56
+ }
57
+ Data data = 4 ;
58
+ }
59
+
60
+ message GetArchiveDataReq {
61
+ string client_id = 1 ;
62
+ string access_token = 2 ;
63
+ string resource_id = 3 ;
64
+ }
65
+
66
+
67
+
68
+ message GetArchiveDataRes {
69
+ int32 code = 1 ;
70
+ string message = 2 ;
71
+ int32 ttl = 3 ;
72
+ message Data {
73
+ string title = 1 ;
74
+ int64 ptime = 2 ;
75
+ int64 view = 3 ;
76
+ int64 danmaku = 4 ;
77
+ int64 reply = 5 ;
78
+ int64 favorite = 6 ;
79
+ int64 coin = 7 ;
80
+ int64 share = 8 ;
81
+ int64 like = 9 ;
82
+ }
83
+ Data data = 4 ;
84
+ }
85
+
86
+ message GetArchiveIncDataReq {
87
+ string client_id = 1 ;
88
+ string access_token = 2 ;
89
+ }
90
+
91
+ message GetArchiveIncDataRes {
92
+ int32 code = 1 ;
93
+ string message = 2 ;
94
+ int32 ttl = 3 ;
95
+ message Data {
96
+ int64 inc_click = 1 ;
97
+ int64 inc_dm = 2 ;
98
+ int64 icn_reply = 3 ;
99
+ int64 inc_fav = 4 ;
100
+ int64 inc_coin = 5 ;
101
+ int64 inc_share = 6 ;
102
+ int64 inc_like = 7 ;
103
+ int64 inc_elec = 8 ;
104
+ }
105
+ Data data = 4 ;
106
+ }
107
+
108
+ message GetArticleDataReq {
109
+ string client_id = 1 ;
110
+ string access_token = 2 ;
111
+ message Body {
112
+ string ids = 1 ;
113
+ }
114
+ Body body = 3 ;
115
+ }
116
+
117
+ message ArticleData {
118
+ message Category {
119
+ int64 id = 1 ;
120
+ int64 parent_id = 2 ;
121
+ string name = 3 ;
122
+ }
123
+ message Stats {
124
+ int64 view = 1 ;
125
+ int64 favorite = 2 ;
126
+ int64 like = 3 ;
127
+ int64 dislike = 4 ;
128
+ int64 reply = 5 ;
129
+ int64 share = 6 ;
130
+ int64 coin = 7 ;
131
+ }
132
+ message List {
133
+ int64 id = 1 ;
134
+ string name = 2 ;
135
+ string image_url = 3 ;
136
+ int64 update_time = 4 ;
137
+ int64 ctime = 5 ;
138
+ int64 publish_time = 6 ;
139
+ string summary = 7 ;
140
+ int64 words = 8 ;
141
+ }
142
+
143
+ int64 id = 1 ;
144
+ Category category = 2 ;
145
+ string title = 3 ;
146
+ string summary = 4 ;
147
+ string banner_url = 5 ;
148
+ int64 template_id = 6 ;
149
+ int64 state = 7 ;
150
+ repeated string image_urls = 8 ;
151
+ int64 publish_time = 9 ;
152
+ int64 ctime = 10 ;
153
+ Stats stats = 11 ;
154
+ string reason = 12 ;
155
+ int64 words = 13 ;
156
+ List list = 14 ;
157
+ string top_video_bvid = 15 ;
158
+ }
159
+
160
+ message GetArticleDataRes {
161
+ int32 code = 1 ;
162
+ string message = 2 ;
163
+ int32 ttl = 3 ;
164
+ map <string , ArticleData > data = 4 ;
165
+ }
166
+
167
+ message GetArticleIncDataReq {
168
+ string client_id = 1 ;
169
+ string access_token = 2 ;
170
+ }
171
+
172
+ message GetArticleIncDataRes {
173
+ int32 code = 1 ;
174
+ string message = 2 ;
175
+ int32 ttl = 3 ;
176
+ message Data {
177
+ int64 icn_reply = 1 ;
178
+ int64 inc_read = 2 ;
179
+ int64 inc_fav = 3 ;
180
+ int64 inc_likes = 4 ;
181
+ int64 inc_share = 5 ;
182
+ int64 inc_coin = 6 ;
183
+ }
184
+ }
0 commit comments