# Changelog of Weibo Hot Search, Posts, Comments & User Scraper – 微博热搜榜 API (`deadc0dex/weibo-scraper`) Actor

- **URL**: https://apify.com/deadc0dex/weibo-scraper/changelog.md
- **Full Actor documentation**: https://apify.com/deadc0dex/weibo-scraper.md

## Changelog

### 2.0.4 (2026-10-16) – research budget refill, faster user media posts

- **keywordResearch budget no longer left unused:** posts are picked with their real comment counts (a post with 3 comments costs 1 + 3 rows, not 1 + `commentsPerPost`), and budget a keyword leaves unused (few-comment or 0-comment posts, a keyword with few posts) refills the next top posts of keywords still short, each with its comments. Explicit `maxItemsPerInput` stays a hard cap. dryRun estimates unchanged (conservative).
- **userPosts:** the first older-media (waterfall) page is fetched in parallel with the timeline when more than ~10 posts are wanted; full-text requests run 6 at a time (was 4).
- The "fit N of maxPosts" warning appears only when the budget held posts back, not when search simply found fewer posts.
- No price, event, input or default-output change.

### 2.0.2 (2026-10-15) – trending research, balanced budgets, fixes

- **Fix:** `keywordResearch` with `include:["reposts"]` returned no repost rows when post filters were set (e.g. `minReposts: 5` was also applied to the reposts themselves, which usually have 0 reposts). Post filters now pick the parent posts only; an empty repost page adds a warning instead of nothing.
- **New `trendingTopics` (1-20):** keywordResearch / search / topic also run on the top N words of the live realtime hot search (ads and pinned row skipped); `summary.jobs[].trend` = rank, heat, category, label. `{"trendingTopics":3}` alone runs keywordResearch.
- **Balanced research budget:** if `maxItems`/`maxCostUsd` cannot fit `maxPosts` × `commentsPerPost`, fewer top posts are taken so each keeps its comments (budget split evenly per keyword, warning added; dryRun estimates match). Before: a $0.03 cap on 5 posts × 50 comments returned 4 posts and 2 comments; now 1 post and 12 comments.
- **Trust:** `summary.trust.adsSkipped` counts promoted posts dropped from post lists.
- README: v2 research / trust / snapshot section (was missing from the 2.0.1 README). No price, event or default-output change.

### 2.0 (2026-10-13) – research workflow, trust fields, snapshots, insights

- **New operation `keywordResearch`** (aliases keyword_comments, research, brand monitor): one call runs keyword -> top posts (search pipeline; your post filters and sortBy pick them; `maxPosts`, default 10) -> comments of each post (`commentsPerPost`, default 20; `commentSort` hot/newest; `replyDepth` 1 adds replies) -> optional first-page reposts (`include: ["reposts"]`) -> free `insights` row. Posts and comments are billed at the existing event prices.
- **`matchTerms[]`**: keep only comments (comments, keywordResearch) or posts (search, topic, hotPosts, userPosts) whose text contains a term. Documented as a post-fetch filter (fewer billed rows, not fewer requests).
- **Trust fields on every billable row** (compact/full): `isPartial`, `unavailableFields[]`, `collectionWarnings[]`, with a written null-vs-zero rule. Summary row adds `isPartial`, `pagesFetched`, `jobs[]` (requested vs returned per input, data requests, partial, stoppedBy) and `trust`.
- **Computed metrics** (marked computed, formulas in capabilities/summary): posts `engagementTotal`, `engagementPer1kFollowers`, `engagementPer1kPlays`; users `interactionsPerPost`.
- **Snapshot mode**: `deltaKey` + `trackMetrics: true` keeps every row and adds `snapshotAt`, `deltaHours`, `isNewSinceSnapshot`, likes/comments/reposts/plays deltas (posts), `previousRank`/`rankDelta`/`heatDelta` (hot search), read/mention deltas (topics), follower deltas (users); compact metric vectors in your key-value store `weibo-scraper-snapshots` (30 days, max 5000 entries); summary lists trends that dropped off a fully fetched board.
- **Free insights row** (`type: "insights"`; default for keywordResearch, `insights: true` for any operation): counts, engagement totals/medians, top posts, top authors, top hashtags, top terms (CJK bigram/trigram document counts), lexicon sentiment labelled heuristic, regions, posts by day, matchTerm counts, hot-list categories and risers. No LLM, no extra requests.
- **Reliability**: new error codes `RATE_LIMITED` (HTTP 418/429) and `PARTIAL` (free notice row when a list stops early on an error after some rows; replaces the silent warning).
- **Billing events behind a constant map** (`src/v2.js PLANNED_EVENTS`): list post rows -> `post-basic`, list user rows -> `user-row` once those events exist in the live pricing; until then the v1 events apply. **No price or event change in this release** (see PRICING_PLAN_v2.md).
- Input schema: `maxItems` has no schema default any more (code default stays 20, so non-research runs are unchanged); new fields maxPosts, commentsPerPost, matchTerms in the first 20; replyDepth, commentSort, insights, trackMetrics after them.
- Compact default output: all v1.4 keys kept in the same order; only new keys added. Lean rows unchanged unless you ask for the new fields (fields\[]) or turn on trackMetrics.

