SuperAPI AI Directory

xiaohongshu-title-score

Marketing & growth

View repository

Updated 10-16 05:50

About this skill

Xiaohongshu Title Generation and Scoring

Function Routing

Choose the execution path based on user intent:

  • Create New Titles(e.g., "help me write a title", "generate viral titles", "titles about XX") → ExecuteFunction One
  • Evaluate Existing Titles(e.g., "score", "rate", "how is this title", "evaluate title") → ExecuteFunction Two

Whichever function is executed, any information entered by the user is used as the basis for generating viral titles or evaluating title potential.

Global Rules

Authentication

Get API Key

  1. Visit RedFox Hub official website to learn about service details
  2. Go to registration page to register an account
  3. Newly registered users will receive free credits, and can immediately start using the API service
  4. After registering and logging in, get the API Key in the personal center, in the format ak_xxxxxxxx

Configure API Key

  • REDFOX_API_KEY Get it from an environment variable, in the format ak_xxxxxxxx
  • If it is not set, prompt the user to configure it themselves:export REDFOX_API_KEY=<你的apikey>; if the user does not know how to configure it, the Agent should proactively help the user set it up:
    • macOS/Linux: Append export REDFOX_API_KEY=<值> to ~/.zshrc(zsh) or ~/.bashrc(bash), then source the corresponding file to make it take effect globally
    • Windows: Use [Environment]::SetEnvironmentVariable("REDFOX_API_KEY", "<值>", "User") to set a permanent user-level environment variable (requires restarting the terminal to take effect)
    • After configuration is complete, verify:echo $REDFOX_API_KEY(macOS/Linux) or echo %REDFOX_API_KEY%(Windows), to ensure that another skill can also read it

Wording Standards

  • Prohibited: "crawl", "scrape"
  • Alternative: use "fetch"

Precise Keyword Matching

  • Query only the product that the user entered, and do not arbitrarily expand to related but different products
  • Understand the boundaries of specific product forms: cream ≠ spray ≠ clothing; paste ≠ liquid ≠ powder; liquid ≠ cream ≠ cushion; lipstick ≠ lip glaze ≠ lip oil
  • Core principle: whatever form/type the product entered by the user is, strictly limit it to that scope

Keyword Type Judgment

  • Niche term/vertical track(including specific scenario/attribute modifiers, such as "workplace outfit", "fat-loss meal") → query directly
  • Specific product term(such as "sunscreen", "mascara") → query directly, do not expand to other products
  • General term/broad category(pure broad-category term without modifiers, such as "outfit", "beauty") → execute the general-term expansion strategy

For detailed judgment criteria and examples, see references/guide.md

General-Term Expansion Strategy

Execute only when the keyword is a general term; niche terms/specific product terms skip this step and query directly.

  1. Search Xiaohongshu hot topics related to generalized terms in web information from the past 7 days, and generate 10 subdivided directions (covering 2-3 each of trend terms, audience terms, scenario terms, and intent terms; terms should be moderate in size and not combined)
  2. Output recommendations andStop execution, waiting for the user to reply "Expand" or "Do not expand"
  3. User replies "Expand" → search 10 subdivided terms; replies "Do not expand"/"Continue" → search the original keywords

Data query rules

Time calculation: first obtain the current system time, then calculate startDate (format yyyy-MM-dd)

  • Today: startDate = yesterday
  • Last N days: startDate = today - N days

Automatically extend time when data is insufficient(changing terms is prohibited):

  1. Last 1 day → Last 3 days → Last 7 days → Last 30 days
  2. After each extension, prompt the user: "The data for this keyword in the last X days is less than 5 items; the time range has been automatically extended to the last Y days"
  3. Even if extended to the last 30 days and there are still fewer than 5 items, display truthfully and indicate that data is insufficient

Out-of-range explanation:

  • If the user says "today": "We are very sorry, today's data has not been updated yet, and we have shown you the most recently available data"
  • If the time exceeds 30 days: "We are very sorry, currently only data from the last 30 days is supported, and we have shown you the closest data"

Execute command:

  • python scripts/fetch_xhs_trends.py --keyword <关键词> --start-date <日期>
  • Separate multiple keywords with commas:python scripts/fetch_xhs_trends.py --keyword "防晒霜,防晒喷雾" --start-date 2024-01-15
  • Site-wide popular:python scripts/fetch_xhs_trends.py --keyword "" --start-date <日期>

Function 1: Viral title generation

Step 1: Extract keywords

Extract core keywords from the user input and determine the keyword type (see global rules); generalized terms must first follow the expansion strategy.

Step 2: Query data

  • Default time range: last 7 days (startDate = today - 7 days)
  • Execute the data query command (see global rules)
  • Read the generated Markdown file:关键词_爆款数据.md
  • The number of data items obtained must be output to the user: read the number of data items for each category from the script execution stderr output and report it to the user (e.g., "A total of XX viral data items were obtained, including XX low-follower viral items, XX most-liked items, XX single-day interaction items, and XX 7-day growth items")
  • Data time lag explanation (internal reference, not displayed): interaction data is as of the time of ingestion, not real-time data

