跳到正文
DEV Community· Ignacio Baez·· 2 小時前AI 評分43

教學:用 Python 擷取知乎熱榜並翻譯成英文

How to Track What China Is Talking About with the Zhihu Hot List and Python (2026)

AI 導讀

教學示範如何用 Python 擷取知乎熱榜,取得問題排名、標題、摘要、熱度、回答數、連結及擷取時間,並翻譯標題和摘要。範例亦按熱度與回答數計算「每個回答的熱度」,找出熱度高但回答較少的話題。每條熱榜問題收費 $0.001,翻譯不另收費。

正文

Zhihu (知乎) is China's largest Q&A site, and its hot list (知乎热榜) is one of the best real-time signals of what people in China are debating right now. The problem: it's in Chinese, it changes every few minutes, and there is no official public API. In this tutorial you will pull the hot list into Python, in English, in about 15 lines of code.

You will get, for each question:

  • Rank, title and excerpt (plus English translations)
  • Heat score (热度) and number of answers
  • The question URL and the time it was scraped

Full disclosure: I built the scraper used here. It reads Zhihu's public hot list, so you don't need a Zhihu account, a login or a Chinese phone number.

Setup (2 minutes)

  1. Create a free account at apify.com. The free plan includes monthly credits, enough to follow this tutorial.
  2. Copy your API token from Settings → API & Integrations in the Apify Console.
  3. Install the client and save the token as an environment variable:
pip install "apify-client>=3"
export APIFY_TOKEN="your_token_here"

Get today's hot list, in English

import os
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])

run = client.actor("neronbaez/zhihu-hot-list-scraper").call(run_input={
    "maxItemsPerPlatform": 10,      # top 10 questions of the hot list
    "translateToEnglish": True,     # adds titleEn / excerptEn
})

questions = list(client.dataset(run.default_dataset_id).iterate_items())

for q in questions:
    print(f'#{q["rank"]:>2} | {q["heat"]:>9,} heat | {q.get("answers", 0):>5} answers | '
          f'{q.get("titleEn") or q["title"]}')

This is the real output from a run on November 25, 2026 (first 5 lines):

# 1 | 8,230,000 heat |    98 answers | The launch of the Shenzhou 24 manned spacecraft was a complete success. The Chinese Space Station welcomed its first foreign astronaut. What other highlights are there in this launch mission?
# 2 | 4,640,000 heat |   175 answers | Young people are beginning to persuade their parents to sell their vacant houses in the county and exchange them for cash to collect interest. Is it necessary to keep a house that has been vacant for many years?
# 3 | 2,400,000 heat |   192 answers | The AI short drama "Ugly Fox" sparked a lot of discussion after it became popular. What is the core reason why it can hit the audience?
# 4 | 2,290,000 heat |    28 answers | Trump publicly mentioned a Chinese dish with a beautiful "hat" and said it was delicious but couldn't name it. Which dish could it be?
# 5 | 2,180,000 heat |   175 answers | Why do I think Mr. Bean's performance is very vulgar and childish and not funny at all? Is it the difference between Chinese and Western cultures?

The titles are machine translations of the original Zhihu questions. Each question comes back as a JSON object like this one (trimmed, real data):

{
  "type": "trend",
  "platform": "zhihu",
  "title": "神舟二十四号载人飞船发射取得圆满成功,中国空间站迎来首位外籍航天员,此次发射任务还有哪些看点?",
  "heat": 8230000,
  "heatText": "823 万热度",
  "answers": 98,
  "url": "https://www.zhihu.com/question/2108654680351797564",
  "rank": 1
}

Find the open conversations: hot but under-answered

A question with huge heat and few answers is a conversation that is still open. For a brand, a journalist or a creator, that is where a good answer gets the most attention.

for q in questions:
    q["heatPerAnswer"] = q["heat"] / max(q.get("answers") or 1, 1)

open_topics = sorted(questions, key=lambda q: q["heatPerAnswer"], reverse=True)[:2]
print("Hot but under-answered:")
for q in open_topics:
    print(f'  {q["heatPerAnswer"]:>10,.0f} heat/answer | {q.get("titleEn") or q["title"]}')

Real output from the same run:

Hot but under-answered:
      83,980 heat/answer | The launch of the Shenzhou 24 manned spacecraft was a complete success. The Chinese Space Station welcomed its first foreign astronaut. What other highlights are there in this launch mission?
      81,786 heat/answer | Trump publicly mentioned a Chinese dish with a beautiful "hat" and said it was delicious but couldn't name it. Which dish could it be?

Going further

Track it over time. The hot list changes all day. Schedule the Actor every hour in Apify (Schedules tab) and save each run: you'll see which topics rise, how long they stay and how fast they die.

Compare platforms. The China Trending Topics Actor puts Zhihu, Weibo, Baidu, Bilibili and Douyin trends together and detects topics trending on several platforms at once.

Cost. You pay per result: $0.001 per hot question, so the full top 50 costs $0.05. Translation to English is included at no extra cost.

Wrap-up

You now have China's live conversation as data, in English. You can also run the Zhihu Hot List Scraper from the browser without code and export to CSV or Excel.

If you need a field or filter it doesn't have, open an issue on the Actor page and I'll add it. What would you track first? Tell me in the comments.

來源:DEV Community · dev.to