### 1.4.0 (2026-10-13) – listing and agent-docs polish (same scraping code as 1.3.5)

- Store title/description: "Hot Search, Posts" adjacent in the title; "Weibo hot posts" (热门微博, the existing `hotPosts` operation) named in the description; price shown as a range ($0.002-0.006 per row).
- README "For AI agents": a copy-paste example input for every operation; keyword list at the end removed.
- `capabilities`: example input for every operation, guest limits text updated to the v1.3 behaviour (deep search/topic/fans pages, reposts first page), `version` 1.4; userProfile description no longer promises an IP region (null for guests).
- Input schema: `operation` text names hot posts 热门微博; `searchTabs` text mentions the deeper result pages.
- No price, event, input or default-output changes.

### 1.3.5 (2026-10-13) – limits removed, faster network path

- New operation `reposts` (转发): first page of a post's repost list (guest limit), as `post` rows with `repostedPost` (event `result`, unchanged price).
- `search`: deeper result pages through m.weibo.cn getSecond (hundreds of posts per keyword, up to ~1000) after the 5 tabs.
- `topic`: topic page, then more posts of the same #topic# from search pages.
- `userSearch`: pages 2+ (20 accounts per page).
- `fans` / `following`: paged through getSecond (10 per page, far beyond the old ~20), rows now carry bio and gender.
- `userPosts`: newest ~10 posts, then older photo/video posts (profile media feed); summary warns that older text-only posts need a login.
- `include: ["videoPlays"]`: exact video play counts for m.weibo.cn-sourced posts. `editedAt` filled on weibo.com rows of edited posts when requested.
- Network: data requests direct from the Apify server (proxy only for guest-cookie hosts; per-host fallback to the proxy), guest cookie reused for 12 h (`cacheGuestCookies`, store `weibo-scraper-cache`), request hedging after 2.5 s (`hedgeAfterMs`), `networkMode: "proxy"` restores v1.2 routing. Summary `timings.network` shows what was used.
- minMemoryMbytes 128 allowed (default stays 256: heavy runs are ~1.5× slower at 128 MB).
- No price or event changes. Default output fields unchanged.

### 1.2.0 – 2026-10-13 (token-efficient output, verified fields, competitor parity; same events and prices, all v1.x inputs still work)

