Перейти к навигации

How do I turn a Xiaohongshu keyword into a content brief supported by real discussion?

To choose a Xiaohongshu topic from keywords, start with a term your readers use. Find related questions with xiaohongshu.pgy.get_keyword_related, check the daily trend with xiaohongshu.pgy.get_keyword_daily, read actual discussion with xiaohongshu.app_v2.search_notes and note comments, then decide what the article should answer. Popularity helps select candidates; a useful brief also needs a reader situation and an answer you can support.

For the seed “face masks,” investigate usage situations, packaging choices and questions about instructions. Decide whether readers need a comparison, an explanation or a checklist; adding popular words to a title is not enough.

What does each source help decide?

MaterialDecision supportedNext step
Related keyword candidatesNearby questions readers might care aboutSelect terms relevant to the audience
Daily indexChange within the returned time windowRetain dates and missing values, comparing consistent definitions
Note and comment excerptsWhat people discuss and what remains unclearChoose a specific question, angle and verification work

Validate the direction with a small collection first. To write a headline, reuse an existing discussion report instead of running retrieval again.

A useful assistant assignment

Starting from “face masks,” investigate questions relevant to the intended readers. Keep related candidates, observed trends and discussion evidence separate. Select three writing angles, each with audience, question, proposed title, outline and supporting excerpts. List evidence gaps for follow-up.

The resulting editorial-briefs.json holds your editorial choices, checked against source material. Titles and angles are proposals; quotations are evidence. Keep titles, angles and quotations distinct when deciding what can be cited and what still needs checking.

Steps 1–7 below expand terms, inspect trends, select discussions and produce briefs. Related terms, daily index, note search and comments are separate requests when selected; see current pricing.

1. Define the starting point and bounds

The example uses the seed “面膜” and limits the first round to one related-term result, one daily-index result, one note page and, optionally, one comment page for a selected note. If results are irrelevant, stop and revise the seed instead of expanding indefinitely.

curl -sS https://api.beatapi.io/v1/capabilities/inspect \
-H 'Content-Type: application/json' \
-d '{"reference":"data:xiaohongshu.pgy.get_keyword_related"}'

After confirming the price, request the related terms:

curl -sS https://api.beatapi.io/v1/social-data/call \
-H "Authorization: Bearer $BEATAPI_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"action":"xiaohongshu.pgy.get_keyword_related","params":{"search_word":"面膜"}}' \
-o keyword-related.json

The response places related search groups in data.data.upSearchWords and data.data.downSearchWords, with searchScore, readTotalCount, noteNum, relevanceRank, and brandTag metadata. Because the contract does not name the property that holds the term text, this guide provides no automatic term selector. Keep the returned terms with their upSearchWords/downSearchWords grouping and review relevance manually. If no term is relevant, do not let an AI invent trending terms and present invented terms as returned results.

3. Read the selected term’s daily index

Inspect data:xiaohongshu.pgy.get_keyword_daily first. The example keeps the seed; replace search_word with a real selected related term when appropriate:

curl -sS https://api.beatapi.io/v1/social-data/call \
-H "Authorization: Bearer $BEATAPI_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"action":"xiaohongshu.pgy.get_keyword_daily","params":{"search_word":"面膜"}}' \
-o keyword-daily.json

Keep the actual dates and original values. Index values are not people counts, and missing days are not zero. The daily-index action declares no month or date_type input; do not add one to request 90 days. Add get_keyword_stat only when an overview is necessary; do not run all three actions by default.

4. Validate with notes, not heat alone

Inspect data:xiaohongshu.app_v2.search_notes, then search a relevant term:

curl -sS https://api.beatapi.io/v1/social-data/call \
-H "Authorization: Bearer $BEATAPI_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"action":"xiaohongshu.app_v2.search_notes","params":{"keyword":"面膜","page":1,"time_filter":"一周内","sort_type":"comment_descending"}}' \
-o keyword-note-sample.json

Save actual note IDs, sources and visible content. Most-commented order is a search selection, not all matching content or total search demand. Further pages follow the first-response search-state contract.

Suppose the index for “face masks” rises and a note asks, “How long should I leave it on before makeup?” Record the index dates and the question separately. The index helps you decide when to look; the question gives you something specific to answer. Check whether the note is about a hydrating mask or a cleansing mask.

5. Read selected discussions and retain evidence

Choose one relevant real note, check the inputs and price, then follow the comment and reply guide. Link each recurring question to its original sources, and keep quotations apart from your synthesis. Ads, note bodies and reader comments are different forms of evidence.

A useful output contains the concrete question, source note, comment evidence, observed index window and remaining uncertainty. A topic without discussion evidence stays a research candidate, not a validated demand claim. A ratio from a limited comment page is not the opinion share of all users.

