/api/weibo/channels
累計調用 1 次
頻道分類
微博頻道分類:「我的頻道」與「頻道推薦」兩組,含頻道名 / ID / containerid。
- 頻道 ID 就是網頁裡的數字:
https://weibo.com/hot/weibo/102803的102803即頻道 ID(熱門);換別的頻道就是換這個數字。 - 兩組都返回,用
section區分:「我的頻道」隨登錄賬號而變,「頻道推薦」是微博推薦的通用頻道。 containerid要一起帶上:取內容時微博要求group_id傳頻道 ID、containerid傳它自己的值,兩者對多數頻道並不相同(如 明星1028034288/102803_ctg1_4288_-_ctg1_4288)。- 該接口本身不校驗登錄態(不帶 Cookie 也能返回遊客默認頻道),但「我的頻道」會隨賬號不同而變化。
- 也接受 GET(此時參數走 query 串);因微博 Cookie 較長,推薦用 POST 放表單體。
| 字段 | 類型 | 說明 |
|---|---|---|
| count | int | 兩組加起來的頻道總數 |
| groups[].section | string | 分組名:我的頻道 / 頻道推薦 |
| groups[].count | int | 該分組下的頻道數 |
| groups[].channels[].id | string | 頻道 ID(= 網頁 /hot/weibo/{id} 裡的數字) |
| groups[].channels[].name | string | 頻道名 |
| groups[].channels[].containerid | string | 頻道 containerid(取內容時與 id 一起傳) |
| groups[].channels[].url | string | 頻道網頁地址 |