- **Lean output (opt-in):** `outputMode: "lean"` drops null/empty/false keys and the per-row envelope (once in `summary.lean`), omits `url` (patterns in the summary), uses `id` for the row's own id, a minimal field set per row type, `maxTextChars` (default 300 in lean, `truncated: true`) and compact UTC dates. `leanFormat: "table"` adds one TSV table per row type (`summary.leanTable` if < 20 KB, key-value record `LEAN_TABLE`). Billing unchanged. `maxTextChars` also works in compact/full.
- **New operations (no login, existing events):** `likers` (accounts that liked a post, up to ~200; `profile` event), `fans` / `following` (first page ~20; `profile`). New boards `hotSearchBoard: "life"` (生活榜) and `"social"` (社会榜).
- **New filters (before billing/enrichment):** `minComments`, `minReposts`, `originalOnly`, `contentType` (images/videos/text), `authorType` (verified/organization/individual), and `deltaKey` (only rows not returned by earlier runs with the same key; ids in the user's named key-value store `weibo-scraper-delta`).
- **Verified data (AUDIT_FIELDS_v1.2.md):** fixed `source` on search/topic rows (was the author's tagline, now null), comment `text` no longer ends with the t.cn link of an attached picture, `videoDurationSeconds` rounded down like Weibo (29.566 → 29), exact `videoPlayCount` when the source has it. Mixed-media posts (video + pictures): pictures and video are read from `mix_media_info` on weibo.com and the video is no longer counted as a picture on m.weibo.cn (`mediaType`, `imageUrls`, `imageCount`, video fields). Desktop text gets t.cn links replaced by their titles and zero-width spaces removed, like m.weibo.cn. `ipLocation` documented as always null for guests.
- **Faster:** cookieless first try for endpoints that answer guests directly (topic ranking, post details, long text, likers, embedded hot comments: no 1-2 s visitor-cookie round trip; falls back to cookies automatically); trending posts fetched with `isGetLongText=true` (full text inline: 50 posts ~30 → ~6 requests) and pages in parallel; enriched posts stream out in order; proxy set up without the access-check round trip; data-host connection pre-warmed while the visitor cookie is fetched; code shipped as one esbuild bundle (no node_modules in the image, start-up ~0.9 s → ~0.4 s).
- dryRun estimates respect `maxCostUsd` and the run charge limit; summary `nextSteps` suggest likers and lean mode; summary timings add `proxyReadyMs`, `cookielessFallbacks`, `prewarmedConnections`.

### 1.1.0 – 2026-10-13 (efficiency release; same inputs, outputs, events and prices)

- **Faster:** keep-alive HTTP via undici (one proxy tunnel + TLS session reused per guest session instead of a new connection per request); per-host pacing (default `requestDelayMs` 400 → 150 ms between request starts, max 4 in flight per host) instead of one global serial queue; independent inputs (keywords/urls/users) run 3 at a time with output kept in input order; proxy setup runs in the background during start-up.
- **Batched output:** rows are written with one `Actor.pushData(rows, event)` call per 50 rows (charged together by the SDK) instead of one API call per row; summary row and `RUN_SUMMARY` are written in parallel. 200 comments: 200 dataset API calls → 4.
- **Scope-aware fetching:** full-text (`statuses/extend`) requests only when the requested `fields` include `text`/`textTruncated`/`topics`; `userProfile` skips the profile-detail request unless `description`/`verifiedReason`/`ipLocation`/`accountCreatedAt` are wanted, and fetches info + detail in parallel when a uid is given; `comments` converts a bid to the numeric mid locally (base62) instead of a post lookup; trending-feed long posts use `weibo.com/ajax/statuses/longtext` (same host, no second visitor cookie); dryRun/capabilities skip the proxy check.
- **Exact stopping:** pagination and enrichment are sized to what `maxItems`, `maxCostUsd` and the run's max charge still allow (no extra pages, no full-text calls for rows that cannot be returned); newest-first comment paging stops at `dateFrom`; a run-level deadline (timeout − 15 s) ends with partial results + summary instead of TIMED-OUT; retry back-off capped at 8 s.
- **Fixes:** `hotTopics` returned only the first 10 topics (Weibo pages by 10, not 50) → now the full ranking (~24-50) with parallel page fetches; `hotPosts` stopped after 20 posts (cursor stays 1) → now pages until no new posts (up to ~250).
- **Lighter:** base image `apify/actor-node:22-slim` (61 MB vs 140 MB compressed), `npm ci`, node started directly with a heap limit of 75 % of the run memory, `got-scraping` replaced by `undici` (2 MB); EN→ZH dictionary loaded only when a Latin keyword needs it. Default memory 512 → 256 MB (benchmarked: 128 MB was slower and costlier on 50+ row runs).
- **Tail latency:** a guest session whose proxy IP answers slower than 4 s twice is replaced by a fresh one (new IP) for the next request.
- Fix: `hotSearchBoard: "news"` crashed with UPSTREAM_ERROR (run FAILED) when Weibo answers `{"band_list":{}}`; now a free NO_RESULTS row and the run SUCCEEDS.
- Summary row adds `timings` (startupMs, firstRowMs, totalMs, retries, pushCalls, downloadedKb, slowestRequests).
- Store listing: title/description/SEO texts lead with "Weibo hot search, posts and comments" (agent search phrases); README has keyword-first sections and an FAQ; categories SOCIAL_MEDIA, NEWS, AI.

### 1.0.0 – 2026-10-12 (agent-native release; builds 1.0.1, 1.0.2 = latest)

- **13 operations in one Actor** (`operation`, default `auto`): hotSearch (realtime/entertainment/news), **new** hotTopics (话题榜), **new** hotPosts (热门微博 feed), search, **new** topic (#hashtag# page), postDetails, **new** comments (paginated, hot/newest), **new** replies, **new** userProfile, **new** userPosts, **new** userSearch, **new** capabilities (free manifest).
- New inputs: `users[]`, `ids[]`, `fields[]` (projection), `include[]` (author, comments, replies, fullText, media, raw), `outputMode` (compact/full), `sortBy`, `dateFrom`/`dateTo` (absolute or 7d/24h), `minLikes`, `maxItemsPerInput`, `maxCostUsd`, `dryRun`, `expandQuery`, `commentsPerItem`, `repliesPerComment`, `dedupe`.
- Auto routing per value (post URL/id → postDetails, profile URL/@name → userProfile, s.weibo.com topic/search links → topic/search, hot-list pages → hotSearch/hotTopics/hotPosts, text → search); values that do not fit an explicit operation are routed by their form and noted.
- English→Chinese query expansion from the shared dictionary `work/actors/_shared/query_expansion/en_zh.json` (copied to `src/data/en_zh.json` by `npm run sync-dict`); ambiguous short words are never expanded; `queryUsed` on every row, expansions listed in the summary.
- **Output contract:** every billable row starts with `type, operation, input, queryUsed, id, url, fetchedAt`; new row kinds `hotTopic`, `comment`, `user`; free `summary` row last (counts, billedEvents, costUsd, warnings, nextSteps), free `plan` (dryRun) and `capabilities` rows. Filters and de-duplication run before billing.
- **Output changes vs 0.x:** `mode` → `operation`, `scrapedAt` → `fetchedAt` (old names still present with `outputMode: "full"`); error rows now use `message` / `fix` (was `errorMessage` / `suggestedFix`); `searchKeyword` dropped (use `input` / `queryUsed`); compact mode omits `mobileUrl`, `authorUrl`, `editedAt`, `videoPageUrl`, `mobileLink` (in `full`). New post field `isPinned`.
- New error codes `LOGIN_REQUIRED`, `BUDGET_REACHED`; every error row has a concrete `fix`.
- **Pricing:** existing events unchanged (`result` $0.006/post, `hot-search-row` $0.002, `apify-actor-start` $0.00005); `hot-search-row` now also covers 话题榜 rows; **new events `comment` $0.002 and `profile` $0.004**, added via `PUT /v2/acts/QhBSzpiN0wmJzLfxu` pricingInfos on 2026-10-12 ~17:42 UTC; the Actor had no paying users, so the change took effect immediately (no 14-day notice needed per Apify docs). Embedded `topComments` stay free.
- Input schema rebuilt (27 fields, 20 key fields first, every enum value explained in the description, all descriptions ≤ 500 chars, no prefill on primary inputs so the daily QA run = hot search, ~5 s). Dataset schema generated from `src/contract.js` (`scripts/gen_schemas.mjs`), views per kind. README rewritten with a "For AI agents" section at the top.
- 1.0.2: entertainment/news boards fetch with guest cookies on the first try (33 s → 8 s); duplicate rows skipped by `dedupe` are reported in the summary warnings.
- Backward compatible inputs: `mode`, `searchKeywords`, `postUrls`, `maxPostsPerKeyword`, `includeComments`, `maxCommentsPerPost`, `includeCommentAuthor`, `fetchFullText`.

### 0.3.0 – 2026-10-12 (agent optimisation; build 0.3.1)

- Every input optional (`mode` auto); misplaced inputs auto-corrected (site URL in `keywords` → fetched, plain word in `urls` → searched); explicit mode with missing input falls back to the given input.
- Out-of-range numbers clamped instead of rejected (schema max/min removed; ranges in descriptions) – agents don't see schema min/max.
- New `type: "error"` dataset rows with `errorCode` / `errorMessage` / `suggestedFix` (never billed); input, not-found and no-result problems now end SUCCEEDED with these rows; status message lists codes + first fix; RUN_SUMMARY has `errorRows`, `notes`.
- Dataset schema: error fields, `type` enum incl. `error`, Errors view; output schema descriptions updated.
- Input field descriptions rewritten (enum values explained inline because MCP drops enumTitles; formats and examples); flagship-only prefill.
- Store description/SEO description rewritten (input → output first; correct prices); exampleRunInput set; default run memory 512 MB.
- README: "For AI agents" section (MCP tool name, task → input table, cost, runtime, error codes); fixed stale `affectionate_greengage` username in API/MCP examples.
- PPE event names and prices unchanged.

### 0.2.0 – 2026-10-12 (builds 0.2.1–0.2.4, latest = 0.2.4)

Agent-readiness release (see ../AGENT_READINESS.md).

- **Inputs:** primary inputs are now arrays `keywords[]` and `urls[]` (v0.1 `searchKeywords` / `postUrls`, single strings and `{url}` objects still accepted). `mode` is optional with new default `auto` (urls → postDetails, keywords → search, both → both, neither → hotSearch). No required fields. Prefill only on `keywords` (`["华为"]`).
- **Fast default:** `maxItems` default 50 → 20; `maxPostsPerKeyword` 0 now splits `maxItems` evenly across keywords.
- **Speed:** first search tabs fetched in parallel; hot_band fetched without the guest-cookie round-trip; shared in-flight visitor request. Platform: 20 posts 29 s → 14 s, ~93 posts 65 s → 27 s, hot search 10 s → 6 s.
- **Stable output:** every hot-search row has the same 18 keys and every post the same 38 keys (null / \[] when missing); new `input` field on all rows; `topComments` is null when comments are off.
- **Status messages:** progress per keyword, one-line final summary (counts, stop reason, first failed input); missing input fails fast with an example JSON; partial results after an error exit as SUCCEEDED. RUN_SUMMARY adds `requests`, `avgRequestMs`, `runSeconds`, `hotSearchRows`, `posts`.
- **Pricing:** new cheaper PPE event `hot-search-row` ($0.001) for hot search rows; posts stay on `result` ($0.004). Falls back to `result` if `hot-search-row` is not configured.
- **Schemas:** output schema added (`.actor/output_schema.json`: dataset items + RUN_SUMMARY); dataset schema fields now carry descriptions and examples; Hot search view links to the login-free mobile link.
- **Listing:** new agent-first title/description (also set on the Actor via API), README rewritten (returns, input/output examples, pricing, limits, runtime).

### 0.1.0 – 2026-10-12

- First release (private).
- Modes: hot search list (热搜榜 realtime, 文娱榜 entertainment, 要闻榜 news) with rank, word, heat, category, label, pinned/ad flags and links; keyword post search across the All / Hot / Real-time / Videos / Images tabs (de-duplicated); post details by URL, mid or bid.
- Full text for long posts (statuses/extend), optional hot public comments (commenter names off by default).
- Guest (visitor) cookies from passport.weibo.com and visitor.passport.weibo.cn; retries with exponential backoff and session/proxy rotation on 403/418/432/429/5xx, non-JSON and login-wall responses; request throttling; small enrichment concurrency (4).
- Fallback from weibo.com hot_band to the m.weibo.cn realtimehot container; fallback from m.weibo.cn statuses/show to weibo.com ajax/statuses/show.
- Pay-per-event charging: `actor-start` (only when defined in pricing) + `result` per item, stops at the run's max charge.
- Dataset schema with Hot search / Posts / Media / Full details views.