6. Calls and recovery

One related-term query, one daily-index query, one search page and one selected comment page total four platform calls. Overviews, further pages and replies add calls; model analysis is billed separately. Keep each original JSON and request ID so later synthesis rereads saved data instead of buying repeated queries.

The daily-index exporter uses the documented dateKey/searchScore/noteNum/userNum fields and checks gaps and complete windows. Related-term text extraction still lacks a documented text-property name; report trend figures only from saved real outputs. Search and comments have adapters for real responses. You can skip the index branch and finish the step 7 editorial deliverable from saved reviewed comments, without another paid call.

Interpret indices · Boards versus search · Question index

7. Turn reviewed discussion into an auditable editorial brief

If a comment research report already exists, reuse comments.json and evidence.json without searching again. Choose a relevant reviewed theme, and separate what people actually said from your proposed editorial angle. For example, repeated questions about packaging choices can support a checklist based on actual needs. Explain how the proposed angle answers the question, and keep unverified interpretation apart from source statements.

Create briefs.json with editor-supplied fields. theme and evidence_ids must reference your actual reviewed report; do not copy the illustrative values:

[{"brief_id":"brief-1","audience":"<intended reader>","question":"<specific question>","angle":"<how the article will answer it>","title":"<proposed title>","outline":["<section one>","<section two>"],"theme":"<reviewed_theme>","evidence_ids":["<reviewed_evidence_id>"],"validation_needed":"<facts or demonstration still needed before publishing>"}]

Save the script below as build_briefs.py and run python3 build_briefs.py review/comments.json report/evidence.json briefs.json editorial-briefs.json. build_briefs.py validates theme membership, evidence IDs, verbatim quotes and sources, then counts supporting comments and distinct notes. build_briefs.py does not invent claims or publish anything, and refuses to overwrite an existing output file. Check whether each title goes beyond its evidence, and resolve validation_needed before writing. The output includes quotations: check the quotations for personal information and redact before sharing.

import json
import sys
from pathlib import Path
comments_file, evidence_file, briefs_file, output = sys.argv[1:]
comments = json.loads(Path(comments_file).read_text(encoding="utf-8"))
evidence = json.loads(Path(evidence_file).read_text(encoding="utf-8"))
briefs = json.loads(Path(briefs_file).read_text(encoding="utf-8"))
by_id = {}
for item in comments:
key = item["evidence_id"]
if key in by_id:
raise SystemExit("Duplicate source evidence ID")
by_id[key] = item
if not isinstance(briefs, list) or not briefs:
raise SystemExit("Expected at least one editorial brief")
seen = set()
result = []
for brief in briefs:
key = brief.get("brief_id")
if not isinstance(key, str) or not key.strip() or key in seen:
raise SystemExit("Missing or duplicate brief ID")
seen.add(key)
for field in ("audience", "question", "angle", "title", "validation_needed"):
if not isinstance(brief.get(field), str) or not brief[field].strip():
raise SystemExit(f"Missing editorial field: {field}")
outline = brief.get("outline")
if not isinstance(outline, list) or not outline or any(not isinstance(v, str) or not v.strip() for v in outline):
raise SystemExit("Expected a nonempty outline")
theme = brief.get("theme")
reviewed = evidence.get(theme)
if not isinstance(reviewed, list):
raise SystemExit("Theme is absent from reviewed evidence")
refs = brief.get("evidence_ids")
if not isinstance(refs, list) or not refs or len(refs) != len(set(refs)):
raise SystemExit("Use unique evidence references")
linked = []
for ref in refs:
matches = [item for item in reviewed if item["evidence_id"] == ref]
source = by_id.get(ref)
if len(matches) != 1 or source is None:
raise SystemExit("Evidence is not in this theme and source set")
quote = matches[0].get("quote")
if not isinstance(quote, str) or not quote.strip() or quote not in source["text"]:
raise SystemExit("Quote does not match original comment")
linked.append({"evidence_id": ref, "quote": quote, "note_id": source["note_id"],
"source_file": source["source_file"], "request_id": source["request_id"]})
result.append({**brief, "evidence": linked, "supporting_comments": len(linked),
"supporting_notes": len({v["note_id"] for v in linked}),
"scope": "selected reviewed comments; not prevalence or causal proof"})
with Path(output).open("x", encoding="utf-8") as handle:
json.dump(result, handle, ensure_ascii=False, indent=2)

Related terms come from Pugongying related keywords. The upSearchWords and downSearchWords groups describe preceding and following search context rather than a verified causal user journey. Do not assume brandTag is numeric or boolean, do not merge the two directions, and do not treat index divided by note count as a platform-approved competition metric.