Rank 7 is missing.

The board came back as 0, 1, 2, 3, 4, 5, 6, 8, 9 … 30. Thirty rows, one hole, sitting in the most visible part of the top ten.

I spent an hour hunting a parser bug that did not exist. Slot 7 was a paid placement, is_ad was true, my loop skipped it, and the skip was correct. What was wrong was my assumption that rank is a continuous index.

Keep the hole. A board with perfectly consecutive ranks from an unknown scraper is more suspicious than one with a gap, because real platforms sell slots and a scraper that pretends otherwise is editing reality.

The call

import requests from datetime import datetime, timezone UA = ("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 " "(KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36") def hot_board(limit=30, skip_ads=True): s = requests.Session() s.headers.update({ "User-Agent": UA, "Referer": "https://weibo.com/", "X-Requested-With": "XMLHttpRequest", "Accept": "application/json, text/plain, */*", "Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8", }) r = s.get("https://weibo.com/ajax/side/hotSearch", timeout=25) data = r.json()["data"] now = datetime.now(tz=timezone.utc).isoformat() rows = [] # The pinned item ships twice, as `hotgov` (dict) and `hotgovs` (list). # Same story in both — take it once. pinned = data.get("hotgov") or {} if isinstance(pinned, dict) and pinned.get("note"): rows.append({"kind": "top_news", "rank": 0, "word": pinned["note"].strip(), "hot_value": None, "label": None, "scraped_at": now}) for idx, item in enumerate(data.get("realtime") or [], start=1): if len(rows) >= limit: break if skip_ads and item.get("is_ad"): continue # leaves a gap in `rank` — by design word = (item.get("word") or "").strip() if not word: continue rows.append({"kind": "hot", "rank": idx, "word": word, "hot_value": int(item.get("num") or 0) or None, "label": item.get("label_name"), "scraped_at": now}) return rows for row in hot_board(6): print(row["rank"], row["word"], row["hot_value"], row["label"]) 

Output from the 03:20 UTC run:

0 #半条被子的故事有了新续篇# None None 1 国考 1847398 热 2 iPhoneDuo直播中爆屏 956351 新 3 来自天宫的礼物即将抵达地球 771460 新 4 霍启山娜然宣布恋情 756436 热 5 爷爷从来没有把刘星当成后孙 730987 热 

Note num, not raw_hot. The field name looks like it should be raw_hot, and older write-ups use that, but every record in my output was built from num and the schema carries no raw_hot at all. Read raw_hot or num and you survive both shapes.

Two more traps live in the same payload. The pinned story ships twice, once as hotgov and once inside hotgovs, so a naive loop emits a duplicate rank-0 row. And label_name is a text badge, not a code — 热 on 5 rows, 新 on 17, null on 8.

Sampling, not scraping

国考 read 1,847,398 at 03:20 UTC. Twelve minutes later the same topic read 2,984,744. A minute after that, 2,970,797.

It rises, plateaus, dips. That is not a decaying counter, it is a live ranking, and it means the useful shape for this data is:

(topic, polled_at, rank, hot_value) 

Not topics(topic PRIMARY KEY, hot_value). Three polls in fourteen minutes gave three true observations of a moving object. With append-only rows you can compute rank velocity and catch the moment a topic is being pushed; with an overwritten column you get a number with no meaning and no way to tell whether it moved.

A 5-minute interval is 288 rows a day per topic and stays well inside what the endpoint tolerates. The run behind these numbers pulled 30 records in one request; a full board every 5 minutes is 8,640 rows a day, a few hundred kilobytes.

One structural note: this is a news signal, not a sentiment signal. 国考 at rank 1 on a Sunday morning tells you an exam happened, not whether anyone is happy about it. The board ranks attention and nothing else.

The column I deleted

I originally had category — news, entertainment, sports. It was null on 30 of 30 records. I re-ran with includeTopNews=false to rule out the pinned item: still 10 of 10 null.

The endpoint does not return it. So it is gone. A permanently-null column is a liability: a buyer opens the dataset, sees a blank column, and downgrades their opinion of the eleven that are correct.

Same reasoning kept three things I nearly dropped. label is null on 8 of 30 — only some entries earn a badge, and that absence is information. hot_value is null exactly once, on the pinned top-news item, which by design has no score. word_scheme is the field nobody documents. In my pull it carried the #topic# wrapping on 18 of 30 rows, arrived bare on 11, and was null on the pinned item — while word itself started with # exactly once. Join on word and you get two spellings of one story; join on word_scheme and you get one, at the cost of normalising the bare rows yourself.

Two flags that only make sense together

Every row in my output carries is_ad: false, because the only rows that would have carried true never made it in. Worth knowing when you audit a dataset: that column proves nothing about what you skipped. If you need the proof, keep a counter of dropped slots beside the run_id, or you are trusting a field that is structurally always false.

The pinned item also sits at rank: 0, above rank 1, with hot_value: null. Sort by rank and it leads the board. Sort by hot value and it disappears. Neither behaviour is a bug, but pick one on purpose and write down which.

What bit me before it worked

Nine lines of requests and then a week of edges. hotgov and hotgovs duplicating the pinned row. num versus raw_hot depending on response shape. Ad slots you must skip while keeping the original numbering intact. Chinese words that arrive wrapped in # for some entries and bare for others, which silently breaks every join until you normalise. And a fallback endpoint, s.weibo.com/top/summary?cate=realtimehot, that returns HTML rather than JSON and counts ranks from a different base.

I run this every few minutes as Weibo Hot Search Scraper on Apify: rank, word, hot value, label, the ad flags, and a ready-to-open search URL, 30 rows per run.

Next step: poll the board twice, ten minutes apart, and join on word. Count how many topics moved up versus down. That ratio is your first real signal about what kind of day it is in Chinese media, and it beats any single hot value you will ever store.