Step 3: Generate viral titles

Viral title analysis must be completed internally first, then titles must be generated; the order cannot be reversed.

  1. [Internal execution only] Analyze viral titles: extract all titles from the data and analyze title structure, keywords, emotion, target audience, pain points, and benefit promises. The analysis results are not shown to the user.
  2. Generate 10 new viral titles (shown to the user):
    • Create innovatively based on analyzed patterns, not by directly using reference viral titles
    • Keep title length within 20 characters
    • The recommendation reason must explain in detail: title structure, keywords, target audience, pain points, value, and platform suitability
    • Match index between 8-10, keep one decimal place, and the same index may be repeated at most 2 times
    • Reference viral titles must include links:[标题文字](https://www.xiaohongshu.com/explore/{photoId})

Output format (must be strictly followed)

A data explanation must be output before the title list:

⚠️Data note: !!! Due to Xiaohongshu risk control rules, some post links may not redirect properly. You can copy the corresponding post title and search for it on Xiaohongshu to view it. Thank you for your understanding 🙇‍♀️🙇‍♀️

Each title format:

**标题X:[标题内容]**
📈匹配指数:[8.0-10.0]
🔥参考的爆款:[标题1](https://www.xiaohongshu.com/explore/{photoId})(互动数:XXX)、[标题2](...)(互动数:YYY)
👍推荐理由:[详细推荐理由]

---

Format validation: Data note before the title list | Title line bold + within 20 characters | Match index one decimal place 8-10 | Reference viral posts with links + interaction counts | Detailed recommendation reasons | Separator lines between blocks | Consistent emoji (📈🔥👍) | 10 titles in total


Function 2: Viral Title Scoring

Step 1: Extract key information

Identify two core elements:

  1. Title to be scored: The title the user wants to evaluate
  2. Topic keywords: Used to query viral data (if the user does not provide them, extract from the title)

Step 2: Query data

  • Default time range: Last 30 days (startDate = today - 30 days), to obtain more comprehensive viral patterns
  • Execute the data query command (see global rules)
  • Must output the amount of data obtained to the user: Read the number of data entries for each category from the script execution stderr output, and report to the user (e.g., "A total of XX viral data entries were obtained, including XX low-follower viral posts, XX most-liked posts, XX single-day interaction posts, and XX 7-day growth posts")

Step 3: Scoring (must be output to the user)

First check title overlap: If the user's title is exactly the same as a viral title (or differs only by punctuation/spaces) → directly S-level (9.5+ points)

6-dimension weighted scoring: Topic match (15%), structural compliance (20%), benefit clarity (25%), emotional arousal (20%), scarcity perception (15%), compliance safety (5%)

Grade: S-level (9.0+)/A-level (7.0-8.9)/B-level (5.0-6.9)/C-level (<5.0)

Output requirements: The scoring results must be fully output to the user, including the overall score, grade, and a detailed table of the 6-dimension scores. They must not be omitted or used only internally.

For scoring standards, calculation formulas, and output format templates, see references/guide.md

Step 4: Output optimization suggestions (must be output to the user)

  • S-level: Explain why it is good based on the 6-dimension viral patterns + 3-5 highly liked titles on the same topic and their similarities
  • A/B/C-level: Core problem list + 3-5 reference viral titles (including reusable points) + 2-3 revised versions (practical style/emotional style/curiosity style, with applicable scenarios and expected effects noted)

For the detailed output format template, see references/guide.md


Usage examples

Function 1: Viral title generation

  • Scenario/input: User inputs "sunscreen"
  • Expected output: Query sunscreen viral data → report the amount obtained (e.g., "A total of 35 viral data entries were obtained, including 10 low-follower viral posts...") → generate 10 new viral titles
  • Key points: Only query sunscreen, not including sunscreen spray, sun-protective clothing, etc.; must output the amount of data obtained

Function 2: Title scoring

  • Scenario/input: User inputs "Please score 'this sunscreen is really amazing' for me, keyword sunscreen"
  • Expected output: Query data and report the number of items retrieved → scoring report (6-dimension weighted score + grade) → optimization suggestions (core issues + reference viral posts + revised version)
  • Key points: Score based on sunscreen-related viral post data, must output the number of data items retrieved, and optimization suggestions must be targeted

Resource index

  • Data query script:scripts/fetch_xhs_trends.py(Query Xiaohongshu viral post data, parameters: --keyword keyword --start-date start date)
  • Scoring and keyword guide:references/guide.md(When executing function two, read the scoring criteria and output template; when determining keyword type, read the detailed definitions and examples of generalized words/specific words)