crawl_config.json
6.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
{
"version": "1.0.0",
"agent": "weibo-scraper",
"updated_at": "2026-04-13T10:35:00+08:00",
"sources": [
{
"id": "weibo_pc_hotsearch",
"name": "微博 PC 端热搜公开 API",
"platform": "weibo",
"category": "热搜榜",
"url": "https://weibo.com/ajax/side/hotSearch",
"method": "GET",
"priority": 1,
"enabled": true,
"headers": {
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
"Accept": "application/json, text/plain, */*",
"Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8",
"Connection": "keep-alive",
"Referer": "https://weibo.com",
"X-Requested-With": "XMLHttpRequest"
},
"parser": {
"type": "json",
"root_path": "$.data.realtime",
"item_selector": "*",
"fields": {
"word": { "path": "word", "type": "string", "required": true },
"word_scheme": { "path": "word_scheme", "type": "string", "required": false },
"note": { "path": "note", "type": "string", "required": false },
"num": { "path": "num", "type": "integer", "required": true },
"rank": { "path": "realpos", "type": "integer", "required": true },
"label_name": { "path": "label_name", "type": "string", "required": false },
"flag": { "path": "flag", "type": "integer", "required": false },
"topic_flag": { "path": "topic_flag", "type": "integer", "required": false, "default": 0 }
}
},
"notes": "核心数据源。无需登录,实测返回 51 条 realtime 数据 + 1 条 hotgov 置顶数据。"
},
{
"id": "weibo_60s_api",
"name": "60s 读世界聚合 API",
"platform": "weibo",
"category": "热搜榜",
"url": "https://60s.viki.moe/v2/weibo",
"method": "GET",
"priority": 2,
"enabled": true,
"headers": {
"User-Agent": "Mozilla/5.0"
},
"parser": {
"type": "json",
"root_path": "$.data",
"item_selector": "*",
"fields": {
"word": { "path": "title", "type": "string", "required": true },
"num": { "path": "hot_value", "type": "integer", "required": false },
"url": { "path": "link", "type": "string", "required": false }
}
},
"notes": "第三方聚合接口,字段精简但稳定性好,作为官方 API 的降级/对账来源。"
},
{
"id": "weibo_xxapi",
"name": "XXAPI 免费微博热搜接口",
"platform": "weibo",
"category": "热搜榜",
"url": "https://v2.xxapi.cn/api/weibohot",
"method": "GET",
"priority": 3,
"enabled": true,
"headers": {
"User-Agent": "Mozilla/5.0"
},
"parser": {
"type": "json",
"root_path": "$.data",
"item_selector": "*",
"fields": {
"rank": { "path": "index", "type": "integer", "required": true },
"word": { "path": "title", "type": "string", "required": true },
"num_label": { "path": "hot", "type": "string", "required": false },
"url": { "path": "url", "type": "string", "required": false }
}
},
"notes": "免密钥免费接口,热度值为字符串(如 '119万'),需后处理转为整数。"
},
{
"id": "weibo_zxki_api",
"name": "酷酷 API 聚合热榜",
"platform": "weibo",
"category": "热搜榜",
"url": "https://api.zxki.cn/api/jhrs?type=weibo",
"method": "GET",
"priority": 4,
"enabled": true,
"headers": {
"User-Agent": "Mozilla/5.0"
},
"parser": {
"type": "json",
"root_path": "$.data",
"item_selector": "*",
"fields": {
"word": { "path": "title", "type": "string", "required": true },
"num_label": { "path": "hot", "type": "string", "required": false },
"url": { "path": "url", "type": "string", "required": false }
}
},
"notes": "聚合多平台热榜的备用源,实测 HTTP 200 可用。"
},
{
"id": "weibo_aa1_api",
"name": "AA1.cn 微博热搜免费接口",
"platform": "weibo",
"category": "热搜榜",
"url": "https://api.aa1.cn/api/weibo-rs",
"method": "GET",
"priority": 5,
"enabled": true,
"headers": {
"User-Agent": "Mozilla/5.0"
},
"parser": {
"type": "json",
"root_path": "$.data",
"item_selector": "*",
"fields": {
"rank": { "path": "index", "type": "integer", "required": true },
"word": { "path": "title", "type": "string", "required": true },
"num": { "path": "hot", "type": "integer", "required": false },
"url": { "path": "url", "type": "string", "required": false },
"mobile_url": { "path": "mobilUrl", "type": "string", "required": false }
}
},
"notes": "实测可用的免费接口,返回 PC 端和移动端双 URL。"
}
],
"rate_limit": {
"strategy": "adaptive",
"min_delay_seconds": 2,
"max_delay_seconds": 5,
"requests_per_minute": 20,
"cooldown_minutes": 1,
"retry_on_rate_limit": {
"enabled": true,
"max_retries": 2,
"backoff_seconds": 30
}
},
"user_agent_pool": [
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
"Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 Mobile/15E148 Safari/604.1",
"Mozilla/5.0 (Linux; Android 13; Pixel 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Mobile Safari/537.36"
],
"validation": {
"expected_content_type": "application/json",
"fallback_content_types": ["text/html"],
"success_indicator": {
"path": "$.ok",
"value": 1
}
},
"output": {
"schema": "weibo_hotsearch_v1",
"required_fields": [
"rank",
"word",
"num",
"board_type",
"source_url",
"crawl_time"
],
"include_raw_data": false
},
"compliance": {
"robots_txt": "https://weibo.com/robots.txt",
"crawl_delay_seconds": 10,
"exclude_private_data": true,
"exclude_ads": true,
"data_retention_days": 90
}
}