How do I compare recent search trends for Xiaohongshu keyword candidates?
To compare recent search trends for several Xiaohongshu keyword candidates, call xiaohongshu.pgy.get_keyword_daily once per term and align the searchScore values by shared dates. Three topic ideas take three requests and give three series. Use the index to spot changes, then read related notes and comments to decide what to cover.
For example, if the score for “sunscreen” rose over two weeks, look for the situations and questions readers mention. Before comparing the two weeks, check that each date has a score, and keep note counts and search-user counts in separate columns.
Choose the material for the question
get_keyword_daily, get_keyword_stat and get_keyword_related each take one search_word. Daily observations for three terms take three requests. Add overview or related-term requests only when needed; the three actions return three different results.
Save a trend for one term
Replace the example term in the daily request with your candidate:
xiaohongshu.pgy.get_keyword_daily takes no date interval, month or keyword array. Use the window actually returned and record the collection time for each term. Keep dateKey, searchScore, noteNum and userNum from data.data.dailyData[] in separate columns, and do not derive people counts from the index.
Make three checks before interpreting a chart
- Date coverage: missing dates stay missing and appear as chart gaps, not zeroes. The latest returned date may not be today.
- Comparability: compare common dates and the same index definition across terms instead of dividing totals from different windows.
- Discussion context: treat rising terms as candidates for content research and read the actual questions. Interest alone explains neither the cause nor conversion.
The local helper pgy_daily.py below compares means only when both consecutive seven-day windows have complete index data. summary.json records the windows, missing dates and baseline state; daily.csv keeps the daily values next to the original response.
For example, a teammate wants to compare hydrating and cleansing masks. Save a daily result for each term. If the latest dates differ, use the two weeks that both results cover. Keep the term, the windows, the daily scores and the missing dates. If only one week is complete, report that week’s values first.
Plan retrieval costs
Choose the number of terms and estimate the cost with the current daily-query pricing. Charting, comparing saved periods and writing a brief happen locally, so revising a chart needs no new request.
Export a daily evidence table and compare two complete weeks
BeatAPI preserves the Pugongying envelope directly under data, so xiaohongshu.pgy.get_keyword_daily returns dateKey, searchScore, noteNum, and userNum inside data.data.dailyData[]. Keep the index, note count, and searcher count in separate columns; do not derive people counts from the index. The target platform selects the returned date window, and the window is not guaranteed to be exactly 90 days.
Save each candidate’s response and export each response into a separate directory. Three terms take three daily requests; overviews, related terms, and note or comment research are separate choices. A request record looks like this:
Save the script below as pgy_daily.py. pgy_daily.py accepts date labels in YYYY-MM-DD or YYYYMMDD form (including integer YYYYMMDD); other formats stop for inspection instead of guessing a timezone or unit. Numeric values must be plain non-negative numbers, and note and searcher counts must be whole numbers. Missing values stay missing. pgy_daily.py sorts valid dates, rejects duplicate days, reports gaps, and compares the mean index of two adjacent seven-day windows only when all 14 dates have a searchScore. These validation rules belong to pgy_daily.py; future platform responses may use other representations.
Run python3 pgy_daily.py xiaohongshu-keyword-daily.json keyword-request.json keyword-review-1. Open summary.json before charting the date and searchScore columns of daily.csv. Gaps are not zeroes and stay as chart gaps. The raw dateKey values and the original JSON stay available for verification.
The two-week comparison ends at the latest returned date, which may not be today. relative_change is a fraction, not a percentage; a zero previous mean yields null and zero_baseline. The locally calculated mean change is not an official platform period comparison and not a conversion rate, and one short window does not establish seasonality. Compare several terms only on shared returned dates with the same index definition, never against another platform’s index. Check rising candidates with the real note and comment evidence workflow before choosing a brief.

